From 4582db2995ba4b1aaf9ba1f39a6668f1b4d51e46 Mon Sep 17 00:00:00 2001 From: Jun Shi Date: Tue, 6 Jun 2023 10:42:36 +0800 Subject: [PATCH 1/4] Try to remove "prefer_source_distribution" --- ci-configs/packages-latest.json | 120 ---------------- ci-configs/packages-preview.json | 237 ------------------------------- 2 files changed, 357 deletions(-) diff --git a/ci-configs/packages-latest.json b/ci-configs/packages-latest.json index 6e2f34d09cea..e943b4873fd6 100644 --- a/ci-configs/packages-latest.json +++ b/ci-configs/packages-latest.json @@ -273,7 +273,6 @@ "package_info": { "name": "azure-keyvault-keys", "install_type": "pypi", - "prefer_source_distribution": "true", "extra_index_url": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-python/pypi/simple/", "version": "==4.8.0" }, @@ -1003,7 +1002,6 @@ "package_info": { "install_type": "pypi", "name": "azure-servicebus", - "prefer_source_distribution": "true", "version": "==7.4.0" }, "exclude_path": [ @@ -1349,7 +1347,6 @@ "package_info": { "name": "azure-storage-blob", "install_type": "pypi", - "prefer_source_distribution": "true", "extra_index_url": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-python/pypi/simple/", "version": "==12.16.0" }, @@ -1378,7 +1375,6 @@ "package_info": { "name": "azure-storage-queue", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==12.6.0" }, "exclude_path": [ @@ -1481,7 +1477,6 @@ "package_info": { "name": "azure-identity", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.13.0" }, "exclude_path": [ @@ -1495,7 +1490,6 @@ "package_info": { "name": "azure-keyvault-secrets", "install_type": "pypi", - "prefer_source_distribution": "true", "extra_index_url": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-python/pypi/simple/", "version": "==4.7.0" }, @@ -1510,7 +1504,6 @@ "package_info": { "name": "azure-core", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.27.0" }, "exclude_path": [ @@ -1551,7 +1544,6 @@ "package_info": { "name": "azure-storage-file-share", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==12.12.0" }, "exclude_path": [ @@ -1565,7 +1557,6 @@ "package_info": { "name": "azure-keyvault-certificates", "install_type": "pypi", - "prefer_source_distribution": "true", "extra_index_url": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-python/pypi/simple/", "version": "==4.7.0" }, @@ -1580,7 +1571,6 @@ "package_info": { "name": "azure-appconfiguration", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.4.0" }, "exclude_path": [ @@ -1594,7 +1584,6 @@ "package_info": { "name": "azure-eventhub", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==5.11.2" }, "exclude_path": [ @@ -1620,7 +1609,6 @@ "package_info": { "name": "azure-eventhub-checkpointstoreblob", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.1.4" }, "exclude_path": [ @@ -1635,7 +1623,6 @@ "package_info": { "name": "azure-eventhub-checkpointstoreblob-aio", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.1.4" }, "exclude_path": [ @@ -1675,7 +1662,6 @@ "package_info": { "name": "azure-storage-file-datalake", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==12.11.0" }, "exclude_path": [ @@ -1702,7 +1688,6 @@ "package_info": { "name": "azure-mgmt-core", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.4.0" }, "exclude_path": [ @@ -1716,7 +1701,6 @@ "package_info": { "name": "azure-cosmos", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==4.3.1" }, "exclude_path": [ @@ -1730,7 +1714,6 @@ "package_info": { "name": "azure-ai-textanalytics", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==5.2.1" }, "exclude_path": [ @@ -1757,7 +1740,6 @@ "package_info": { "name": "azure-search-documents", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==11.3.0" }, "exclude_path": [ @@ -1784,7 +1766,6 @@ "package_info": { "name": "azure-mgmt-hybridkubernetes", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.1.0" }, "exclude_path": [ @@ -1802,7 +1783,6 @@ "doc*" ], "package_info": { - "prefer_source_distribution": "true", "install_type": "pypi", "name": "azure-ai-formrecognizer", "version": "==3.2.1" @@ -1829,7 +1809,6 @@ "doc*" ], "package_info": { - "prefer_source_distribution": "true", "install_type": "pypi", "name": "azure-mgmt-appconfiguration", "version": "==3.0.0" @@ -1864,7 +1843,6 @@ "package_info": { "name": "azure-digitaltwins-core", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.2.0" }, "exclude_path": [ @@ -1891,7 +1869,6 @@ "package_info": { "install_type": "pypi", "name": "azure-mgmt-machinelearningservices", - "prefer_source_distribution": "true", "version": "==1.0.0" }, "exclude_path": [ @@ -1905,7 +1882,6 @@ "package_info": { "install_type": "pypi", "name": "azure-mgmt-automation", - "prefer_source_distribution": "true", "version": "==1.0.0" }, "exclude_path": [ @@ -1917,7 +1893,6 @@ }, { "package_info": { - "prefer_source_distribution": "true", "install_type": "pypi", "name": "azure-mgmt-marketplaceordering", "version": "==1.1.0" @@ -1933,7 +1908,6 @@ "package_info": { "install_type": "pypi", "name": "azure-mgmt-operationsmanagement", - "prefer_source_distribution": "true", "version": "==1.0.0" }, "exclude_path": [ @@ -1952,7 +1926,6 @@ ], "package_info": { "name": "azure-mgmt-costmanagement", - "prefer_source_distribution": "true", "install_type": "pypi", "version": "==4.0.0" } @@ -1966,7 +1939,6 @@ ], "package_info": { "name": "azure-mgmt-confluent", - "prefer_source_distribution": "true", "install_type": "pypi", "version": "==1.0.0" } @@ -1980,7 +1952,6 @@ ], "package_info": { "name": "azure-mgmt-redisenterprise", - "prefer_source_distribution": "true", "install_type": "pypi", "version": "==2.0.0" } @@ -1994,7 +1965,6 @@ ], "package_info": { "name": "azure-mgmt-purview", - "prefer_source_distribution": "true", "install_type": "pypi", "version": "==1.0.0" } @@ -2008,14 +1978,12 @@ ], "package_info": { "name": "azure-mgmt-deviceupdate", - "prefer_source_distribution": "true", "install_type": "pypi", "version": "==1.0.0" } }, { "package_info": { - "prefer_source_distribution": "true", "install_type": "pypi", "name": "azure-mgmt-databricks", "version": "==1.0.0" @@ -2029,7 +1997,6 @@ }, { "package_info": { - "prefer_source_distribution": "true", "install_type": "pypi", "name": "azure-mgmt-datadog", "version": "==2.0.0" @@ -2043,7 +2010,6 @@ }, { "package_info": { - "prefer_source_distribution": "true", "install_type": "pypi", "name": "azure-mgmt-databox", "version": "==2.0.0" @@ -2057,7 +2023,6 @@ }, { "package_info": { - "prefer_source_distribution": "true", "install_type": "pypi", "name": "azure-mgmt-alertsmanagement", "version": "==1.0.0" @@ -2071,7 +2036,6 @@ }, { "package_info": { - "prefer_source_distribution": "true", "install_type": "pypi", "name": "azure-mgmt-attestation", "version": "==1.0.0" @@ -2086,7 +2050,6 @@ { "package_info": { "install_type": "pypi", - "prefer_source_distribution": "true", "name": "azure-mgmt-communication", "version": "==2.0.0" }, @@ -2105,7 +2068,6 @@ "doc*" ], "package_info": { - "prefer_source_distribution": "true", "name": "azure-mgmt-frontdoor", "install_type": "pypi", "extra_index_url": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-python/pypi/simple/", @@ -2116,7 +2078,6 @@ "package_info": { "name": "azure-mgmt-powerbidedicated", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.0.0" }, "exclude_path": [ @@ -2130,7 +2091,6 @@ "package_info": { "name": "azure-mgmt-timeseriesinsights", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.0.0" }, "exclude_path": [ @@ -2144,7 +2104,6 @@ "package_info": { "name": "azure-mgmt-datamigration", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==10.0.0" }, "exclude_path": [ @@ -2156,7 +2115,6 @@ }, { "package_info": { - "prefer_source_distribution": "true", "name": "azure-mgmt-changeanalysis", "install_type": "pypi", "version": "==1.0.0" @@ -2177,7 +2135,6 @@ ], "package_info": { "name": "azure-mgmt-azurestack", - "prefer_source_distribution": "true", "install_type": "pypi", "version": "==1.0.0" } @@ -2192,7 +2149,6 @@ "package_info": { "name": "azure-mgmt-storagesync", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.0.0" } }, @@ -2206,7 +2162,6 @@ "package_info": { "name": "azure-mgmt-customproviders", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.0.0" } }, @@ -2220,13 +2175,11 @@ "package_info": { "name": "azure-mgmt-servicebus", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==8.2.0" } }, { "package_info": { - "prefer_source_distribution": "true", "install_type": "pypi", "name": "azure-mgmt-datashare", "version": "==1.0.0" @@ -2248,7 +2201,6 @@ "package_info": { "name": "azure-mgmt-healthcareapis", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.1.0" } }, @@ -2262,7 +2214,6 @@ "package_info": { "name": "azure-communication-chat", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.1.0" } }, @@ -2276,7 +2227,6 @@ "package_info": { "name": "azure-communication-identity", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.3.1" } }, @@ -2290,7 +2240,6 @@ "package_info": { "name": "azure-communication-phonenumbers", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.1.0" } }, @@ -2304,7 +2253,6 @@ "package_info": { "name": "azure-communication-sms", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.0.1" } }, @@ -2318,7 +2266,6 @@ "package_info": { "name": "azure-mgmt-databoxedge", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.0.0" } }, @@ -2332,7 +2279,6 @@ "package_info": { "name": "azure-mgmt-maintenance", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==2.0.0" } }, @@ -2346,7 +2292,6 @@ "package_info": { "name": "azure-mgmt-maps", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==2.0.0" } }, @@ -2360,7 +2305,6 @@ "package_info": { "name": "azure-mgmt-peering", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.0.0" } }, @@ -2374,7 +2318,6 @@ "package_info": { "name": "azure-mgmt-botservice", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==2.0.0" } }, @@ -2388,7 +2331,6 @@ "package_info": { "name": "azure-mgmt-managementpartner", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.0.0" } }, @@ -2402,7 +2344,6 @@ "package_info": { "name": "azure-mgmt-redhatopenshift", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.2.0" } }, @@ -2416,7 +2357,6 @@ "package_info": { "name": "azure-mgmt-serialconsole", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.0.0" } }, @@ -2430,7 +2370,6 @@ "package_info": { "name": "azure-data-tables", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==12.4.2" } }, @@ -2444,7 +2383,6 @@ "package_info": { "name": "azure-keyvault-administration", "install_type": "pypi", - "prefer_source_distribution": "true", "extra_index_url": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-python/pypi/simple/", "version": "==4.3.0" } @@ -2459,7 +2397,6 @@ "package_info": { "name": "azure-security-attestation", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.0.0" } }, @@ -2473,7 +2410,6 @@ "package_info": { "name": "azure-ai-metricsadvisor", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.0.0" } }, @@ -2487,7 +2423,6 @@ "package_info": { "name": "azure-mgmt-avs", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==7.1.0" } }, @@ -2495,7 +2430,6 @@ "package_info": { "name": "azure-mgmt-baremetalinfrastructure", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.0.0" }, "exclude_path": [ @@ -2509,7 +2443,6 @@ "package_info": { "name": "azure-mgmt-storagepool", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.0.0" }, "exclude_path": [ @@ -2523,7 +2456,6 @@ "package_info": { "name": "azure-mgmt-azurearcdata", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.0.0" }, "exclude_path": [ @@ -2537,7 +2469,6 @@ "package_info": { "name": "azure-ai-language-questionanswering", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.1.0" }, "exclude_path": [ @@ -2551,7 +2482,6 @@ "package_info": { "name": "azure-schemaregistry", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.2.0" }, "exclude_path": [ @@ -2565,7 +2495,6 @@ "package_info": { "name": "azure-messaging-webpubsubservice", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.0.1" }, "exclude_path": [ @@ -2579,7 +2508,6 @@ "package_info": { "name": "azure-mgmt-iotcentral", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==9.0.0" }, "exclude_path": [ @@ -2592,7 +2520,6 @@ { "package_info": { "install_type": "pypi", - "prefer_source_distribution": "true", "name": "azure-monitor-query", "version": "==1.2.0" }, @@ -2607,7 +2534,6 @@ "package_info": { "name": "azure-mgmt-edgeorder", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.0.0" }, "exclude_path": [ @@ -2621,7 +2547,6 @@ "package_info": { "name": "azure-mgmt-kubernetesconfiguration", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==3.0.0" }, "exclude_path": [ @@ -2635,7 +2560,6 @@ "package_info": { "name": "azure-containerregistry", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.1.0" }, "exclude_path": [ @@ -2649,7 +2573,6 @@ "package_info": { "name": "azure-mgmt-storagecache", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.4.0" }, "exclude_path": [ @@ -2663,7 +2586,6 @@ "package_info": { "name": "azure-communication-networktraversal", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.0.0", "extra_index_url": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-python/pypi/simple/" }, @@ -2678,7 +2600,6 @@ "package_info": { "name": "azure-mgmt-elastic", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.0.0" }, "exclude_path": [ @@ -2692,7 +2613,6 @@ "package_info": { "name": "azure-mgmt-extendedlocation", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.1.0" }, "exclude_path": [ @@ -2706,7 +2626,6 @@ "package_info": { "name": "azure-mgmt-hybridnetwork", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.0.0" }, "exclude_path": [ @@ -2720,7 +2639,6 @@ "package_info": { "name": "azure-mgmt-logz", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.0.0" }, "exclude_path": [ @@ -2734,7 +2652,6 @@ "package_info": { "name": "azure-mgmt-portal", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.0.0" }, "exclude_path": [ @@ -2748,7 +2665,6 @@ "package_info": { "name": "azure-mgmt-servicefabricmanagedclusters", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.0.0" }, "exclude_path": [ @@ -2762,7 +2678,6 @@ "package_info": { "name": "azure-mgmt-servicelinker", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.1.0" }, "exclude_path": [ @@ -2776,7 +2691,6 @@ "package_info": { "name": "azure-schemaregistry-avroencoder", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.0.0" }, "exclude_path": [ @@ -2790,7 +2704,6 @@ "package_info": { "name": "azure-mgmt-appcontainers", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==2.0.0" }, "exclude_path": [ @@ -2804,7 +2717,6 @@ "package_info": { "name": "azure-mgmt-confidentialledger", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.0.0" }, "exclude_path": [ @@ -2818,7 +2730,6 @@ "package_info": { "name": "azure-ai-translation-document", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.0.0" }, "exclude_path": [ @@ -2832,7 +2743,6 @@ "package_info": { "name": "azure-mgmt-imagebuilder", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.2.0" }, "exclude_path": [ @@ -2846,7 +2756,6 @@ "package_info": { "name": "azure-mgmt-orbital", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==2.0.0" }, "exclude_path": [ @@ -2860,7 +2769,6 @@ "package_info": { "name": "azure-ai-language-conversations", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.0.0" }, "exclude_path": [ @@ -2874,7 +2782,6 @@ "package_info": { "name": "azure-confidentialledger", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.1.0" }, "exclude_path": [ @@ -2888,7 +2795,6 @@ "package_info": { "name": "azure-mgmt-securityinsight", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.0.0" }, "exclude_path": [ @@ -2902,7 +2808,6 @@ "package_info": { "name": "azure-mgmt-automanage", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.0.0" }, "exclude_path": [ @@ -2916,7 +2821,6 @@ "package_info": { "name": "azure-mgmt-fluidrelay", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.0.0" }, "exclude_path": [ @@ -2930,7 +2834,6 @@ "package_info": { "name": "azure-mgmt-dashboard", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.0.0" }, "exclude_path": [ @@ -2944,7 +2847,6 @@ "package_info": { "name": "azure-mgmt-nginx", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==2.1.0" }, "exclude_path": [ @@ -2958,7 +2860,6 @@ "package_info": { "name": "azure-iot-deviceupdate", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.0.0" }, "exclude_path": [ @@ -2972,7 +2873,6 @@ "package_info": { "name": "azure-mgmt-dnsresolver", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.0.0" }, "exclude_path": [ @@ -2986,7 +2886,6 @@ "package_info": { "name": "azure-mgmt-dynatrace", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.0.0" }, "exclude_path": [ @@ -3000,7 +2899,6 @@ "package_info": { "name": "azure-ai-ml", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.7.2" }, "exclude_path": [ @@ -3014,7 +2912,6 @@ "package_info": { "name": "azure-mgmt-network", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==22.1.0" }, "exclude_path": [ @@ -3029,7 +2926,6 @@ "package_info": { "name": "azure-mgmt-webpubsub", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.1.0" }, "exclude_path": [ @@ -3043,7 +2939,6 @@ "package_info": { "name": "azure-mgmt-signalr", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.1.0" }, "exclude_path": [ @@ -3057,7 +2952,6 @@ "package_info": { "name": "azure-mgmt-mobilenetwork", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==2.0.0" }, "exclude_path": [ @@ -3071,7 +2965,6 @@ "package_info": { "name": "azure-mgmt-recoveryservicessiterecovery", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.0.0" }, "exclude_path": [ @@ -3085,7 +2978,6 @@ "package_info": { "name": "azure-mgmt-loadtesting", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.0.0" }, "exclude_path": [ @@ -3099,7 +2991,6 @@ "package_info": { "name": "azure-monitor-ingestion", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.0.1" }, "exclude_path": [ @@ -3113,7 +3004,6 @@ "package_info": { "name": "azure-mgmt-dataprotection", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.0.0" }, "exclude_path": [ @@ -3127,7 +3017,6 @@ "package_info": { "name": "azure-developer-loadtesting", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.0.0" }, "exclude_path": [ @@ -3141,7 +3030,6 @@ "package_info": { "name": "azure-mgmt-storagemover", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.0.0" }, "exclude_path": [ @@ -3155,7 +3043,6 @@ "package_info": { "name": "azure-appconfiguration-provider", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.0.0" }, "exclude_path": [ @@ -3169,7 +3056,6 @@ "package_info": { "name": "azure-mgmt-desktopvirtualization", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.0.0" }, "exclude_path": [ @@ -3183,7 +3069,6 @@ "package_info": { "name": "azure-communication-email", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.0.0" }, "exclude_path": [ @@ -3197,7 +3082,6 @@ "package_info": { "name": "azure-mgmt-workloads", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.0.0" }, "exclude_path": [ @@ -3211,7 +3095,6 @@ "package_info": { "name": "azure-mgmt-devcenter", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.0.0" }, "exclude_path": [ @@ -3225,7 +3108,6 @@ "package_info": { "name": "azure-mgmt-newrelicobservability", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.0.0" }, "exclude_path": [ @@ -3239,7 +3121,6 @@ "package_info": { "name": "azure-mgmt-voiceservices", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.0.0" }, "exclude_path": [ @@ -3253,7 +3134,6 @@ "package_info": { "name": "azure-mgmt-qumulo", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.0.0" }, "exclude_path": [ diff --git a/ci-configs/packages-preview.json b/ci-configs/packages-preview.json index f9f1774c12e0..3eb655c70bcf 100644 --- a/ci-configs/packages-preview.json +++ b/ci-configs/packages-preview.json @@ -8,7 +8,6 @@ { "package_info": { "install_type": "pypi", - "prefer_source_distribution": "true", "name": "azure-iot-hub", "version": "2.2.1rc2" }, @@ -36,7 +35,6 @@ { "package_info": { "install_type": "pypi", - "prefer_source_distribution": "true", "name": "azure-storage-blob-changefeed", "extra_index_url": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-python/pypi/simple/", "version": "==12.0.0b4" @@ -50,7 +48,6 @@ }, { "package_info": { - "prefer_source_distribution": "true", "name": "azure-ai-anomalydetector", "install_type": "pypi", "extra_index_url": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-python/pypi/simple/", @@ -66,7 +63,6 @@ { "package_info": { "install_type": "pypi", - "prefer_source_distribution": "true", "name": "azure-schemaregistry-avroserializer", "version": "==1.0.0b4" }, @@ -79,7 +75,6 @@ }, { "package_info": { - "prefer_source_distribution": "true", "name": "azure-mgmt-automanage", "install_type": "pypi", "extra_index_url": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-python/pypi/simple/", @@ -95,7 +90,6 @@ { "package_info": { "install_type": "pypi", - "prefer_source_distribution": "true", "name": "azure-communication-administration", "version": ">=1.0.0b4" }, @@ -108,7 +102,6 @@ }, { "package_info": { - "prefer_source_distribution": "true", "install_type": "pypi", "name": "azure-mgmt-regionmove", "version": "==1.0.0b1" @@ -122,7 +115,6 @@ }, { "package_info": { - "prefer_source_distribution": "true", "install_type": "pypi", "name": "azure-mgmt-resourcemover", "extra_index_url": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-python/pypi/simple/", @@ -138,7 +130,6 @@ { "package_info": { "install_type": "pypi", - "prefer_source_distribution": "true", "name": "azure-mgmt-datadog", "version": "==2.1.0b1" }, @@ -153,7 +144,6 @@ "package_info": { "name": "azure-mgmt-workloadmonitor", "install_type": "pypi", - "prefer_source_distribution": "true", "extra_index_url": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-python/pypi/simple/", "version": "==1.0.0b4" }, @@ -168,7 +158,6 @@ "package_info": { "name": "azure-mgmt-securityinsight", "install_type": "pypi", - "prefer_source_distribution": "true", "extra_index_url": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-python/pypi/simple/", "version": "==2.0.0b2" }, @@ -189,7 +178,6 @@ "package_info": { "install_type": "pypi", "name": "azure-mgmt-resourcegraph", - "prefer_source_distribution": "true", "version": "==8.1.0b3" } }, @@ -203,7 +191,6 @@ "package_info": { "install_type": "pypi", "name": "azure-mgmt-scheduler", - "prefer_source_distribution": "true", "version": "==7.0.0b1" } }, @@ -217,7 +204,6 @@ "package_info": { "install_type": "pypi", "name": "azure-mgmt-automation", - "prefer_source_distribution": "true", "version": "==1.1.0b3" } }, @@ -229,7 +215,6 @@ "doc*" ], "package_info": { - "prefer_source_distribution": "true", "name": "azure-mgmt-azureadb2c", "install_type": "pypi", "version": "==1.0.0b1" @@ -244,7 +229,6 @@ ], "package_info": { "install_type": "pypi", - "prefer_source_distribution": "true", "name": "azure-mgmt-healthbot", "version": "==1.0.0b2" } @@ -258,7 +242,6 @@ ], "package_info": { "install_type": "pypi", - "prefer_source_distribution": "true", "name": "azure-media-analytics-edge", "version": "==1.0.0b2" } @@ -273,7 +256,6 @@ "package_info": { "install_type": "pypi", "name": "azure-mgmt-privatedns", - "prefer_source_distribution": "true", "version": "==1.1.0b1" } }, @@ -287,7 +269,6 @@ "package_info": { "install_type": "pypi", "name": "azure-mgmt-quantum", - "prefer_source_distribution": "true", "version": "==1.0.0b3" } }, @@ -295,7 +276,6 @@ "package_info": { "install_type": "pypi", "name": "azure-mgmt-deviceupdate", - "prefer_source_distribution": "true", "version": "==1.1.0b1" }, "exclude_path": [ @@ -315,14 +295,12 @@ "package_info": { "install_type": "pypi", "name": "azure-iot-deviceupdate", - "prefer_source_distribution": "true", "version": "==1.0.0b3" } }, { "package_info": { "install_type": "pypi", - "prefer_source_distribution": "true", "name": "azure-mgmt-dns", "version": "==8.1.0b1" }, @@ -337,7 +315,6 @@ "package_info": { "name": "azure-template", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==0.1.0b2675288" }, "exclude_path": [ @@ -356,7 +333,6 @@ ], "package_info": { "install_type": "pypi", - "prefer_source_distribution": "true", "name": "azure-mgmt-extendedlocation", "extra_index_url": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-python/pypi/simple/", "version": "==1.2.0b1" @@ -372,7 +348,6 @@ "package_info": { "install_type": "pypi", "name": "azure-ai-translation-document", - "prefer_source_distribution": "true", "version": "==1.0.0b6" } }, @@ -386,7 +361,6 @@ "package_info": { "name": "azure-synapse-accesscontrol", "install_type": "pypi", - "prefer_source_distribution": "true", "extra_index_url": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-python/pypi/simple/", "version": "==0.7.0" } @@ -402,7 +376,6 @@ "package_info": { "name": "azure-synapse-artifacts", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==0.14.0" } }, @@ -416,7 +389,6 @@ "package_info": { "name": "azure-synapse-managedprivateendpoints", "install_type": "pypi", - "prefer_source_distribution": "true", "extra_index_url": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-python/pypi/simple/", "version": "==0.4.0" } @@ -431,7 +403,6 @@ "package_info": { "name": "azure-synapse-monitoring", "install_type": "pypi", - "prefer_source_distribution": "true", "extra_index_url": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-python/pypi/simple/", "version": "==0.2.0" } @@ -446,7 +417,6 @@ "package_info": { "name": "azure-synapse-spark", "install_type": "pypi", - "prefer_source_distribution": "true", "extra_index_url": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-python/pypi/simple/", "version": "==0.7.0" } @@ -461,7 +431,6 @@ "package_info": { "name": "azure-messaging-webpubsubservice", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.1.0b1" } }, @@ -469,7 +438,6 @@ "package_info": { "install_type": "pypi", "name": "azure-core-tracing-opentelemetry", - "prefer_source_distribution": "true", "version": "==1.0.0b9" }, "exclude_path": [ @@ -489,7 +457,6 @@ "package_info": { "name": "azure-confidentialledger", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.0.0a20220330001", "extra_index_url": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-python/pypi/simple/" } @@ -504,7 +471,6 @@ "package_info": { "name": "azure-purview-catalog", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.0.0b4" } }, @@ -518,7 +484,6 @@ "package_info": { "name": "azure-purview-scanning", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.0.0b2" } }, @@ -532,7 +497,6 @@ "package_info": { "name": "azure-media-videoanalyzer-edge", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.0.0b4" } }, @@ -546,14 +510,12 @@ "package_info": { "name": "azure-mgmt-confluent", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==2.0.0b2" } }, { "package_info": { "install_type": "pypi", - "prefer_source_distribution": "true", "name": "azure-mgmt-testbase", "version": "==1.0.0b2" }, @@ -567,7 +529,6 @@ { "package_info": { "install_type": "pypi", - "prefer_source_distribution": "true", "name": "azure-mgmt-agrifood", "version": "==1.0.0b3" }, @@ -581,7 +542,6 @@ { "package_info": { "install_type": "pypi", - "prefer_source_distribution": "true", "name": "azure-agrifood-farming", "version": "==1.0.0b2" }, @@ -602,7 +562,6 @@ "package_info": { "name": "azure-search-documents", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==11.4.0b3" } }, @@ -616,7 +575,6 @@ "package_info": { "name": "azure-containerregistry", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.1.0b4" } }, @@ -643,7 +601,6 @@ "package_info": { "name": "azure-keyvault-keys", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==4.9.0b1" } }, @@ -651,7 +608,6 @@ "package_info": { "name": "azure-mgmt-databricks", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.1.0b2" }, "exclude_path": [ @@ -665,7 +621,6 @@ "package_info": { "name": "azure-ai-textanalytics", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==5.3.0b2" }, "exclude_path": [ @@ -679,7 +634,6 @@ "package_info": { "name": "azure-communication-networktraversal", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.1.0b1" }, "exclude_path": [ @@ -693,7 +647,6 @@ "package_info": { "name": "azure-mgmt-policyinsights", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.1.0b4" }, "exclude_path": [ @@ -707,7 +660,6 @@ "package_info": { "name": "azure-mgmt-synapse", "install_type": "pypi", - "prefer_source_distribution": "true", "extra_index_url": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-python/pypi/simple/", "version": "==2.1.0b7" }, @@ -722,7 +674,6 @@ "package_info": { "name": "azure-keyvault-certificates", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==4.8.0b1" }, "exclude_path": [ @@ -736,7 +687,6 @@ "package_info": { "name": "azure-keyvault-secrets", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==4.8.0b1" }, "exclude_path": [ @@ -750,7 +700,6 @@ "package_info": { "name": "azure-keyvault-administration", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==4.4.0b1" }, "exclude_path": [ @@ -764,7 +713,6 @@ "package_info": { "name": "azure-purview-account", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.0.0b1" }, "exclude_path": [ @@ -778,7 +726,6 @@ "package_info": { "name": "azure-mgmt-cosmosdb", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==9.1.0b2" }, "exclude_path": [ @@ -792,7 +739,6 @@ "package_info": { "name": "azure-ai-formrecognizer", "install_type": "pypi", - "prefer_source_distribution": "true", "extra_index_url": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-python/pypi/simple/", "version": "==3.3.0b1" }, @@ -807,7 +753,6 @@ "package_info": { "name": "azure-purview-administration", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.0.0b1" }, "exclude_path": [ @@ -821,7 +766,6 @@ "package_info": { "name": "azure-mgmt-chaos", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.0.0b6" }, "exclude_path": [ @@ -835,7 +779,6 @@ "package_info": { "name": "azure-mgmt-dataprotection", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.0.0b4" }, "exclude_path": [ @@ -849,7 +792,6 @@ "package_info": { "name": "azure-ai-language-conversations", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.1.0b3" }, "exclude_path": [ @@ -863,7 +805,6 @@ "package_info": { "name": "azure-storage-blob", "install_type": "pypi", - "prefer_source_distribution": "true", "extra_index_url": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-python/pypi/simple/", "version": "==12.17.0b1" }, @@ -878,7 +819,6 @@ "package_info": { "name": "azure-storage-file-datalake", "install_type": "pypi", - "prefer_source_distribution": "true", "extra_index_url": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-python/pypi/simple/", "version": "==12.12.0b1" }, @@ -893,7 +833,6 @@ "package_info": { "name": "azure-communication-identity", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.4.0b1" }, "exclude_path": [ @@ -907,7 +846,6 @@ "package_info": { "name": "azure-mixedreality-authentication", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.0.0b1" }, "exclude_path": [ @@ -934,7 +872,6 @@ "package_info": { "name": "azure-mgmt-maintenance", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==2.1.0b2" }, "exclude_path": [ @@ -948,7 +885,6 @@ "package_info": { "name": "azure-mgmt-orbital", "install_type": "pypi", - "prefer_source_distribution": "true", "extra_index_url": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-python/pypi/simple/", "version": "==1.1.0b1" }, @@ -963,7 +899,6 @@ "package_info": { "name": "azure-loganalytics", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==0.1.1" }, "exclude_path": [ @@ -977,7 +912,6 @@ "package_info": { "name": "azure-cognitiveservices-vision-face", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==0.6.0" }, "exclude_path": [ @@ -991,7 +925,6 @@ "package_info": { "name": "azure-mgmt-connectedvmware", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.0.0b3" }, "exclude_path": [ @@ -1005,7 +938,6 @@ "package_info": { "name": "azure-mgmt-desktopvirtualization", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.0.0b2" }, "exclude_path": [ @@ -1019,7 +951,6 @@ "package_info": { "name": "azure-mgmt-resourceconnector", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.0.0b4" }, "exclude_path": [ @@ -1033,7 +964,6 @@ "package_info": { "name": "azure-storage-file-share", "install_type": "pypi", - "prefer_source_distribution": "true", "extra_index_url": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-python/pypi/simple/", "version": "==12.13.0b1" }, @@ -1048,7 +978,6 @@ "package_info": { "name": "azure-mgmt-sql", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==4.0.0b10" }, "exclude_path": [ @@ -1062,7 +991,6 @@ "package_info": { "name": "azure-cosmos", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==4.4.0b2" }, "exclude_path": [ @@ -1076,7 +1004,6 @@ "package_info": { "name": "azure-mgmt-botservice", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==2.0.0b4" }, "exclude_path": [ @@ -1090,7 +1017,6 @@ "package_info": { "name": "azure-eventhub", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==5.8.0b2" }, "exclude_path": [ @@ -1104,7 +1030,6 @@ "package_info": { "name": "azure-mgmt-streamanalytics", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.0.0rc1" }, "exclude_path": [ @@ -1118,7 +1043,6 @@ "package_info": { "name": "azure-communication-phonenumbers", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.1.0b3" }, "exclude_path": [ @@ -1132,7 +1056,6 @@ "package_info": { "name": "azure-mgmt-loganalytics", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==13.0.0b6" }, "exclude_path": [ @@ -1146,7 +1069,6 @@ "package_info": { "name": "azure-mgmt-servicelinker", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.2.0b1" }, "exclude_path": [ @@ -1160,7 +1082,6 @@ "package_info": { "name": "azure-identity", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.13.0b4" }, "exclude_path": [ @@ -1174,7 +1095,6 @@ "package_info": { "name": "azure-schemaregistry-avroencoder", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.0.0b3" }, "exclude_path": [ @@ -1188,7 +1108,6 @@ "package_info": { "name": "azure-ai-language-questionanswering", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.1.0b2" }, "exclude_path": [ @@ -1202,7 +1121,6 @@ "package_info": { "name": "azure-applicationinsights", "install_type": "pypi", - "prefer_source_distribution": "true", "extra_index_url": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-python/pypi/simple/", "version": "==0.1.1" }, @@ -1217,7 +1135,6 @@ "package_info": { "name": "azure-mgmt-oep", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.0.0b2" }, "exclude_path": [ @@ -1231,7 +1148,6 @@ "package_info": { "name": "azure-cognitiveservices-language-textanalytics", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==0.2.1" }, "exclude_path": [ @@ -1245,7 +1161,6 @@ "package_info": { "name": "azure-mgmt-appconfiguration", "install_type": "pypi", - "prefer_source_distribution": "true", "extra_index_url": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-python/pypi/simple/", "version": "==3.0.0b1" }, @@ -1260,7 +1175,6 @@ "package_info": { "name": "azure-mgmt-dnsresolver", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.1.0b1" }, "exclude_path": [ @@ -1274,7 +1188,6 @@ "package_info": { "name": "azure-mgmt-mobilenetwork", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.0.0b3" }, "exclude_path": [ @@ -1288,7 +1201,6 @@ "package_info": { "name": "azure-mgmt-sqlvirtualmachine", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.0.0b5" }, "exclude_path": [ @@ -1302,7 +1214,6 @@ "package_info": { "name": "azure-mgmt-labservices", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==2.1.0b1" }, "exclude_path": [ @@ -1316,7 +1227,6 @@ "package_info": { "name": "azure-mgmt-app", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.0.0b2" }, "exclude_path": [ @@ -1330,7 +1240,6 @@ "package_info": { "name": "azure-mgmt-msi", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==7.1.0b1" }, "exclude_path": [ @@ -1344,7 +1253,6 @@ "package_info": { "name": "azure-appconfiguration", "install_type": "pypi", - "prefer_source_distribution": "true", "extra_index_url": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-python/pypi/simple/", "version": "==1.4.0b1" }, @@ -1359,7 +1267,6 @@ "package_info": { "name": "azure-storage-queue", "install_type": "pypi", - "prefer_source_distribution": "true", "extra_index_url": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-python/pypi/simple/", "version": "==12.6.0b1" }, @@ -1374,7 +1281,6 @@ "package_info": { "name": "azure-mgmt-advisor", "install_type": "pypi", - "prefer_source_distribution": "true", "extra_index_url": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-python/pypi/simple/", "version": "==10.0.0b1" }, @@ -1389,7 +1295,6 @@ "package_info": { "name": "azure-mgmt-applicationinsights", "install_type": "pypi", - "prefer_source_distribution": "true", "extra_index_url": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-python/pypi/simple/", "version": "==4.0.0b1" }, @@ -1404,7 +1309,6 @@ "package_info": { "name": "azure-mgmt-azurestack", "install_type": "pypi", - "prefer_source_distribution": "true", "extra_index_url": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-python/pypi/simple/", "version": "==2.0.0b1" }, @@ -1419,7 +1323,6 @@ "package_info": { "name": "azure-mgmt-containerinstance", "install_type": "pypi", - "prefer_source_distribution": "true", "extra_index_url": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-python/pypi/simple/", "version": "==10.1.0b2" }, @@ -1434,7 +1337,6 @@ "package_info": { "name": "azure-mgmt-cdn", "install_type": "pypi", - "prefer_source_distribution": "true", "extra_index_url": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-python/pypi/simple/", "version": "==12.1.0b1" }, @@ -1449,7 +1351,6 @@ "package_info": { "name": "azure-mgmt-customproviders", "install_type": "pypi", - "prefer_source_distribution": "true", "extra_index_url": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-python/pypi/simple/", "version": "==1.1.0b1" }, @@ -1464,7 +1365,6 @@ "package_info": { "name": "azure-mgmt-databox", "install_type": "pypi", - "prefer_source_distribution": "true", "extra_index_url": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-python/pypi/simple/", "version": "==2.0.0b1" }, @@ -1480,7 +1380,6 @@ "package_info": { "name": "azure-mgmt-operationsmanagement", "install_type": "pypi", - "prefer_source_distribution": "true", "extra_index_url": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-python/pypi/simple/", "version": "==2.0.0b1" }, @@ -1495,7 +1394,6 @@ "package_info": { "name": "azure-mgmt-powerbidedicated", "install_type": "pypi", - "prefer_source_distribution": "true", "extra_index_url": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-python/pypi/simple/", "version": "==1.1.0b1" }, @@ -1510,7 +1408,6 @@ "package_info": { "name": "azure-mgmt-redhatopenshift", "install_type": "pypi", - "prefer_source_distribution": "true", "extra_index_url": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-python/pypi/simple/", "version": "==1.3.0b1" }, @@ -1525,7 +1422,6 @@ "package_info": { "name": "azure-mgmt-storage", "install_type": "pypi", - "prefer_source_distribution": "true", "extra_index_url": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-python/pypi/simple/", "version": "==21.1.0b1" }, @@ -1541,7 +1437,6 @@ "package_info": { "name": "azure-mgmt-storagesync", "install_type": "pypi", - "prefer_source_distribution": "true", "extra_index_url": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-python/pypi/simple/", "version": "==2.0.0b1" }, @@ -1556,7 +1451,6 @@ "package_info": { "name": "azure-mgmt-support", "install_type": "pypi", - "prefer_source_distribution": "true", "extra_index_url": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-python/pypi/simple/", "version": "==6.1.0b1" }, @@ -1571,7 +1465,6 @@ "package_info": { "name": "azure-mgmt-timeseriesinsights", "install_type": "pypi", - "prefer_source_distribution": "true", "extra_index_url": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-python/pypi/simple/", "version": "==2.0.0b1" }, @@ -1586,7 +1479,6 @@ "package_info": { "name": "azure-mgmt-logz", "install_type": "pypi", - "prefer_source_distribution": "true", "extra_index_url": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-python/pypi/simple/", "version": "==1.1.0b1" }, @@ -1601,7 +1493,6 @@ "package_info": { "name": "azure-mgmt-storagecache", "install_type": "pypi", - "prefer_source_distribution": "true", "extra_index_url": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-python/pypi/simple/", "version": "==1.4.0b1" }, @@ -1616,7 +1507,6 @@ "package_info": { "name": "azure-iot-modelsrepository", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.0.0a20220330001", "extra_index_url": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-python/pypi/simple/" }, @@ -1631,7 +1521,6 @@ "package_info": { "name": "azure-mgmt-avs", "install_type": "pypi", - "prefer_source_distribution": "true", "extra_index_url": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-python/pypi/simple/", "version": "==7.2.0b1" }, @@ -1646,7 +1535,6 @@ "package_info": { "name": "azure-mgmt-confidentialledger", "install_type": "pypi", - "prefer_source_distribution": "true", "extra_index_url": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-python/pypi/simple/", "version": "==2.0.0b3" }, @@ -1661,7 +1549,6 @@ "package_info": { "name": "azure-mgmt-storageimportexport", "install_type": "pypi", - "prefer_source_distribution": "true", "extra_index_url": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-python/pypi/simple/", "version": "==1.0.0b2" }, @@ -1676,7 +1563,6 @@ "package_info": { "name": "azure-synapse", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==0.1.1a20220330001", "extra_index_url": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-python/pypi/simple/" }, @@ -1691,7 +1577,6 @@ "package_info": { "name": "azure-mgmt-azurearcdata", "install_type": "pypi", - "prefer_source_distribution": "true", "extra_index_url": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-python/pypi/simple/", "version": "==2.0.0b1" }, @@ -1706,7 +1591,6 @@ "package_info": { "name": "azure-mgmt-imagebuilder", "install_type": "pypi", - "prefer_source_distribution": "true", "extra_index_url": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-python/pypi/simple/", "version": "==1.2.0b1" }, @@ -1721,7 +1605,6 @@ "package_info": { "name": "azure-mgmt-batch", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==16.1.0a20220330001", "extra_index_url": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-python/pypi/simple/" }, @@ -1736,7 +1619,6 @@ "package_info": { "name": "azure-batch", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==12.0.0a20220330001", "extra_index_url": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-python/pypi/simple/" }, @@ -1751,7 +1633,6 @@ "package_info": { "name": "azure-mgmt-vmwarecloudsimple", "install_type": "pypi", - "prefer_source_distribution": "true", "extra_index_url": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-python/pypi/simple/", "version": "==1.0.0b2" }, @@ -1766,7 +1647,6 @@ "package_info": { "name": "azure-mgmt-storagepool", "install_type": "pypi", - "prefer_source_distribution": "true", "extra_index_url": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-python/pypi/simple/", "version": "==1.1.0b1" }, @@ -1781,7 +1661,6 @@ "package_info": { "name": "azure-mgmt-batchai", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==7.0.0a20220330001", "extra_index_url": "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-python/pypi/simple/" }, @@ -1796,7 +1675,6 @@ "package_info": { "name": "azure-digitaltwins-core", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.2.0b1" }, "exclude_path": [ @@ -1810,7 +1688,6 @@ "package_info": { "name": "azure-eventgrid", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==4.12.0b1" }, "exclude_path": [ @@ -1824,7 +1701,6 @@ "package_info": { "name": "azure-mgmt-agfood", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.0.0b1" }, "exclude_path": [ @@ -1838,7 +1714,6 @@ "package_info": { "name": "azure-mgmt-dashboard", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.1.0b1" }, "exclude_path": [ @@ -1852,7 +1727,6 @@ "package_info": { "name": "azure-mgmt-guestconfig", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.0.0b2" }, "exclude_path": [ @@ -1866,7 +1740,6 @@ "package_info": { "name": "azure-mgmt-recoveryservicessiterecovery", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.0.0b2" }, "exclude_path": [ @@ -1880,7 +1753,6 @@ "package_info": { "name": "azure-mgmt-resourcehealth", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.0.0b4" }, "exclude_path": [ @@ -1894,7 +1766,6 @@ "package_info": { "name": "azure-mgmt-eventgrid", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==10.3.0b2" }, "exclude_path": [ @@ -1908,7 +1779,6 @@ "package_info": { "name": "azure-mgmt-iotcentral", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==10.0.0b2" }, "exclude_path": [ @@ -1922,7 +1792,6 @@ "package_info": { "name": "azure-mgmt-resource", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==23.1.0b1" }, "exclude_path": [ @@ -1936,7 +1805,6 @@ "package_info": { "name": "azure-mgmt-scvmm", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.0.0b2" }, "exclude_path": [ @@ -1950,7 +1818,6 @@ "package_info": { "name": "azure-mgmt-appcontainers", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==3.0.0b1" }, "exclude_path": [ @@ -1964,7 +1831,6 @@ "package_info": { "name": "azure-mgmt-dynatrace", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.1.0b1" }, "exclude_path": [ @@ -1978,7 +1844,6 @@ "package_info": { "name": "azure-mgmt-servicefabricmanagedclusters", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==2.0.0b4" }, "exclude_path": [ @@ -1992,7 +1857,6 @@ "package_info": { "name": "azure-mgmt-communication", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==2.0.0b3" }, "exclude_path": [ @@ -2006,7 +1870,6 @@ "package_info": { "name": "azure-mgmt-nginx", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==2.1.0b1" }, "exclude_path": [ @@ -2020,7 +1883,6 @@ "package_info": { "name": "azure-ai-ml", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==0.1.0b8" }, "exclude_path": [ @@ -2034,7 +1896,6 @@ "package_info": { "name": "azure-mgmt-workloads", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.0.0b3" }, "exclude_path": [ @@ -2048,7 +1909,6 @@ "package_info": { "name": "azure-mgmt-education", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.0.0b2" }, "exclude_path": [ @@ -2062,7 +1922,6 @@ "package_info": { "name": "azure-mgmt-rdbms", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==10.2.0b9" }, "exclude_path": [ @@ -2076,7 +1935,6 @@ "package_info": { "name": "azure-monitor-ingestion", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.0.0b1" }, "exclude_path": [ @@ -2090,7 +1948,6 @@ "package_info": { "name": "azure-mgmt-datalake-analytics", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.0.0b2" }, "exclude_path": [ @@ -2104,7 +1961,6 @@ "package_info": { "name": "azure-developer-loadtesting", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.0.0b2" }, "exclude_path": [ @@ -2118,7 +1974,6 @@ "package_info": { "name": "azure-communication-email", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.0.0b2" }, "exclude_path": [ @@ -2132,7 +1987,6 @@ "package_info": { "name": "azure-communication-rooms", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.0.0b3" }, "exclude_path": [ @@ -2146,7 +2000,6 @@ "package_info": { "name": "azure-mgmt-devcenter", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.0.0b4" }, "exclude_path": [ @@ -2160,7 +2013,6 @@ "package_info": { "name": "azure-mgmt-alertsmanagement", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==2.0.0b2" }, "exclude_path": [ @@ -2174,7 +2026,6 @@ "package_info": { "name": "azure-mgmt-recoveryservicesbackup", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==5.1.0b3" }, "exclude_path": [ @@ -2188,7 +2039,6 @@ "package_info": { "name": "azure-maps-search", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.0.0b2" }, "exclude_path": [ @@ -2202,7 +2052,6 @@ "package_info": { "name": "azure-core-experimental", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.0.0b2" }, "exclude_path": [ @@ -2216,7 +2065,6 @@ "package_info": { "name": "azure-mgmt-securitydevops", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.0.0b2" }, "exclude_path": [ @@ -2230,7 +2078,6 @@ "package_info": { "name": "azure-appconfiguration-provider", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.0.0b2" }, "exclude_path": [ @@ -2244,7 +2091,6 @@ "package_info": { "name": "azure-maps-geolocation", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.0.0b1" }, "exclude_path": [ @@ -2258,7 +2104,6 @@ "package_info": { "name": "azure-maps-render", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.0.0b1" }, "exclude_path": [ @@ -2272,7 +2117,6 @@ "package_info": { "name": "azure-maps-route", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.0.0b1" }, "exclude_path": [ @@ -2286,7 +2130,6 @@ "package_info": { "name": "azure-mgmt-elasticsan", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.0.0b1" }, "exclude_path": [ @@ -2300,7 +2143,6 @@ "package_info": { "name": "azure-mgmt-attestation", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==2.0.0b1" }, "exclude_path": [ @@ -2314,7 +2156,6 @@ "package_info": { "name": "azure-mgmt-devtestlabs", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==10.0.0b1" }, "exclude_path": [ @@ -2328,7 +2169,6 @@ "package_info": { "name": "azure-mgmt-marketplaceordering", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.2.0b1" }, "exclude_path": [ @@ -2342,7 +2182,6 @@ "package_info": { "name": "azure-mgmt-datashare", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.1.0b1" }, "exclude_path": [ @@ -2356,7 +2195,6 @@ "package_info": { "name": "azure-mgmt-hanaonazure", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.1.0b1" }, "exclude_path": [ @@ -2370,7 +2208,6 @@ "package_info": { "name": "azure-mgmt-managedservices", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==7.0.0b1" }, "exclude_path": [ @@ -2384,7 +2221,6 @@ "package_info": { "name": "azure-mgmt-search", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==9.0.0b1" }, "exclude_path": [ @@ -2398,7 +2234,6 @@ "package_info": { "name": "azure-mgmt-billing", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==6.1.0b1" }, "exclude_path": [ @@ -2412,7 +2247,6 @@ "package_info": { "name": "azure-mgmt-deploymentmanager", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==2.0.0b1" }, "exclude_path": [ @@ -2426,7 +2260,6 @@ "package_info": { "name": "azure-mgmt-machinelearningcompute", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.0.0b2" }, "exclude_path": [ @@ -2440,7 +2273,6 @@ "package_info": { "name": "azure-mgmt-managementgroups", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.1.0b1" }, "exclude_path": [ @@ -2454,7 +2286,6 @@ "package_info": { "name": "azure-mgmt-managementpartner", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.1.0b1" }, "exclude_path": [ @@ -2468,7 +2299,6 @@ "package_info": { "name": "azure-mgmt-maps", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==2.1.0b1" }, "exclude_path": [ @@ -2482,7 +2312,6 @@ "package_info": { "name": "azure-mgmt-peering", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==2.0.0b1" }, "exclude_path": [ @@ -2496,7 +2325,6 @@ "package_info": { "name": "azure-mgmt-portal", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.1.0b1" }, "exclude_path": [ @@ -2510,7 +2338,6 @@ "package_info": { "name": "azure-mgmt-serialconsole", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.1.0b1" }, "exclude_path": [ @@ -2524,7 +2351,6 @@ "package_info": { "name": "azure-mgmt-devspaces", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.0.0b2" }, "exclude_path": [ @@ -2538,7 +2364,6 @@ "package_info": { "name": "azure-mgmt-logic", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==10.1.0b1" }, "exclude_path": [ @@ -2552,7 +2377,6 @@ "package_info": { "name": "azure-ai-personalizer", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.0.0b1" }, "exclude_path": [ @@ -2566,7 +2390,6 @@ "package_info": { "name": "azure-mgmt-elastic", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.1.0b3" }, "exclude_path": [ @@ -2580,7 +2403,6 @@ "package_info": { "name": "azure-mgmt-purview", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.1.0b1" }, "exclude_path": [ @@ -2594,7 +2416,6 @@ "package_info": { "name": "azure-mgmt-relay", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==2.0.0b1" }, "exclude_path": [ @@ -2608,7 +2429,6 @@ "package_info": { "name": "azure-mgmt-servicefabric", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==2.1.0b1" }, "exclude_path": [ @@ -2622,7 +2442,6 @@ "package_info": { "name": "azure-developer-devcenter", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.0.0b2" }, "exclude_path": [ @@ -2636,7 +2455,6 @@ "package_info": { "name": "azure-mgmt-baremetalinfrastructure", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.1.0b1" }, "exclude_path": [ @@ -2650,7 +2468,6 @@ "package_info": { "name": "azure-mgmt-hybridkubernetes", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.2.0b1" }, "exclude_path": [ @@ -2664,7 +2481,6 @@ "package_info": { "name": "azure-mgmt-appcomplianceautomation", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.0.0b1" }, "exclude_path": [ @@ -2678,7 +2494,6 @@ "package_info": { "name": "azure-mgmt-iothubprovisioningservices", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.2.0b1" }, "exclude_path": [ @@ -2692,7 +2507,6 @@ "package_info": { "name": "azure-mgmt-networkfunction", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.0.0b1" }, "exclude_path": [ @@ -2706,7 +2520,6 @@ "package_info": { "name": "azure-mgmt-webpubsub", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.1.0b1" }, "exclude_path": [ @@ -2720,7 +2533,6 @@ "package_info": { "name": "azure-mgmt-datamigration", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==10.1.0b1" }, "exclude_path": [ @@ -2734,7 +2546,6 @@ "package_info": { "name": "azure-mgmt-hdinsight", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==9.0.0b1" }, "exclude_path": [ @@ -2748,7 +2559,6 @@ "package_info": { "name": "azure-mgmt-hybridcompute", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==8.0.0b1" }, "exclude_path": [ @@ -2762,7 +2572,6 @@ "package_info": { "name": "azure-mgmt-hybridnetwork", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==2.0.0b1" }, "exclude_path": [ @@ -2776,7 +2585,6 @@ "package_info": { "name": "azure-mgmt-machinelearningservices", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==2.0.0b2" }, "exclude_path": [ @@ -2790,7 +2598,6 @@ "package_info": { "name": "azure-mgmt-healthcareapis", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.2.0b1" }, "exclude_path": [ @@ -2804,7 +2611,6 @@ "package_info": { "name": "azure-mgmt-redisenterprise", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==2.1.0b2" }, "exclude_path": [ @@ -2818,7 +2624,6 @@ "package_info": { "name": "azure-mgmt-frontdoor", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.1.0b1" }, "exclude_path": [ @@ -2832,7 +2637,6 @@ "package_info": { "name": "azure-mgmt-trafficmanager", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.1.0b1" }, "exclude_path": [ @@ -2846,7 +2650,6 @@ "package_info": { "name": "azure-mgmt-azurestackhci", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==8.0.0b2" }, "exclude_path": [ @@ -2860,7 +2663,6 @@ "package_info": { "name": "azure-mgmt-billingbenefits", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.0.0b1" }, "exclude_path": [ @@ -2874,7 +2676,6 @@ "package_info": { "name": "azure-mgmt-fluidrelay", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.1.0b1" }, "exclude_path": [ @@ -2888,7 +2689,6 @@ "package_info": { "name": "azure-mgmt-kusto", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==3.1.0b1" }, "exclude_path": [ @@ -2902,7 +2702,6 @@ "package_info": { "name": "azure-mgmt-media", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==10.2.0b1" }, "exclude_path": [ @@ -2916,7 +2715,6 @@ "package_info": { "name": "azure-mgmt-subscription", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==3.2.0b1" }, "exclude_path": [ @@ -2930,7 +2728,6 @@ "package_info": { "name": "azure-mgmt-cognitiveservices", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==13.4.0b1" }, "exclude_path": [ @@ -2944,7 +2741,6 @@ "package_info": { "name": "azure-mgmt-loadtesting", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.0.0b1" }, "exclude_path": [ @@ -2958,7 +2754,6 @@ "package_info": { "name": "azure-schemaregistry", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.3.0b1" }, "exclude_path": [ @@ -2972,7 +2767,6 @@ "package_info": { "name": "azure-mgmt-servicenetworking", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.0.0b2" }, "exclude_path": [ @@ -2986,7 +2780,6 @@ "package_info": { "name": "azure-mgmt-commerce", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==6.1.0b1" }, "exclude_path": [ @@ -3000,7 +2793,6 @@ "package_info": { "name": "azure-mgmt-appplatform", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==8.0.0b1" }, "exclude_path": [ @@ -3015,7 +2807,6 @@ "package_info": { "name": "azure-mgmt-databoxedge", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==2.0.0b1" }, "exclude_path": [ @@ -3029,7 +2820,6 @@ "package_info": { "name": "azure-mgmt-edgeorder", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==2.0.0b1" }, "exclude_path": [ @@ -3043,7 +2833,6 @@ "package_info": { "name": "azure-mgmt-eventhub", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==11.0.0b1" }, "exclude_path": [ @@ -3057,7 +2846,6 @@ "package_info": { "name": "azure-mgmt-kubernetesconfiguration", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==3.0.0b1" }, "exclude_path": [ @@ -3071,7 +2859,6 @@ "package_info": { "name": "azure-mgmt-authorization", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==3.1.0b1" }, "exclude_path": [ @@ -3085,7 +2872,6 @@ "package_info": { "name": "azure-mgmt-iothub", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==2.4.0b1" }, "exclude_path": [ @@ -3099,7 +2885,6 @@ "package_info": { "name": "azure-mgmt-keyvault", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==10.2.0b1" }, "exclude_path": [ @@ -3113,7 +2898,6 @@ "package_info": { "name": "azure-mgmt-datalake-store", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.1.0b1" }, "exclude_path": [ @@ -3127,7 +2911,6 @@ "package_info": { "name": "azure-mgmt-digitaltwins", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==6.4.0b1" }, "exclude_path": [ @@ -3141,7 +2924,6 @@ "package_info": { "name": "azure-mgmt-security", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==4.0.0b2" }, "exclude_path": [ @@ -3155,7 +2937,6 @@ "package_info": { "name": "azure-mgmt-storagemover", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.0.0b1" }, "exclude_path": [ @@ -3169,7 +2950,6 @@ "package_info": { "name": "azure-mgmt-voiceservices", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.0.0b1" }, "exclude_path": [ @@ -3183,7 +2963,6 @@ "package_info": { "name": "azure-purview-workflow", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.0.0b1" }, "exclude_path": [ @@ -3197,7 +2976,6 @@ "package_info": { "name": "azure-defender-easm", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.0.0b1" }, "exclude_path": [ @@ -3224,7 +3002,6 @@ "package_info": { "name": "azure-mgmt-defendereasm", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.0.0b1" }, "exclude_path": [ @@ -3238,7 +3015,6 @@ "package_info": { "name": "azure-mgmt-hybridcontainerservice", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.0.0b1" }, "exclude_path": [ @@ -3252,7 +3028,6 @@ "package_info": { "name": "azure-mgmt-graphservices", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.0.0b1" }, "exclude_path": [ @@ -3266,7 +3041,6 @@ "package_info": { "name": "azure-mgmt-newrelicobservability", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.0.0b1" }, "exclude_path": [ @@ -3280,7 +3054,6 @@ "package_info": { "name": "azure-purview-sharing", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.0.0b1" }, "exclude_path": [ @@ -3294,7 +3067,6 @@ "package_info": { "name": "azure-healthinsights-cancerprofiling", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.0.0b1.post1" }, "exclude_path": [ @@ -3308,7 +3080,6 @@ "package_info": { "name": "azure-healthinsights-clinicalmatching", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.0.0b1.post1" }, "exclude_path": [ @@ -3322,7 +3093,6 @@ "package_info": { "name": "azure-mgmt-qumulo", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.0.0b1" }, "exclude_path": [ @@ -3336,7 +3106,6 @@ "package_info": { "name": "azure-ai-translation-text", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.0.0b1" }, "exclude_path": [ @@ -3350,7 +3119,6 @@ "package_info": { "name": "azure-messaging-webpubsubclient", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.0.0b1" }, "exclude_path": [ @@ -3364,7 +3132,6 @@ "package_info": { "name": "azure-mgmt-paloaltonetworksngfw", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.0.0b2" }, "exclude_path": [ @@ -3378,7 +3145,6 @@ "package_info": { "name": "azure-mgmt-selfhelp", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.0.0b1" }, "exclude_path": [ @@ -3392,7 +3158,6 @@ "package_info": { "name": "azure-ai-contentsafety", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.0.0b1" }, "exclude_path": [ @@ -3406,7 +3171,6 @@ "package_info": { "name": "azure-mgmt-devhub", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.0.0b1" }, "exclude_path": [ @@ -3420,7 +3184,6 @@ "package_info": { "name": "azure-mgmt-networkcloud", "install_type": "pypi", - "prefer_source_distribution": "true", "version": "==1.0.0b1" }, "exclude_path": [ From 8ea84a47b46784f0c14578c34debe340cd171014 Mon Sep 17 00:00:00 2001 From: Jun Shi Date: Tue, 6 Jun 2023 10:46:00 +0800 Subject: [PATCH 2/4] Remove prefer_source_distribution --- ci-configs/packages-preview.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ci-configs/packages-preview.json b/ci-configs/packages-preview.json index 3eb655c70bcf..7b4d0a559b34 100644 --- a/ci-configs/packages-preview.json +++ b/ci-configs/packages-preview.json @@ -22,8 +22,7 @@ "package_info": { "install_type": "pypi", "name": "azure-core-tracing-opencensus", - "version": ">=1.0.0b7", - "prefer_source_distribution": "true" + "version": ">=1.0.0b7" }, "exclude_path": [ "test*", From 4bd085afd361ff87d22824edc22aee0053502cbe Mon Sep 17 00:00:00 2001 From: junshi356 <40595015+junshi356@users.noreply.github.com> Date: Tue, 6 Jun 2023 13:15:20 +0800 Subject: [PATCH 3/4] Update packages-preview.json --- ci-configs/packages-preview.json | 1 + 1 file changed, 1 insertion(+) diff --git a/ci-configs/packages-preview.json b/ci-configs/packages-preview.json index 7b4d0a559b34..ebe148ec5c49 100644 --- a/ci-configs/packages-preview.json +++ b/ci-configs/packages-preview.json @@ -8,6 +8,7 @@ { "package_info": { "install_type": "pypi", + "prefer_source_distribution": "true", "name": "azure-iot-hub", "version": "2.2.1rc2" }, From 5d5151387f029eb394281b037733d7840a61c3e5 Mon Sep 17 00:00:00 2001 From: VSC-Service-Account Date: Tue, 6 Jun 2023 09:38:24 +0000 Subject: [PATCH 4/4] CI Update Build.Reason:Manual by Jun Shi (CPX) Build.Url:https://apidrop.visualstudio.com/Content%20CI/_build/results?buildId=366426&view=results --- ....formrecognizer.DocumentAnalysisClient.yml | 253 ------- ...izer.DocumentModelAdministrationClient.yml | 200 ------ ...ai.formrecognizer.FormRecognizerClient.yml | 383 ---------- ...e.ai.formrecognizer.FormTrainingClient.yml | 154 ---- ...mrecognizer.aio.DocumentAnalysisClient.yml | 259 ------- ....aio.DocumentModelAdministrationClient.yml | 208 ------ ...ormrecognizer.aio.FormRecognizerClient.yml | 408 ----------- ....formrecognizer.aio.FormTrainingClient.yml | 164 ----- ...sor.MetricsAdvisorAdministrationClient.yml | 617 ---------------- ...ai.metricsadvisor.MetricsAdvisorClient.yml | 203 ------ ...aio.MetricsAdvisorAdministrationClient.yml | 666 ------------------ ...etricsadvisor.aio.MetricsAdvisorClient.yml | 225 ------ .../azure-ai-ml/azure.ai.ml.MLClient.yml | 27 - ...ics.AnalyzeHealthcareEntitiesLROPoller.yml | 33 - ...e.ai.textanalytics.TextAnalyticsClient.yml | 356 ---------- ...syncAnalyzeHealthcareEntitiesLROPoller.yml | 35 - ....textanalytics.aio.TextAnalyticsClient.yml | 382 ---------- ...ion.document.DocumentTranslationClient.yml | 101 --- ...document.aio.DocumentTranslationClient.yml | 103 --- .../azure.communication.chat.ChatClient.yml | 67 -- ...re.communication.chat.ChatThreadClient.yml | 193 ----- ...zure.communication.chat.aio.ChatClient.yml | 69 -- ...ommunication.chat.aio.ChatThreadClient.yml | 208 ------ ...n.identity.CommunicationIdentityClient.yml | 111 --- ...traversal.aio.CommunicationRelayClient.yml | 37 - ...tainerregistry.ContainerRegistryClient.yml | 28 - .../azure.core.AsyncPipelineClient.yml | 13 - .../azure-core/azure.core.PipelineClient.yml | 14 - .../azure.core.pipeline.AsyncPipeline.yml | 15 - .../azure.core.pipeline.Pipeline.yml | 14 - ....pipeline.policies.AsyncRedirectPolicy.yml | 15 - ...ore.pipeline.policies.AsyncRetryPolicy.yml | 31 - ...e.core.pipeline.policies.HeadersPolicy.yml | 14 - ...ine.policies.NetworkTraceLoggingPolicy.yml | 18 - ...ure.core.pipeline.policies.ProxyPolicy.yml | 12 - ....core.pipeline.policies.RedirectPolicy.yml | 16 - ...core.pipeline.policies.RequestIdPolicy.yml | 14 - ...ure.core.pipeline.policies.RetryPolicy.yml | 31 - ...core.pipeline.policies.UserAgentPolicy.yml | 16 - ...re.pipeline.transport.AioHttpTransport.yml | 9 - ...ine.transport.AsyncioRequestsTransport.yml | 10 - ...e.pipeline.transport.RequestsTransport.yml | 9 - .../azure.cosmos.ContainerProxy.yml | 29 - .../azure.cosmos.CosmosClient.yml | 20 - .../azure.cosmos.DatabaseProxy.yml | 63 -- .../azure.cosmos.aio.ContainerProxy.yml | 32 - .../azure.cosmos.aio.CosmosClient.yml | 18 - .../azure.cosmos.aio.DatabaseProxy.yml | 67 -- .../azure.cosmos.container.ContainerProxy.yml | 29 - ...zure.cosmos.cosmos_client.CosmosClient.yml | 20 - .../azure.cosmos.database.DatabaseProxy.yml | 63 -- .../azure.data.tables.TableClient.yml | 153 ---- .../azure.data.tables.TableServiceClient.yml | 104 +-- .../azure.data.tables.aio.TableClient.yml | 152 ---- ...ure.data.tables.aio.TableServiceClient.yml | 96 --- ...talake.store.lib.DatalakeRESTInterface.yml | 12 +- .../azure.eventhub.EventData.yml | 9 - .../azure.eventhub.EventHubConsumerClient.yml | 78 -- .../azure.eventhub.EventHubProducerClient.yml | 74 -- ...re.eventhub.aio.EventHubConsumerClient.yml | 83 --- ...re.eventhub.aio.EventHubProducerClient.yml | 75 -- ...e.identity.AuthorizationCodeCredential.yml | 10 - .../azure.identity.AzureCliCredential.yml | 8 - ...e.identity.AzureDeveloperCliCredential.yml | 9 - ...ure.identity.AzurePowerShellCredential.yml | 9 - .../azure.identity.CertificateCredential.yml | 14 - .../azure.identity.ChainedTokenCredential.yml | 11 - ...ure.identity.ClientAssertionCredential.yml | 11 - .../azure.identity.ClientSecretCredential.yml | 10 - .../azure.identity.DefaultAzureCredential.yml | 9 - .../azure.identity.DeviceCodeCredential.yml | 8 - .../azure.identity.EnvironmentCredential.yml | 9 - ....identity.InteractiveBrowserCredential.yml | 9 - ...ure.identity.ManagedIdentityCredential.yml | 10 - .../azure.identity.OnBehalfOfCredential.yml | 10 - ....identity.TokenCachePersistenceOptions.yml | 12 - ...re.identity.UsernamePasswordCredential.yml | 10 - ...re.identity.WorkloadIdentityCredential.yml | 13 - ...entity.aio.AuthorizationCodeCredential.yml | 10 - .../azure.identity.aio.AzureCliCredential.yml | 8 - ...entity.aio.AzureDeveloperCliCredential.yml | 9 - ...identity.aio.AzurePowerShellCredential.yml | 9 - ...ure.identity.aio.CertificateCredential.yml | 14 - ...re.identity.aio.ChainedTokenCredential.yml | 11 - ...identity.aio.ClientAssertionCredential.yml | 11 - ...re.identity.aio.ClientSecretCredential.yml | 10 - ...re.identity.aio.DefaultAzureCredential.yml | 9 - ...ure.identity.aio.EnvironmentCredential.yml | 9 - ...identity.aio.ManagedIdentityCredential.yml | 10 - ...zure.identity.aio.OnBehalfOfCredential.yml | 10 - ...dentity.aio.WorkloadIdentityCredential.yml | 13 - ...lt.administration.KeyVaultBackupClient.yml | 31 - ...dministration.aio.KeyVaultBackupClient.yml | 32 - ...eyvault.certificates.CertificateClient.yml | 240 ------- ...ificates.KeyVaultCertificateIdentifier.yml | 10 - ...ult.certificates.aio.CertificateClient.yml | 235 ------ .../azure.keyvault.keys.KeyClient.yml | 167 ----- ...re.keyvault.keys.KeyVaultKeyIdentifier.yml | 9 - .../azure.keyvault.keys.aio.KeyClient.yml | 171 ----- ...eyvault.keys.crypto.CryptographyClient.yml | 120 ++-- ...ult.keys.crypto.aio.CryptographyClient.yml | 123 ++-- ...vault.secrets.KeyVaultSecretIdentifier.yml | 10 - .../azure.keyvault.secrets.SecretClient.yml | 132 ---- ...zure.keyvault.secrets.aio.SecretClient.yml | 138 ---- .../azure.monitor.query.LogsQueryClient.yml | 59 +- ...azure.monitor.query.MetricsQueryClient.yml | 25 +- ...zure.monitor.query.aio.LogsQueryClient.yml | 29 +- ...re.schemaregistry.SchemaRegistryClient.yml | 65 -- ...chemaregistry.aio.SchemaRegistryClient.yml | 65 -- .../azure.search.documents.SearchClient.yml | 98 --- ...zure.search.documents.aio.SearchClient.yml | 105 --- ...ch.documents.indexes.SearchIndexClient.yml | 108 --- ....documents.indexes.SearchIndexerClient.yml | 43 -- ...ocuments.indexes.aio.SearchIndexClient.yml | 113 --- ...uments.indexes.aio.SearchIndexerClient.yml | 35 +- ...tation.AttestationAdministrationClient.yml | 109 --- ...security.attestation.AttestationClient.yml | 31 - ...on.aio.AttestationAdministrationClient.yml | 97 --- ...rity.attestation.aio.AttestationClient.yml | 31 - .../azure.servicebus.AutoLockRenewer.yml | 24 - .../azure.servicebus.ServiceBusClient.yml | 76 -- .../azure.servicebus.ServiceBusMessage.yml | 11 - ...e.servicebus.ServiceBusReceivedMessage.yml | 19 - .../azure.servicebus.ServiceBusReceiver.yml | 95 --- .../azure.servicebus.ServiceBusSender.yml | 40 -- .../azure.servicebus.ServiceBusSession.yml | 39 - .../azure.servicebus.aio.AutoLockRenewer.yml | 24 - .../azure.servicebus.aio.ServiceBusClient.yml | 77 -- ...zure.servicebus.aio.ServiceBusReceiver.yml | 95 --- .../azure.servicebus.aio.ServiceBusSender.yml | 42 -- ...azure.servicebus.aio.ServiceBusSession.yml | 39 - .../azure.storage.blob.BlobClient.yml | 130 ---- .../azure.storage.blob.BlobServiceClient.yml | 129 ---- .../azure.storage.blob.ContainerClient.yml | 135 ---- ...e.storage.blob.StorageStreamDownloader.yml | 13 - .../azure.storage.blob.aio.BlobClient.yml | 106 --- ...ure.storage.blob.aio.BlobServiceClient.yml | 125 ---- ...azure.storage.blob.aio.ContainerClient.yml | 127 ---- ...orage.blob.aio.StorageStreamDownloader.yml | 13 - .../azure-storage-blob/azure.storage.blob.yml | 24 - ...e.filedatalake.DataLakeDirectoryClient.yml | 45 -- ...torage.filedatalake.DataLakeFileClient.yml | 87 --- ...age.filedatalake.DataLakeServiceClient.yml | 100 --- ....storage.filedatalake.FileSystemClient.yml | 130 ---- ...ledatalake.aio.DataLakeDirectoryClient.yml | 45 -- ...ge.filedatalake.aio.DataLakeFileClient.yml | 73 -- ...filedatalake.aio.DataLakeServiceClient.yml | 92 --- ...rage.filedatalake.aio.FileSystemClient.yml | 123 +--- .../azure.storage.fileshare.ShareClient.yml | 94 --- ...storage.fileshare.ShareDirectoryClient.yml | 71 -- ...zure.storage.fileshare.ShareFileClient.yml | 63 +- ...e.storage.fileshare.ShareServiceClient.yml | 87 --- ...zure.storage.fileshare.aio.ShareClient.yml | 78 -- ...age.fileshare.aio.ShareDirectoryClient.yml | 73 -- ....storage.fileshare.aio.ShareFileClient.yml | 43 -- ...orage.fileshare.aio.ShareServiceClient.yml | 79 --- .../azure.storage.fileshare.yml | 14 - .../azure.storage.queue.QueueClient.yml | 137 ---- ...azure.storage.queue.QueueServiceClient.yml | 99 --- .../azure.storage.queue.aio.QueueClient.yml | 139 ---- ...e.storage.queue.aio.QueueServiceClient.yml | 89 --- .../azure.storage.queue.yml | 10 - docs-ref-mapping/reference-preview.yml | 2 +- ....formrecognizer.DocumentAnalysisClient.yml | 293 -------- ...izer.DocumentModelAdministrationClient.yml | 271 ------- ...ai.formrecognizer.FormRecognizerClient.yml | 383 ---------- ...e.ai.formrecognizer.FormTrainingClient.yml | 154 ---- ...mrecognizer.aio.DocumentAnalysisClient.yml | 302 -------- ....aio.DocumentModelAdministrationClient.yml | 285 -------- ...ormrecognizer.aio.FormRecognizerClient.yml | 408 ----------- ....formrecognizer.aio.FormTrainingClient.yml | 164 ----- ...azure.ai.ml.operations.ModelOperations.yml | 2 +- ...ics.AnalyzeHealthcareEntitiesLROPoller.yml | 34 - ...e.ai.textanalytics.TextAnalyticsClient.yml | 476 ------------- ...syncAnalyzeHealthcareEntitiesLROPoller.yml | 36 - ....textanalytics.aio.TextAnalyticsClient.yml | 508 ------------- ...ion.document.DocumentTranslationClient.yml | 101 --- ...document.aio.DocumentTranslationClient.yml | 103 --- ...nistration.CommunicationIdentityClient.yml | 29 - ...n.identity.CommunicationIdentityClient.yml | 111 --- ...traversal.aio.CommunicationRelayClient.yml | 37 - ...tainerregistry.ContainerRegistryClient.yml | 26 - .../azure.cosmos.ContainerProxy.yml | 29 - .../azure.cosmos.CosmosClient.yml | 20 - .../azure.cosmos.DatabaseProxy.yml | 63 -- .../azure.cosmos.aio.ContainerProxy.yml | 32 - .../azure.cosmos.aio.CosmosClient.yml | 18 - .../azure.cosmos.aio.DatabaseProxy.yml | 67 -- .../azure.cosmos.container.ContainerProxy.yml | 29 - ...zure.cosmos.cosmos_client.CosmosClient.yml | 20 - .../azure.cosmos.database.DatabaseProxy.yml | 63 -- ...ure.eventgrid.EventGridPublisherClient.yml | 35 - ...eventgrid.aio.EventGridPublisherClient.yml | 38 - .../azure-eventgrid/azure.eventgrid.yml | 13 - .../azure.eventhub.EventData.yml | 9 - .../azure.eventhub.EventHubConsumerClient.yml | 78 -- .../azure.eventhub.EventHubProducerClient.yml | 74 -- ...re.eventhub.aio.EventHubConsumerClient.yml | 83 --- ...re.eventhub.aio.EventHubProducerClient.yml | 75 -- ....identity.TokenCachePersistenceOptions.yml | 12 - ...lt.administration.KeyVaultBackupClient.yml | 31 - ...dministration.aio.KeyVaultBackupClient.yml | 32 - ...eyvault.certificates.CertificateClient.yml | 240 ------- ...ificates.KeyVaultCertificateIdentifier.yml | 10 - ...ult.certificates.aio.CertificateClient.yml | 235 ------ .../azure.keyvault.keys.KeyClient.yml | 167 ----- ...re.keyvault.keys.KeyVaultKeyIdentifier.yml | 9 - .../azure.keyvault.keys.aio.KeyClient.yml | 172 ----- ...eyvault.keys.crypto.CryptographyClient.yml | 120 ++-- ...ult.keys.crypto.aio.CryptographyClient.yml | 123 ++-- ...vault.secrets.KeyVaultSecretIdentifier.yml | 10 - .../azure.keyvault.secrets.SecretClient.yml | 136 ---- ...zure.keyvault.secrets.aio.SecretClient.yml | 138 ---- ...maps.geolocation.MapsGeolocationClient.yml | 34 - ....geolocation.aio.MapsGeolocationClient.yml | 35 - .../azure.maps.render.MapsRenderClient.yml | 133 ---- ...azure.maps.render.aio.MapsRenderClient.yml | 104 --- ...re.schemaregistry.SchemaRegistryClient.yml | 65 -- ...chemaregistry.aio.SchemaRegistryClient.yml | 65 -- .../azure.search.documents.SearchClient.yml | 98 --- ...zure.search.documents.aio.SearchClient.yml | 105 --- ...ch.documents.indexes.SearchIndexClient.yml | 139 ---- ....documents.indexes.SearchIndexerClient.yml | 43 -- ...ocuments.indexes.aio.SearchIndexClient.yml | 155 ---- ...uments.indexes.aio.SearchIndexerClient.yml | 35 +- ...orage.blob.changefeed.ChangeFeedClient.yml | 34 - .../azure.storage.blob.BlobClient.yml | 130 ---- .../azure.storage.blob.BlobServiceClient.yml | 129 ---- .../azure.storage.blob.ContainerClient.yml | 135 ---- ...e.storage.blob.StorageStreamDownloader.yml | 13 - .../azure.storage.blob.aio.BlobClient.yml | 106 --- ...ure.storage.blob.aio.BlobServiceClient.yml | 125 ---- ...azure.storage.blob.aio.ContainerClient.yml | 127 ---- ...orage.blob.aio.StorageStreamDownloader.yml | 13 - .../azure-storage-blob/azure.storage.blob.yml | 24 - ...e.filedatalake.DataLakeDirectoryClient.yml | 45 -- ...torage.filedatalake.DataLakeFileClient.yml | 87 --- ...age.filedatalake.DataLakeServiceClient.yml | 100 --- ....storage.filedatalake.FileSystemClient.yml | 130 ---- ...ledatalake.aio.DataLakeDirectoryClient.yml | 45 -- ...ge.filedatalake.aio.DataLakeFileClient.yml | 73 -- ...filedatalake.aio.DataLakeServiceClient.yml | 92 --- ...rage.filedatalake.aio.FileSystemClient.yml | 123 +--- .../azure.storage.fileshare.ShareClient.yml | 94 --- ...storage.fileshare.ShareDirectoryClient.yml | 71 -- ...zure.storage.fileshare.ShareFileClient.yml | 63 +- ...e.storage.fileshare.ShareServiceClient.yml | 87 --- ...zure.storage.fileshare.aio.ShareClient.yml | 78 -- ...age.fileshare.aio.ShareDirectoryClient.yml | 73 -- ....storage.fileshare.aio.ShareFileClient.yml | 43 -- ...orage.fileshare.aio.ShareServiceClient.yml | 79 --- .../azure.storage.fileshare.yml | 14 - .../azure.storage.queue.QueueClient.yml | 139 ---- ...azure.storage.queue.QueueServiceClient.yml | 99 --- .../azure.storage.queue.aio.QueueClient.yml | 139 ---- ...e.storage.queue.aio.QueueServiceClient.yml | 89 --- .../azure.storage.queue.yml | 10 - 257 files changed, 211 insertions(+), 22123 deletions(-) diff --git a/docs-ref-autogen/azure-ai-formrecognizer/azure.ai.formrecognizer.DocumentAnalysisClient.yml b/docs-ref-autogen/azure-ai-formrecognizer/azure.ai.formrecognizer.DocumentAnalysisClient.yml index 577f4dc71d06..de939d4454f5 100644 --- a/docs-ref-autogen/azure-ai-formrecognizer/azure.ai.formrecognizer.DocumentAnalysisClient.yml +++ b/docs-ref-autogen/azure-ai-formrecognizer/azure.ai.formrecognizer.DocumentAnalysisClient.yml @@ -66,29 +66,6 @@ constructor: types: - - -examples: -- "Creating the DocumentAnalysisClient with an endpoint and API key.\n\n\n\n````python\n\n from azure.core.credentials import AzureKeyCredential\n\ - \ from azure.ai.formrecognizer import DocumentAnalysisClient\n\n endpoint =\ - \ os.environ[\"AZURE_FORM_RECOGNIZER_ENDPOINT\"]\n key = os.environ[\"AZURE_FORM_RECOGNIZER_KEY\"\ - ]\n\n document_analysis_client = DocumentAnalysisClient(endpoint, AzureKeyCredential(key))\n\ - \n ````\n\nCreating the DocumentAnalysisClient with a token credential.\n\n\n\n````python\n\n \"\"\"DefaultAzureCredential will use the values\ - \ from these environment\n variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, AZURE_CLIENT_SECRET\n\ - \ \"\"\"\n from azure.ai.formrecognizer import DocumentAnalysisClient\n from\ - \ azure.identity import DefaultAzureCredential\n\n endpoint = os.environ[\"AZURE_FORM_RECOGNIZER_ENDPOINT\"\ - ]\n credential = DefaultAzureCredential()\n\n document_analysis_client = DocumentAnalysisClient(endpoint,\ - \ credential)\n\n ````\n" methods: - uid: azure.ai.formrecognizer.DocumentAnalysisClient.begin_analyze_document name: begin_analyze_document @@ -136,183 +113,6 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Analyze an invoice. For more samples see the *samples* folder.\n\n\n\n````python\n\n from azure.core.credentials\ - \ import AzureKeyCredential\n from azure.ai.formrecognizer import DocumentAnalysisClient\n\ - \n endpoint = os.environ[\"AZURE_FORM_RECOGNIZER_ENDPOINT\"]\n key = os.environ[\"\ - AZURE_FORM_RECOGNIZER_KEY\"]\n\n document_analysis_client = DocumentAnalysisClient(\n\ - \ endpoint=endpoint, credential=AzureKeyCredential(key)\n )\n with open(path_to_sample_documents,\ - \ \"rb\") as f:\n poller = document_analysis_client.begin_analyze_document(\n\ - \ \"prebuilt-invoice\", document=f, locale=\"en-US\"\n )\n invoices\ - \ = poller.result()\n\n for idx, invoice in enumerate(invoices.documents):\n\ - \ print(\"--------Analyzing invoice #{}--------\".format(idx + 1))\n \ - \ vendor_name = invoice.fields.get(\"VendorName\")\n if vendor_name:\n\ - \ print(\n \"Vendor Name: {} has confidence: {}\".format(\n\ - \ vendor_name.value, vendor_name.confidence\n \ - \ )\n )\n vendor_address = invoice.fields.get(\"VendorAddress\"\ - )\n if vendor_address:\n print(\n \"Vendor Address:\ - \ {} has confidence: {}\".format(\n vendor_address.value, vendor_address.confidence\n\ - \ )\n )\n vendor_address_recipient = invoice.fields.get(\"\ - VendorAddressRecipient\")\n if vendor_address_recipient:\n print(\n\ - \ \"Vendor Address Recipient: {} has confidence: {}\".format(\n\ - \ vendor_address_recipient.value, vendor_address_recipient.confidence\n\ - \ )\n )\n customer_name = invoice.fields.get(\"\ - CustomerName\")\n if customer_name:\n print(\n \"\ - Customer Name: {} has confidence: {}\".format(\n customer_name.value,\ - \ customer_name.confidence\n )\n )\n customer_id\ - \ = invoice.fields.get(\"CustomerId\")\n if customer_id:\n print(\n\ - \ \"Customer Id: {} has confidence: {}\".format(\n \ - \ customer_id.value, customer_id.confidence\n )\n \ - \ )\n customer_address = invoice.fields.get(\"CustomerAddress\")\n \ - \ if customer_address:\n print(\n \"Customer Address:\ - \ {} has confidence: {}\".format(\n customer_address.value,\ - \ customer_address.confidence\n )\n )\n customer_address_recipient\ - \ = invoice.fields.get(\"CustomerAddressRecipient\")\n if customer_address_recipient:\n\ - \ print(\n \"Customer Address Recipient: {} has confidence:\ - \ {}\".format(\n customer_address_recipient.value,\n \ - \ customer_address_recipient.confidence,\n )\n \ - \ )\n invoice_id = invoice.fields.get(\"InvoiceId\")\n if invoice_id:\n\ - \ print(\n \"Invoice Id: {} has confidence: {}\".format(\n\ - \ invoice_id.value, invoice_id.confidence\n )\n\ - \ )\n invoice_date = invoice.fields.get(\"InvoiceDate\")\n \ - \ if invoice_date:\n print(\n \"Invoice Date: {} has\ - \ confidence: {}\".format(\n invoice_date.value, invoice_date.confidence\n\ - \ )\n )\n invoice_total = invoice.fields.get(\"\ - InvoiceTotal\")\n if invoice_total:\n print(\n \"\ - Invoice Total: {} has confidence: {}\".format(\n invoice_total.value,\ - \ invoice_total.confidence\n )\n )\n due_date =\ - \ invoice.fields.get(\"DueDate\")\n if due_date:\n print(\n \ - \ \"Due Date: {} has confidence: {}\".format(\n \ - \ due_date.value, due_date.confidence\n )\n )\n \ - \ purchase_order = invoice.fields.get(\"PurchaseOrder\")\n if purchase_order:\n\ - \ print(\n \"Purchase Order: {} has confidence: {}\".format(\n\ - \ purchase_order.value, purchase_order.confidence\n \ - \ )\n )\n billing_address = invoice.fields.get(\"BillingAddress\"\ - )\n if billing_address:\n print(\n \"Billing Address:\ - \ {} has confidence: {}\".format(\n billing_address.value, billing_address.confidence\n\ - \ )\n )\n billing_address_recipient = invoice.fields.get(\"\ - BillingAddressRecipient\")\n if billing_address_recipient:\n print(\n\ - \ \"Billing Address Recipient: {} has confidence: {}\".format(\n\ - \ billing_address_recipient.value,\n billing_address_recipient.confidence,\n\ - \ )\n )\n shipping_address = invoice.fields.get(\"\ - ShippingAddress\")\n if shipping_address:\n print(\n \ - \ \"Shipping Address: {} has confidence: {}\".format(\n \ - \ shipping_address.value, shipping_address.confidence\n )\n \ - \ )\n shipping_address_recipient = invoice.fields.get(\"ShippingAddressRecipient\"\ - )\n if shipping_address_recipient:\n print(\n \"\ - Shipping Address Recipient: {} has confidence: {}\".format(\n \ - \ shipping_address_recipient.value,\n shipping_address_recipient.confidence,\n\ - \ )\n )\n print(\"Invoice items:\")\n for\ - \ idx, item in enumerate(invoice.fields.get(\"Items\").value):\n print(\"\ - ...Item #{}\".format(idx + 1))\n item_description = item.value.get(\"\ - Description\")\n if item_description:\n print(\n \ - \ \"......Description: {} has confidence: {}\".format(\n \ - \ item_description.value, item_description.confidence\n \ - \ )\n )\n item_quantity = item.value.get(\"\ - Quantity\")\n if item_quantity:\n print(\n \ - \ \"......Quantity: {} has confidence: {}\".format(\n \ - \ item_quantity.value, item_quantity.confidence\n )\n \ - \ )\n unit = item.value.get(\"Unit\")\n if unit:\n\ - \ print(\n \"......Unit: {} has confidence: {}\"\ - .format(\n unit.value, unit.confidence\n \ - \ )\n )\n unit_price = item.value.get(\"UnitPrice\"\ - )\n if unit_price:\n print(\n \"......Unit\ - \ Price: {} has confidence: {}\".format(\n unit_price.value,\ - \ unit_price.confidence\n )\n )\n product_code\ - \ = item.value.get(\"ProductCode\")\n if product_code:\n \ - \ print(\n \"......Product Code: {} has confidence: {}\"\ - .format(\n product_code.value, product_code.confidence\n\ - \ )\n )\n item_date = item.value.get(\"\ - Date\")\n if item_date:\n print(\n \"\ - ......Date: {} has confidence: {}\".format(\n item_date.value,\ - \ item_date.confidence\n )\n )\n tax\ - \ = item.value.get(\"Tax\")\n if tax:\n print(\n \ - \ \"......Tax: {} has confidence: {}\".format(tax.value, tax.confidence)\n\ - \ )\n amount = item.value.get(\"Amount\")\n \ - \ if amount:\n print(\n \"......Amount: {} has\ - \ confidence: {}\".format(\n amount.value, amount.confidence\n\ - \ )\n )\n subtotal = invoice.fields.get(\"\ - SubTotal\")\n if subtotal:\n print(\n \"Subtotal:\ - \ {} has confidence: {}\".format(\n subtotal.value, subtotal.confidence\n\ - \ )\n )\n total_tax = invoice.fields.get(\"TotalTax\"\ - )\n if total_tax:\n print(\n \"Total Tax: {} has\ - \ confidence: {}\".format(\n total_tax.value, total_tax.confidence\n\ - \ )\n )\n previous_unpaid_balance = invoice.fields.get(\"\ - PreviousUnpaidBalance\")\n if previous_unpaid_balance:\n print(\n\ - \ \"Previous Unpaid Balance: {} has confidence: {}\".format(\n \ - \ previous_unpaid_balance.value, previous_unpaid_balance.confidence\n\ - \ )\n )\n amount_due = invoice.fields.get(\"AmountDue\"\ - )\n if amount_due:\n print(\n \"Amount Due: {} has\ - \ confidence: {}\".format(\n amount_due.value, amount_due.confidence\n\ - \ )\n )\n service_start_date = invoice.fields.get(\"\ - ServiceStartDate\")\n if service_start_date:\n print(\n \ - \ \"Service Start Date: {} has confidence: {}\".format(\n \ - \ service_start_date.value, service_start_date.confidence\n \ - \ )\n )\n service_end_date = invoice.fields.get(\"ServiceEndDate\"\ - )\n if service_end_date:\n print(\n \"Service End\ - \ Date: {} has confidence: {}\".format(\n service_end_date.value,\ - \ service_end_date.confidence\n )\n )\n service_address\ - \ = invoice.fields.get(\"ServiceAddress\")\n if service_address:\n \ - \ print(\n \"Service Address: {} has confidence: {}\".format(\n\ - \ service_address.value, service_address.confidence\n \ - \ )\n )\n service_address_recipient = invoice.fields.get(\"\ - ServiceAddressRecipient\")\n if service_address_recipient:\n print(\n\ - \ \"Service Address Recipient: {} has confidence: {}\".format(\n\ - \ service_address_recipient.value,\n service_address_recipient.confidence,\n\ - \ )\n )\n remittance_address = invoice.fields.get(\"\ - RemittanceAddress\")\n if remittance_address:\n print(\n \ - \ \"Remittance Address: {} has confidence: {}\".format(\n \ - \ remittance_address.value, remittance_address.confidence\n \ - \ )\n )\n remittance_address_recipient = invoice.fields.get(\"\ - RemittanceAddressRecipient\")\n if remittance_address_recipient:\n \ - \ print(\n \"Remittance Address Recipient: {} has confidence:\ - \ {}\".format(\n remittance_address_recipient.value,\n \ - \ remittance_address_recipient.confidence,\n )\n \ - \ )\n\n ````\n\nAnalyze a custom document. For more samples see the\ - \ *samples* folder.\n\n\n\n````python\n\ - \n from azure.core.credentials import AzureKeyCredential\n from azure.ai.formrecognizer\ - \ import DocumentAnalysisClient\n\n endpoint = os.environ[\"AZURE_FORM_RECOGNIZER_ENDPOINT\"\ - ]\n key = os.environ[\"AZURE_FORM_RECOGNIZER_KEY\"]\n model_id = os.getenv(\"\ - CUSTOM_BUILT_MODEL_ID\", custom_model_id)\n\n document_analysis_client = DocumentAnalysisClient(\n\ - \ endpoint=endpoint, credential=AzureKeyCredential(key)\n )\n\n # Make\ - \ sure your document's type is included in the list of document types the custom\ - \ model can analyze\n with open(path_to_sample_documents, \"rb\") as f:\n \ - \ poller = document_analysis_client.begin_analyze_document(\n model_id=model_id,\ - \ document=f\n )\n result = poller.result()\n\n for idx, document in\ - \ enumerate(result.documents):\n print(\"--------Analyzing document #{}--------\"\ - .format(idx + 1))\n print(\"Document has type {}\".format(document.doc_type))\n\ - \ print(\"Document has confidence {}\".format(document.confidence))\n \ - \ print(\"Document was analyzed by model with ID {}\".format(result.model_id))\n\ - \ for name, field in document.fields.items():\n field_value =\ - \ field.value if field.value else field.content\n print(\"......found\ - \ field of type '{}' with value '{}' and with confidence {}\".format(field.value_type,\ - \ field_value, field.confidence))\n\n\n # iterate over tables, lines, and selection\ - \ marks on each page\n for page in result.pages:\n print(\"\\nLines found\ - \ on page {}\".format(page.page_number))\n for line in page.lines:\n \ - \ print(\"...Line '{}'\".format(line.content))\n for word in page.words:\n\ - \ print(\n \"...Word '{}' has a confidence of {}\".format(\n\ - \ word.content, word.confidence\n )\n \ - \ )\n for selection_mark in page.selection_marks:\n print(\n\ - \ \"...Selection mark is '{}' and has a confidence of {}\".format(\n\ - \ selection_mark.state, selection_mark.confidence\n \ - \ )\n )\n\n for i, table in enumerate(result.tables):\n \ - \ print(\"\\nTable {} can be found on page:\".format(i + 1))\n for region\ - \ in table.bounding_regions:\n print(\"...{}\".format(region.page_number))\n\ - \ for cell in table.cells:\n print(\n \"...Cell[{}][{}]\ - \ has content '{}'\".format(\n cell.row_index, cell.column_index,\ - \ cell.content\n )\n )\n print(\"-----------------------------------\"\ - )\n\n ````\n" - uid: azure.ai.formrecognizer.DocumentAnalysisClient.begin_analyze_document_from_url name: begin_analyze_document_from_url summary: 'Analyze field text and semantic values from a given document. @@ -365,59 +165,6 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Analyze a receipt. For more samples see the *samples* folder.\n\n\n\n````python\n\n from azure.core.credentials\ - \ import AzureKeyCredential\n from azure.ai.formrecognizer import DocumentAnalysisClient\n\ - \n endpoint = os.environ[\"AZURE_FORM_RECOGNIZER_ENDPOINT\"]\n key = os.environ[\"\ - AZURE_FORM_RECOGNIZER_KEY\"]\n\n document_analysis_client = DocumentAnalysisClient(\n\ - \ endpoint=endpoint, credential=AzureKeyCredential(key)\n )\n url =\ - \ \"https://raw.githubusercontent.com/Azure/azure-sdk-for-python/main/sdk/formrecognizer/azure-ai-formrecognizer/tests/sample_forms/receipt/contoso-receipt.png\"\ - \n poller = document_analysis_client.begin_analyze_document_from_url(\n \ - \ \"prebuilt-receipt\", document_url=url\n )\n receipts = poller.result()\n\ - \n for idx, receipt in enumerate(receipts.documents):\n print(\"--------Analysis\ - \ of receipt #{}--------\".format(idx + 1))\n print(\"Receipt type: {}\"\ - .format(receipt.doc_type or \"N/A\"))\n merchant_name = receipt.fields.get(\"\ - MerchantName\")\n if merchant_name:\n print(\n \"\ - Merchant Name: {} has confidence: {}\".format(\n merchant_name.value,\ - \ merchant_name.confidence\n )\n )\n transaction_date\ - \ = receipt.fields.get(\"TransactionDate\")\n if transaction_date:\n \ - \ print(\n \"Transaction Date: {} has confidence: {}\".format(\n\ - \ transaction_date.value, transaction_date.confidence\n \ - \ )\n )\n if receipt.fields.get(\"Items\"):\n \ - \ print(\"Receipt items:\")\n for idx, item in enumerate(receipt.fields.get(\"\ - Items\").value):\n print(\"...Item #{}\".format(idx + 1))\n \ - \ item_description = item.value.get(\"Description\")\n \ - \ if item_description:\n print(\n \"\ - ......Item Description: {} has confidence: {}\".format(\n \ - \ item_description.value, item_description.confidence\n \ - \ )\n )\n item_quantity = item.value.get(\"\ - Quantity\")\n if item_quantity:\n print(\n \ - \ \"......Item Quantity: {} has confidence: {}\".format(\n\ - \ item_quantity.value, item_quantity.confidence\n \ - \ )\n )\n item_price = item.value.get(\"\ - Price\")\n if item_price:\n print(\n \ - \ \"......Individual Item Price: {} has confidence: {}\".format(\n\ - \ item_price.value, item_price.confidence\n \ - \ )\n )\n item_total_price = item.value.get(\"\ - TotalPrice\")\n if item_total_price:\n print(\n\ - \ \"......Total Item Price: {} has confidence: {}\".format(\n\ - \ item_total_price.value, item_total_price.confidence\n\ - \ )\n )\n subtotal = receipt.fields.get(\"\ - Subtotal\")\n if subtotal:\n print(\n \"Subtotal:\ - \ {} has confidence: {}\".format(\n subtotal.value, subtotal.confidence\n\ - \ )\n )\n tax = receipt.fields.get(\"TotalTax\"\ - )\n if tax:\n print(\"Total tax: {} has confidence: {}\".format(tax.value,\ - \ tax.confidence))\n tip = receipt.fields.get(\"Tip\")\n if tip:\n\ - \ print(\"Tip: {} has confidence: {}\".format(tip.value, tip.confidence))\n\ - \ total = receipt.fields.get(\"Total\")\n if total:\n print(\"\ - Total: {} has confidence: {}\".format(total.value, total.confidence))\n \ - \ print(\"--------------------------------------\")\n\n ````\n" - uid: azure.ai.formrecognizer.DocumentAnalysisClient.close name: close summary: Close the session. diff --git a/docs-ref-autogen/azure-ai-formrecognizer/azure.ai.formrecognizer.DocumentModelAdministrationClient.yml b/docs-ref-autogen/azure-ai-formrecognizer/azure.ai.formrecognizer.DocumentModelAdministrationClient.yml index f831b067b951..8910a7bc1f64 100644 --- a/docs-ref-autogen/azure-ai-formrecognizer/azure.ai.formrecognizer.DocumentModelAdministrationClient.yml +++ b/docs-ref-autogen/azure-ai-formrecognizer/azure.ai.formrecognizer.DocumentModelAdministrationClient.yml @@ -65,30 +65,6 @@ constructor: types: - - -examples: -- "Creating the DocumentModelAdministrationClient with an endpoint and API key.\n\n\n\n````python\n\n from azure.core.credentials import AzureKeyCredential\n\ - \ from azure.ai.formrecognizer import DocumentModelAdministrationClient\n\n \ - \ endpoint = os.environ[\"AZURE_FORM_RECOGNIZER_ENDPOINT\"]\n key = os.environ[\"\ - AZURE_FORM_RECOGNIZER_KEY\"]\n\n document_model_admin_client = DocumentModelAdministrationClient(endpoint,\ - \ AzureKeyCredential(key))\n\n ````\n\nCreating the DocumentModelAdministrationClient\ - \ with a token credential.\n\n\n\n````python\n\n \"\"\"DefaultAzureCredential\ - \ will use the values from these environment\n variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,\ - \ AZURE_CLIENT_SECRET\n \"\"\"\n from azure.ai.formrecognizer import DocumentModelAdministrationClient\n\ - \ from azure.identity import DefaultAzureCredential\n\n endpoint = os.environ[\"\ - AZURE_FORM_RECOGNIZER_ENDPOINT\"]\n credential = DefaultAzureCredential()\n\n\ - \ document_model_admin_client = DocumentModelAdministrationClient(endpoint, credential)\n\ - \n ````\n" methods: - uid: azure.ai.formrecognizer.DocumentModelAdministrationClient.begin_build_document_model name: begin_build_document_model @@ -169,29 +145,6 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Building a model from training files.\n\n\n\n````python\n\ - \n from azure.ai.formrecognizer import DocumentModelAdministrationClient, ModelBuildMode\n\ - \ from azure.core.credentials import AzureKeyCredential\n\n endpoint = os.environ[\"\ - AZURE_FORM_RECOGNIZER_ENDPOINT\"]\n key = os.environ[\"AZURE_FORM_RECOGNIZER_KEY\"\ - ]\n container_sas_url = os.environ[\"CONTAINER_SAS_URL\"]\n\n document_model_admin_client\ - \ = DocumentModelAdministrationClient(endpoint, AzureKeyCredential(key))\n poller\ - \ = document_model_admin_client.begin_build_document_model(\n ModelBuildMode.TEMPLATE,\ - \ blob_container_url=container_sas_url, description=\"my model description\"\n\ - \ )\n model = poller.result()\n\n print(\"Model ID: {}\".format(model.model_id))\n\ - \ print(\"Description: {}\".format(model.description))\n print(\"Model created\ - \ on: {}\\n\".format(model.created_on))\n print(\"Doc types the model can recognize:\"\ - )\n for name, doc_type in model.doc_types.items():\n print(\"\\nDoc Type:\ - \ '{}' built with '{}' mode which has the following fields:\".format(name, doc_type.build_mode))\n\ - \ for field_name, field in doc_type.field_schema.items():\n print(\"\ - Field: '{}' has type '{}' and confidence score {}\".format(\n field_name,\ - \ field[\"type\"], doc_type.field_confidence[field_name]\n ))\n\n \ - \ ````\n" - uid: azure.ai.formrecognizer.DocumentModelAdministrationClient.begin_compose_document_model name: begin_compose_document_model summary: 'Creates a composed document model from a collection of existing models. @@ -236,45 +189,6 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Creating a composed model with existing models.\n\n\n\n````python\n\n from azure.core.credentials\ - \ import AzureKeyCredential\n from azure.ai.formrecognizer import DocumentModelAdministrationClient,\ - \ ModelBuildMode\n\n endpoint = os.environ[\"AZURE_FORM_RECOGNIZER_ENDPOINT\"\ - ]\n key = os.environ[\"AZURE_FORM_RECOGNIZER_KEY\"]\n po_supplies = os.environ['PURCHASE_ORDER_OFFICE_SUPPLIES_SAS_URL']\n\ - \ po_equipment = os.environ['PURCHASE_ORDER_OFFICE_EQUIPMENT_SAS_URL']\n po_furniture\ - \ = os.environ['PURCHASE_ORDER_OFFICE_FURNITURE_SAS_URL']\n po_cleaning_supplies\ - \ = os.environ['PURCHASE_ORDER_OFFICE_CLEANING_SUPPLIES_SAS_URL']\n\n document_model_admin_client\ - \ = DocumentModelAdministrationClient(endpoint=endpoint, credential=AzureKeyCredential(key))\n\ - \ supplies_poller = document_model_admin_client.begin_build_document_model(\n\ - \ ModelBuildMode.TEMPLATE, blob_container_url=po_supplies, description=\"\ - Purchase order-Office supplies\"\n )\n equipment_poller = document_model_admin_client.begin_build_document_model(\n\ - \ ModelBuildMode.TEMPLATE, blob_container_url=po_equipment, description=\"\ - Purchase order-Office Equipment\"\n )\n furniture_poller = document_model_admin_client.begin_build_document_model(\n\ - \ ModelBuildMode.TEMPLATE, blob_container_url=po_furniture, description=\"\ - Purchase order-Furniture\"\n )\n cleaning_supplies_poller = document_model_admin_client.begin_build_document_model(\n\ - \ ModelBuildMode.TEMPLATE, blob_container_url=po_cleaning_supplies, description=\"\ - Purchase order-Cleaning Supplies\"\n )\n supplies_model = supplies_poller.result()\n\ - \ equipment_model = equipment_poller.result()\n furniture_model = furniture_poller.result()\n\ - \ cleaning_supplies_model = cleaning_supplies_poller.result()\n\n purchase_order_models\ - \ = [\n supplies_model.model_id,\n equipment_model.model_id,\n \ - \ furniture_model.model_id,\n cleaning_supplies_model.model_id\n ]\n\ - \n poller = document_model_admin_client.begin_compose_document_model(\n \ - \ purchase_order_models, description=\"Office Supplies Composed Model\"\n \ - \ )\n model = poller.result()\n\n print(\"Office Supplies Composed Model Info:\"\ - )\n print(\"Model ID: {}\".format(model.model_id))\n print(\"Description:\ - \ {}\".format(model.description))\n print(\"Model created on: {}\\n\".format(model.created_on))\n\ - \ print(\"Doc types the model can recognize:\")\n for name, doc_type in model.doc_types.items():\n\ - \ print(\"\\nDoc Type: '{}' which has the following fields:\".format(name))\n\ - \ for field_name, field in doc_type.field_schema.items():\n print(\"\ - Field: '{}' has type '{}' and confidence score {}\".format(\n field_name,\ - \ field[\"type\"], doc_type.field_confidence[field_name]\n ))\n\n \ - \ ````\n" - uid: azure.ai.formrecognizer.DocumentModelAdministrationClient.begin_copy_document_model_to name: begin_copy_document_model_to summary: 'Copy a document model stored in this resource (the source) to the user @@ -315,34 +229,6 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Copy a model from the source resource to the target resource\n\n\n\n````python\n\n from azure.core.credentials\ - \ import AzureKeyCredential\n from azure.ai.formrecognizer import DocumentModelAdministrationClient\n\ - \n source_endpoint = os.environ[\"AZURE_FORM_RECOGNIZER_SOURCE_ENDPOINT\"]\n\ - \ source_key = os.environ[\"AZURE_FORM_RECOGNIZER_SOURCE_KEY\"]\n target_endpoint\ - \ = os.environ[\"AZURE_FORM_RECOGNIZER_TARGET_ENDPOINT\"]\n target_key = os.environ[\"\ - AZURE_FORM_RECOGNIZER_TARGET_KEY\"]\n source_model_id = os.getenv(\"AZURE_SOURCE_MODEL_ID\"\ - , custom_model_id)\n\n target_client = DocumentModelAdministrationClient(endpoint=target_endpoint,\ - \ credential=AzureKeyCredential(target_key))\n\n target = target_client.get_copy_authorization(\n\ - \ description=\"model copied from other resource\"\n )\n\n source_client\ - \ = DocumentModelAdministrationClient(endpoint=source_endpoint, credential=AzureKeyCredential(source_key))\n\ - \ poller = source_client.begin_copy_document_model_to(\n model_id=source_model_id,\n\ - \ target=target # output from target client's call to get_copy_authorization()\n\ - \ )\n copied_over_model = poller.result()\n\n print(\"Model ID: {}\".format(copied_over_model.model_id))\n\ - \ print(\"Description: {}\".format(copied_over_model.description))\n print(\"\ - Model created on: {}\\n\".format(copied_over_model.created_on))\n print(\"Doc\ - \ types the model can recognize:\")\n for name, doc_type in copied_over_model.doc_types.items():\n\ - \ print(\"\\nDoc Type: '{}' which has the following fields:\".format(name))\n\ - \ for field_name, field in doc_type.field_schema.items():\n print(\"\ - Field: '{}' has type '{}' and confidence score {}\".format(\n field_name,\ - \ field[\"type\"], doc_type.field_confidence[field_name]\n ))\n\n \ - \ ````\n" - uid: azure.ai.formrecognizer.DocumentModelAdministrationClient.close name: close summary: Close the @@ -364,17 +250,6 @@ methods: exceptions: - type: azure.core.exceptions.HttpResponseError - type: azure.core.exceptions.ResourceNotFoundError - examples: - - "Delete a model.\n\ - \n\n\n````python\n\ - \n document_model_admin_client.delete_document_model(model_id=my_model.model_id)\n\ - \n try:\n document_model_admin_client.get_document_model(model_id=my_model.model_id)\n\ - \ except ResourceNotFoundError:\n print(\"Successfully deleted model with\ - \ ID {}\".format(my_model.model_id))\n\n ````\n" - uid: azure.ai.formrecognizer.DocumentModelAdministrationClient.get_copy_authorization name: get_copy_authorization summary: 'Generate authorization for copying a custom model into the target Form @@ -432,17 +307,6 @@ methods: exceptions: - type: azure.core.exceptions.HttpResponseError - type: azure.core.exceptions.ResourceNotFoundError - examples: - - "Get a model by its ID.\n\n\n\n````python\n\ - \n my_model = document_model_admin_client.get_document_model(model_id=model.model_id)\n\ - \ print(\"\\nModel ID: {}\".format(my_model.model_id))\n print(\"Description:\ - \ {}\".format(my_model.description))\n print(\"Model created on: {}\".format(my_model.created_on))\n\ - \n ````\n" - uid: azure.ai.formrecognizer.DocumentModelAdministrationClient.get_operation name: get_operation summary: 'Get an operation by its ID. @@ -469,25 +333,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Get a document model operation by its ID.\n\n\n\n````python\n\n # Get an operation by ID\n \ - \ if operations:\n print(\"\\nGetting operation info by ID: {}\".format(operations[0].operation_id))\n\ - \ operation_info = document_model_admin_client.get_operation(operations[0].operation_id)\n\ - \ if operation_info.status == \"succeeded\":\n print(\"My {} operation\ - \ is completed.\".format(operation_info.kind))\n result = operation_info.result\n\ - \ if result is not None:\n print(\"Model ID: {}\".format(result.model_id))\n\ - \ elif operation_info.status == \"failed\":\n print(\"My {} operation\ - \ failed.\".format(operation_info.kind))\n error = operation_info.error\n\ - \ if error is not None:\n print(\"{}: {}\".format(error.code,\ - \ error.message))\n else:\n print(\"My operation status is {}\"\ - .format(operation_info.status))\n else:\n print(\"No operations found.\"\ - )\n\n ````\n" - uid: azure.ai.formrecognizer.DocumentModelAdministrationClient.get_resource_details name: get_resource_details summary: Get information about the models under the Form Recognizer resource. @@ -498,19 +343,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Get model counts and limits under the Form Recognizer resource.\n\n\n\n````python\n\n document_model_admin_client\ - \ = DocumentModelAdministrationClient(endpoint=endpoint, credential=AzureKeyCredential(key))\n\ - \n account_details = document_model_admin_client.get_resource_details()\n \ - \ print(\"Our resource has {} custom models, and we can have at most {} custom\ - \ models\\n\".format(\n account_details.custom_document_models.count, account_details.custom_document_models.limit\n\ - \ ))\n\n ````\n" - uid: azure.ai.formrecognizer.DocumentModelAdministrationClient.list_document_models name: list_document_models summary: 'List information for each model, including its model ID, @@ -523,17 +355,6 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "List all models that were built successfully under the Form Recognizer resource.\n\n\n\n````python\n\n models = document_model_admin_client.list_document_models()\n\ - \n print(\"We have the following 'ready' models with IDs and descriptions:\"\ - )\n for model in models:\n print(\"{} | {}\".format(model.model_id, model.description))\n\ - \n ````\n" - uid: azure.ai.formrecognizer.DocumentModelAdministrationClient.list_operations name: list_operations summary: 'List information for each operation. @@ -554,24 +375,3 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "List all document model operations in the past 24 hours.\n\n\n\n````python\n\n from azure.core.credentials\ - \ import AzureKeyCredential\n from azure.ai.formrecognizer import DocumentModelAdministrationClient\n\ - \n endpoint = os.environ[\"AZURE_FORM_RECOGNIZER_ENDPOINT\"]\n key = os.environ[\"\ - AZURE_FORM_RECOGNIZER_KEY\"]\n\n document_model_admin_client = DocumentModelAdministrationClient(endpoint=endpoint,\ - \ credential=AzureKeyCredential(key))\n\n operations = list(document_model_admin_client.list_operations())\n\ - \n print(\"The following document model operations exist under my resource:\"\ - )\n for operation in operations:\n print(\"\\nOperation ID: {}\".format(operation.operation_id))\n\ - \ print(\"Operation kind: {}\".format(operation.kind))\n print(\"\ - Operation status: {}\".format(operation.status))\n print(\"Operation percent\ - \ completed: {}\".format(operation.percent_completed))\n print(\"Operation\ - \ created on: {}\".format(operation.created_on))\n print(\"Operation last\ - \ updated on: {}\".format(operation.last_updated_on))\n print(\"Resource\ - \ location of successful operation: {}\".format(operation.resource_location))\n\ - \n ````\n" diff --git a/docs-ref-autogen/azure-ai-formrecognizer/azure.ai.formrecognizer.FormRecognizerClient.yml b/docs-ref-autogen/azure-ai-formrecognizer/azure.ai.formrecognizer.FormRecognizerClient.yml index 96cdcaec35c7..602f2d38f943 100644 --- a/docs-ref-autogen/azure-ai-formrecognizer/azure.ai.formrecognizer.FormRecognizerClient.yml +++ b/docs-ref-autogen/azure-ai-formrecognizer/azure.ai.formrecognizer.FormRecognizerClient.yml @@ -61,29 +61,6 @@ constructor: types: - - -examples: -- "Creating the FormRecognizerClient with an endpoint and API key.\n\n\n\n````python\n\n from azure.core.credentials import\ - \ AzureKeyCredential\n from azure.ai.formrecognizer import FormRecognizerClient\n\ - \ endpoint = os.environ[\"AZURE_FORM_RECOGNIZER_ENDPOINT\"]\n key = os.environ[\"\ - AZURE_FORM_RECOGNIZER_KEY\"]\n\n form_recognizer_client = FormRecognizerClient(endpoint,\ - \ AzureKeyCredential(key))\n\n ````\n\nCreating the FormRecognizerClient with\ - \ a token credential.\n\n\n\n````python\n\n \"\"\"DefaultAzureCredential\ - \ will use the values from these environment\n variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,\ - \ AZURE_CLIENT_SECRET\n \"\"\"\n from azure.ai.formrecognizer import FormRecognizerClient\n\ - \ from azure.identity import DefaultAzureCredential\n\n endpoint = os.environ[\"\ - AZURE_FORM_RECOGNIZER_ENDPOINT\"]\n credential = DefaultAzureCredential()\n\n\ - \ form_recognizer_client = FormRecognizerClient(endpoint, credential)\n\n ````\n" methods: - uid: azure.ai.formrecognizer.FormRecognizerClient.begin_recognize_business_cards name: begin_recognize_business_cards @@ -154,57 +131,6 @@ methods: - [[]] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Recognize business cards from a file.\n\n\n\n````python\n\ - \n from azure.core.credentials import AzureKeyCredential\n from azure.ai.formrecognizer\ - \ import FormRecognizerClient\n\n endpoint = os.environ[\"AZURE_FORM_RECOGNIZER_ENDPOINT\"\ - ]\n key = os.environ[\"AZURE_FORM_RECOGNIZER_KEY\"]\n\n form_recognizer_client\ - \ = FormRecognizerClient(\n endpoint=endpoint, credential=AzureKeyCredential(key)\n\ - \ )\n with open(path_to_sample_forms, \"rb\") as f:\n poller = form_recognizer_client.begin_recognize_business_cards(business_card=f,\ - \ locale=\"en-US\")\n business_cards = poller.result()\n\n for idx, business_card\ - \ in enumerate(business_cards):\n print(\"--------Recognizing business card\ - \ #{}--------\".format(idx+1))\n contact_names = business_card.fields.get(\"\ - ContactNames\")\n if contact_names:\n for contact_name in contact_names.value:\n\ - \ print(\"Contact First Name: {} has confidence: {}\".format(\n\ - \ contact_name.value[\"FirstName\"].value, contact_name.value[\"\ - FirstName\"].confidence\n ))\n print(\"Contact Last\ - \ Name: {} has confidence: {}\".format(\n contact_name.value[\"\ - LastName\"].value, contact_name.value[\"LastName\"].confidence\n \ - \ ))\n company_names = business_card.fields.get(\"CompanyNames\")\n \ - \ if company_names:\n for company_name in company_names.value:\n\ - \ print(\"Company Name: {} has confidence: {}\".format(company_name.value,\ - \ company_name.confidence))\n departments = business_card.fields.get(\"\ - Departments\")\n if departments:\n for department in departments.value:\n\ - \ print(\"Department: {} has confidence: {}\".format(department.value,\ - \ department.confidence))\n job_titles = business_card.fields.get(\"JobTitles\"\ - )\n if job_titles:\n for job_title in job_titles.value:\n \ - \ print(\"Job Title: {} has confidence: {}\".format(job_title.value,\ - \ job_title.confidence))\n emails = business_card.fields.get(\"Emails\"\ - )\n if emails:\n for email in emails.value:\n print(\"\ - Email: {} has confidence: {}\".format(email.value, email.confidence))\n \ - \ websites = business_card.fields.get(\"Websites\")\n if websites:\n \ - \ for website in websites.value:\n print(\"Website: {} has\ - \ confidence: {}\".format(website.value, website.confidence))\n addresses\ - \ = business_card.fields.get(\"Addresses\")\n if addresses:\n \ - \ for address in addresses.value:\n print(\"Address: {} has confidence:\ - \ {}\".format(address.value, address.confidence))\n mobile_phones = business_card.fields.get(\"\ - MobilePhones\")\n if mobile_phones:\n for phone in mobile_phones.value:\n\ - \ print(\"Mobile phone number: {} has confidence: {}\".format(phone.value,\ - \ phone.confidence))\n faxes = business_card.fields.get(\"Faxes\")\n \ - \ if faxes:\n for fax in faxes.value:\n print(\"Fax\ - \ number: {} has confidence: {}\".format(fax.value, fax.confidence))\n work_phones\ - \ = business_card.fields.get(\"WorkPhones\")\n if work_phones:\n \ - \ for work_phone in work_phones.value:\n print(\"Work phone number:\ - \ {} has confidence: {}\".format(work_phone.value, work_phone.confidence))\n \ - \ other_phones = business_card.fields.get(\"OtherPhones\")\n if other_phones:\n\ - \ for other_phone in other_phones.value:\n print(\"Other\ - \ phone number: {} has confidence: {}\".format(other_phone.value, other_phone.confidence))\n\ - \n ````\n" - uid: azure.ai.formrecognizer.FormRecognizerClient.begin_recognize_business_cards_from_url name: begin_recognize_business_cards_from_url summary: 'Extract field text and semantic values from a given business card. @@ -343,44 +269,6 @@ methods: - [[]] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Recognize text and content/layout information from a form.\n\n\n\n````python\n\n from azure.core.credentials\ - \ import AzureKeyCredential\n from azure.ai.formrecognizer import FormRecognizerClient\n\ - \n endpoint = os.environ[\"AZURE_FORM_RECOGNIZER_ENDPOINT\"]\n key = os.environ[\"\ - AZURE_FORM_RECOGNIZER_KEY\"]\n\n form_recognizer_client = FormRecognizerClient(endpoint=endpoint,\ - \ credential=AzureKeyCredential(key))\n with open(path_to_sample_forms, \"rb\"\ - ) as f:\n poller = form_recognizer_client.begin_recognize_content(form=f)\n\ - \ form_pages = poller.result()\n\n for idx, content in enumerate(form_pages):\n\ - \ print(\"----Recognizing content from page #{}----\".format(idx+1))\n \ - \ print(\"Page has width: {} and height: {}, measured with unit: {}\".format(\n\ - \ content.width,\n content.height,\n content.unit\n\ - \ ))\n for table_idx, table in enumerate(content.tables):\n \ - \ print(\"Table # {} has {} rows and {} columns\".format(table_idx, table.row_count,\ - \ table.column_count))\n print(\"Table # {} location on page: {}\".format(table_idx,\ - \ format_bounding_box(table.bounding_box)))\n for cell in table.cells:\n\ - \ print(\"...Cell[{}][{}] has text '{}' within bounding box '{}'\"\ - .format(\n cell.row_index,\n cell.column_index,\n\ - \ cell.text,\n format_bounding_box(cell.bounding_box)\n\ - \ ))\n\n for line_idx, line in enumerate(content.lines):\n\ - \ print(\"Line # {} has word count '{}' and text '{}' within bounding\ - \ box '{}'\".format(\n line_idx,\n len(line.words),\n\ - \ line.text,\n format_bounding_box(line.bounding_box)\n\ - \ ))\n if line.appearance:\n if line.appearance.style_name\ - \ == \"handwriting\" and line.appearance.style_confidence > 0.8:\n \ - \ print(\"Text line '{}' is handwritten and might be a signature.\".format(line.text))\n\ - \ for word in line.words:\n print(\"...Word '{}' has a\ - \ confidence of {}\".format(word.text, word.confidence))\n\n for selection_mark\ - \ in content.selection_marks:\n print(\"Selection mark is '{}' within\ - \ bounding box '{}' and has a confidence of {}\".format(\n selection_mark.state,\n\ - \ format_bounding_box(selection_mark.bounding_box),\n \ - \ selection_mark.confidence\n ))\n print(\"----------------------------------------\"\ - )\n\n\n ````\n" - uid: azure.ai.formrecognizer.FormRecognizerClient.begin_recognize_content_from_url name: begin_recognize_content_from_url summary: 'Extract text and layout information from a given document. @@ -513,53 +401,6 @@ methods: - [[]] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Recognize fields and values from a custom form.\n\n\n\n````python\n\n from azure.core.credentials\ - \ import AzureKeyCredential\n from azure.ai.formrecognizer import FormRecognizerClient\n\ - \n endpoint = os.environ[\"AZURE_FORM_RECOGNIZER_ENDPOINT\"]\n key = os.environ[\"\ - AZURE_FORM_RECOGNIZER_KEY\"]\n model_id = os.getenv(\"CUSTOM_TRAINED_MODEL_ID\"\ - , custom_model_id)\n\n form_recognizer_client = FormRecognizerClient(\n \ - \ endpoint=endpoint, credential=AzureKeyCredential(key)\n )\n\n # Make sure\ - \ your form's type is included in the list of form types the custom model can\ - \ recognize\n with open(path_to_sample_forms, \"rb\") as f:\n poller =\ - \ form_recognizer_client.begin_recognize_custom_forms(\n model_id=model_id,\ - \ form=f, include_field_elements=True\n )\n forms = poller.result()\n\n\ - \ for idx, form in enumerate(forms):\n print(\"--------Recognizing Form\ - \ #{}--------\".format(idx+1))\n print(\"Form has type {}\".format(form.form_type))\n\ - \ print(\"Form has form type confidence {}\".format(form.form_type_confidence))\n\ - \ print(\"Form was analyzed with model with ID {}\".format(form.model_id))\n\ - \ for name, field in form.fields.items():\n # each field is of\ - \ type FormField\n # label_data is populated if you are using a model\ - \ trained without labels,\n # since the service needs to make predictions\ - \ for labels if not explicitly given to it.\n if field.label_data:\n\ - \ print(\"...Field '{}' has label '{}' with a confidence score of\ - \ {}\".format(\n name,\n field.label_data.text,\n\ - \ field.confidence\n ))\n\n print(\"\ - ...Label '{}' has value '{}' with a confidence score of {}\".format(\n \ - \ field.label_data.text if field.label_data else name, field.value, field.confidence\n\ - \ ))\n\n # iterate over tables, lines, and selection marks on\ - \ each page\n for page in form.pages:\n for i, table in enumerate(page.tables):\n\ - \ print(\"\\nTable {} on page {}\".format(i+1, table.page_number))\n\ - \ for cell in table.cells:\n print(\"...Cell[{}][{}]\ - \ has text '{}' with confidence {}\".format(\n cell.row_index,\ - \ cell.column_index, cell.text, cell.confidence\n ))\n \ - \ print(\"\\nLines found on page {}\".format(page.page_number))\n \ - \ for line in page.lines:\n print(\"...Line '{}' is made up of\ - \ the following words: \".format(line.text))\n for word in line.words:\n\ - \ print(\"......Word '{}' has a confidence of {}\".format(\n\ - \ word.text,\n word.confidence\n \ - \ ))\n if page.selection_marks:\n print(\"\ - \\nSelection marks found on page {}\".format(page.page_number))\n \ - \ for selection_mark in page.selection_marks:\n print(\"......Selection\ - \ mark is '{}' and has a confidence of {}\".format(\n selection_mark.state,\n\ - \ selection_mark.confidence\n ))\n\n \ - \ print(\"-----------------------------------\")\n\n ````\n" - uid: azure.ai.formrecognizer.FormRecognizerClient.begin_recognize_custom_forms_from_url name: begin_recognize_custom_forms_from_url summary: 'Analyze a custom form with a model trained with or without labels. The @@ -676,40 +517,6 @@ methods: - [[]] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Recognize identity document fields.\n\n\n\n````python\n\ - \n from azure.core.credentials import AzureKeyCredential\n from azure.ai.formrecognizer\ - \ import FormRecognizerClient\n\n endpoint = os.environ[\"AZURE_FORM_RECOGNIZER_ENDPOINT\"\ - ]\n key = os.environ[\"AZURE_FORM_RECOGNIZER_KEY\"]\n\n form_recognizer_client\ - \ = FormRecognizerClient(\n endpoint=endpoint, credential=AzureKeyCredential(key)\n\ - \ )\n with open(path_to_sample_forms, \"rb\") as f:\n poller = form_recognizer_client.begin_recognize_identity_documents(identity_document=f)\n\ - \ id_documents = poller.result()\n\n for idx, id_document in enumerate(id_documents):\n\ - \ print(\"--------Recognizing ID document #{}--------\".format(idx+1))\n\ - \ first_name = id_document.fields.get(\"FirstName\")\n if first_name:\n\ - \ print(\"First Name: {} has confidence: {}\".format(first_name.value,\ - \ first_name.confidence))\n last_name = id_document.fields.get(\"LastName\"\ - )\n if last_name:\n print(\"Last Name: {} has confidence: {}\"\ - .format(last_name.value, last_name.confidence))\n document_number = id_document.fields.get(\"\ - DocumentNumber\")\n if document_number:\n print(\"Document Number:\ - \ {} has confidence: {}\".format(document_number.value, document_number.confidence))\n\ - \ dob = id_document.fields.get(\"DateOfBirth\")\n if dob:\n \ - \ print(\"Date of Birth: {} has confidence: {}\".format(dob.value, dob.confidence))\n\ - \ doe = id_document.fields.get(\"DateOfExpiration\")\n if doe:\n \ - \ print(\"Date of Expiration: {} has confidence: {}\".format(doe.value,\ - \ doe.confidence))\n sex = id_document.fields.get(\"Sex\")\n if sex:\n\ - \ print(\"Sex: {} has confidence: {}\".format(sex.value, sex.confidence))\n\ - \ address = id_document.fields.get(\"Address\")\n if address:\n \ - \ print(\"Address: {} has confidence: {}\".format(address.value, address.confidence))\n\ - \ country_region = id_document.fields.get(\"CountryRegion\")\n if\ - \ country_region:\n print(\"Country/Region: {} has confidence: {}\"\ - .format(country_region.value, country_region.confidence))\n region = id_document.fields.get(\"\ - Region\")\n if region:\n print(\"Region: {} has confidence: {}\"\ - .format(region.value, region.confidence))\n\n ````\n" - uid: azure.ai.formrecognizer.FormRecognizerClient.begin_recognize_identity_documents_from_url name: begin_recognize_identity_documents_from_url summary: 'Extract field text and semantic values from a given identity document. @@ -830,108 +637,6 @@ methods: - [[]] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Recognize invoices from a file.\n\n\n\n````python\n\ - \n from azure.core.credentials import AzureKeyCredential\n from azure.ai.formrecognizer\ - \ import FormRecognizerClient\n\n endpoint = os.environ[\"AZURE_FORM_RECOGNIZER_ENDPOINT\"\ - ]\n key = os.environ[\"AZURE_FORM_RECOGNIZER_KEY\"]\n\n form_recognizer_client\ - \ = FormRecognizerClient(\n endpoint=endpoint, credential=AzureKeyCredential(key)\n\ - \ )\n with open(path_to_sample_forms, \"rb\") as f:\n poller = form_recognizer_client.begin_recognize_invoices(invoice=f,\ - \ locale=\"en-US\")\n invoices = poller.result()\n\n for idx, invoice in enumerate(invoices):\n\ - \ print(\"--------Recognizing invoice #{}--------\".format(idx+1))\n \ - \ vendor_name = invoice.fields.get(\"VendorName\")\n if vendor_name:\n\ - \ print(\"Vendor Name: {} has confidence: {}\".format(vendor_name.value,\ - \ vendor_name.confidence))\n vendor_address = invoice.fields.get(\"VendorAddress\"\ - )\n if vendor_address:\n print(\"Vendor Address: {} has confidence:\ - \ {}\".format(vendor_address.value, vendor_address.confidence))\n vendor_address_recipient\ - \ = invoice.fields.get(\"VendorAddressRecipient\")\n if vendor_address_recipient:\n\ - \ print(\"Vendor Address Recipient: {} has confidence: {}\".format(vendor_address_recipient.value,\ - \ vendor_address_recipient.confidence))\n customer_name = invoice.fields.get(\"\ - CustomerName\")\n if customer_name:\n print(\"Customer Name: {}\ - \ has confidence: {}\".format(customer_name.value, customer_name.confidence))\n\ - \ customer_id = invoice.fields.get(\"CustomerId\")\n if customer_id:\n\ - \ print(\"Customer Id: {} has confidence: {}\".format(customer_id.value,\ - \ customer_id.confidence))\n customer_address = invoice.fields.get(\"CustomerAddress\"\ - )\n if customer_address:\n print(\"Customer Address: {} has confidence:\ - \ {}\".format(customer_address.value, customer_address.confidence))\n customer_address_recipient\ - \ = invoice.fields.get(\"CustomerAddressRecipient\")\n if customer_address_recipient:\n\ - \ print(\"Customer Address Recipient: {} has confidence: {}\".format(customer_address_recipient.value,\ - \ customer_address_recipient.confidence))\n invoice_id = invoice.fields.get(\"\ - InvoiceId\")\n if invoice_id:\n print(\"Invoice Id: {} has confidence:\ - \ {}\".format(invoice_id.value, invoice_id.confidence))\n invoice_date =\ - \ invoice.fields.get(\"InvoiceDate\")\n if invoice_date:\n print(\"\ - Invoice Date: {} has confidence: {}\".format(invoice_date.value, invoice_date.confidence))\n\ - \ invoice_total = invoice.fields.get(\"InvoiceTotal\")\n if invoice_total:\n\ - \ print(\"Invoice Total: {} has confidence: {}\".format(invoice_total.value,\ - \ invoice_total.confidence))\n due_date = invoice.fields.get(\"DueDate\"\ - )\n if due_date:\n print(\"Due Date: {} has confidence: {}\".format(due_date.value,\ - \ due_date.confidence))\n purchase_order = invoice.fields.get(\"PurchaseOrder\"\ - )\n if purchase_order:\n print(\"Purchase Order: {} has confidence:\ - \ {}\".format(purchase_order.value, purchase_order.confidence))\n billing_address\ - \ = invoice.fields.get(\"BillingAddress\")\n if billing_address:\n \ - \ print(\"Billing Address: {} has confidence: {}\".format(billing_address.value,\ - \ billing_address.confidence))\n billing_address_recipient = invoice.fields.get(\"\ - BillingAddressRecipient\")\n if billing_address_recipient:\n print(\"\ - Billing Address Recipient: {} has confidence: {}\".format(billing_address_recipient.value,\ - \ billing_address_recipient.confidence))\n shipping_address = invoice.fields.get(\"\ - ShippingAddress\")\n if shipping_address:\n print(\"Shipping Address:\ - \ {} has confidence: {}\".format(shipping_address.value, shipping_address.confidence))\n\ - \ shipping_address_recipient = invoice.fields.get(\"ShippingAddressRecipient\"\ - )\n if shipping_address_recipient:\n print(\"Shipping Address\ - \ Recipient: {} has confidence: {}\".format(shipping_address_recipient.value,\ - \ shipping_address_recipient.confidence))\n print(\"Invoice items:\")\n\ - \ for idx, item in enumerate(invoice.fields.get(\"Items\").value):\n \ - \ print(\"...Item #{}\".format(idx+1))\n item_description = item.value.get(\"\ - Description\")\n if item_description:\n print(\"......Description:\ - \ {} has confidence: {}\".format(item_description.value, item_description.confidence))\n\ - \ item_quantity = item.value.get(\"Quantity\")\n if item_quantity:\n\ - \ print(\"......Quantity: {} has confidence: {}\".format(item_quantity.value,\ - \ item_quantity.confidence))\n unit = item.value.get(\"Unit\")\n \ - \ if unit:\n print(\"......Unit: {} has confidence: {}\"\ - .format(unit.value, unit.confidence))\n unit_price = item.value.get(\"\ - UnitPrice\")\n if unit_price:\n print(\"......Unit Price:\ - \ {} has confidence: {}\".format(unit_price.value, unit_price.confidence))\n \ - \ product_code = item.value.get(\"ProductCode\")\n if product_code:\n\ - \ print(\"......Product Code: {} has confidence: {}\".format(product_code.value,\ - \ product_code.confidence))\n item_date = item.value.get(\"Date\")\n\ - \ if item_date:\n print(\"......Date: {} has confidence:\ - \ {}\".format(item_date.value, item_date.confidence))\n tax = item.value.get(\"\ - Tax\")\n if tax:\n print(\"......Tax: {} has confidence:\ - \ {}\".format(tax.value, tax.confidence))\n amount = item.value.get(\"\ - Amount\")\n if amount:\n print(\"......Amount: {} has\ - \ confidence: {}\".format(amount.value, amount.confidence))\n subtotal =\ - \ invoice.fields.get(\"SubTotal\")\n if subtotal:\n print(\"Subtotal:\ - \ {} has confidence: {}\".format(subtotal.value, subtotal.confidence))\n \ - \ total_tax = invoice.fields.get(\"TotalTax\")\n if total_tax:\n \ - \ print(\"Total Tax: {} has confidence: {}\".format(total_tax.value, total_tax.confidence))\n\ - \ previous_unpaid_balance = invoice.fields.get(\"PreviousUnpaidBalance\"\ - )\n if previous_unpaid_balance:\n print(\"Previous Unpaid Balance:\ - \ {} has confidence: {}\".format(previous_unpaid_balance.value, previous_unpaid_balance.confidence))\n\ - \ amount_due = invoice.fields.get(\"AmountDue\")\n if amount_due:\n\ - \ print(\"Amount Due: {} has confidence: {}\".format(amount_due.value,\ - \ amount_due.confidence))\n service_start_date = invoice.fields.get(\"ServiceStartDate\"\ - )\n if service_start_date:\n print(\"Service Start Date: {} has\ - \ confidence: {}\".format(service_start_date.value, service_start_date.confidence))\n\ - \ service_end_date = invoice.fields.get(\"ServiceEndDate\")\n if service_end_date:\n\ - \ print(\"Service End Date: {} has confidence: {}\".format(service_end_date.value,\ - \ service_end_date.confidence))\n service_address = invoice.fields.get(\"\ - ServiceAddress\")\n if service_address:\n print(\"Service Address:\ - \ {} has confidence: {}\".format(service_address.value, service_address.confidence))\n\ - \ service_address_recipient = invoice.fields.get(\"ServiceAddressRecipient\"\ - )\n if service_address_recipient:\n print(\"Service Address Recipient:\ - \ {} has confidence: {}\".format(service_address_recipient.value, service_address_recipient.confidence))\n\ - \ remittance_address = invoice.fields.get(\"RemittanceAddress\")\n \ - \ if remittance_address:\n print(\"Remittance Address: {} has confidence:\ - \ {}\".format(remittance_address.value, remittance_address.confidence))\n \ - \ remittance_address_recipient = invoice.fields.get(\"RemittanceAddressRecipient\"\ - )\n if remittance_address_recipient:\n print(\"Remittance Address\ - \ Recipient: {} has confidence: {}\".format(remittance_address_recipient.value,\ - \ remittance_address_recipient.confidence))\n\n ````\n" - uid: azure.ai.formrecognizer.FormRecognizerClient.begin_recognize_invoices_from_url name: begin_recognize_invoices_from_url summary: 'Extract field text and semantic values from a given invoice. @@ -1059,49 +764,6 @@ methods: - [[]] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Recognize sales receipt fields.\n\n\n\n````python\n\ - \n from azure.core.credentials import AzureKeyCredential\n from azure.ai.formrecognizer\ - \ import FormRecognizerClient\n\n endpoint = os.environ[\"AZURE_FORM_RECOGNIZER_ENDPOINT\"\ - ]\n key = os.environ[\"AZURE_FORM_RECOGNIZER_KEY\"]\n\n form_recognizer_client\ - \ = FormRecognizerClient(\n endpoint=endpoint, credential=AzureKeyCredential(key)\n\ - \ )\n with open(path_to_sample_forms, \"rb\") as f:\n poller = form_recognizer_client.begin_recognize_receipts(receipt=f,\ - \ locale=\"en-US\")\n receipts = poller.result()\n\n for idx, receipt in enumerate(receipts):\n\ - \ print(\"--------Recognizing receipt #{}--------\".format(idx+1))\n \ - \ receipt_type = receipt.fields.get(\"ReceiptType\")\n if receipt_type:\n\ - \ print(\"Receipt Type: {} has confidence: {}\".format(receipt_type.value,\ - \ receipt_type.confidence))\n merchant_name = receipt.fields.get(\"MerchantName\"\ - )\n if merchant_name:\n print(\"Merchant Name: {} has confidence:\ - \ {}\".format(merchant_name.value, merchant_name.confidence))\n transaction_date\ - \ = receipt.fields.get(\"TransactionDate\")\n if transaction_date:\n \ - \ print(\"Transaction Date: {} has confidence: {}\".format(transaction_date.value,\ - \ transaction_date.confidence))\n if receipt.fields.get(\"Items\"):\n \ - \ print(\"Receipt items:\")\n for idx, item in enumerate(receipt.fields.get(\"\ - Items\").value):\n print(\"...Item #{}\".format(idx+1))\n \ - \ item_name = item.value.get(\"Name\")\n if item_name:\n\ - \ print(\"......Item Name: {} has confidence: {}\".format(item_name.value,\ - \ item_name.confidence))\n item_quantity = item.value.get(\"Quantity\"\ - )\n if item_quantity:\n print(\"......Item Quantity:\ - \ {} has confidence: {}\".format(item_quantity.value, item_quantity.confidence))\n\ - \ item_price = item.value.get(\"Price\")\n if item_price:\n\ - \ print(\"......Individual Item Price: {} has confidence: {}\"\ - .format(item_price.value, item_price.confidence))\n item_total_price\ - \ = item.value.get(\"TotalPrice\")\n if item_total_price:\n \ - \ print(\"......Total Item Price: {} has confidence: {}\".format(item_total_price.value,\ - \ item_total_price.confidence))\n subtotal = receipt.fields.get(\"Subtotal\"\ - )\n if subtotal:\n print(\"Subtotal: {} has confidence: {}\".format(subtotal.value,\ - \ subtotal.confidence))\n tax = receipt.fields.get(\"Tax\")\n if tax:\n\ - \ print(\"Tax: {} has confidence: {}\".format(tax.value, tax.confidence))\n\ - \ tip = receipt.fields.get(\"Tip\")\n if tip:\n print(\"\ - Tip: {} has confidence: {}\".format(tip.value, tip.confidence))\n total\ - \ = receipt.fields.get(\"Total\")\n if total:\n print(\"Total:\ - \ {} has confidence: {}\".format(total.value, total.confidence))\n print(\"\ - --------------------------------------\")\n\n ````\n" - uid: azure.ai.formrecognizer.FormRecognizerClient.begin_recognize_receipts_from_url name: begin_recognize_receipts_from_url summary: 'Extract field text and semantic values from a given sales receipt. @@ -1163,51 +825,6 @@ methods: - [[]] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Recognize sales receipt fields from a URL.\n\n\n\n````python\n\n from azure.core.credentials\ - \ import AzureKeyCredential\n from azure.ai.formrecognizer import FormRecognizerClient\n\ - \n endpoint = os.environ[\"AZURE_FORM_RECOGNIZER_ENDPOINT\"]\n key = os.environ[\"\ - AZURE_FORM_RECOGNIZER_KEY\"]\n\n form_recognizer_client = FormRecognizerClient(\n\ - \ endpoint=endpoint, credential=AzureKeyCredential(key)\n )\n url =\ - \ \"https://raw.githubusercontent.com/Azure/azure-sdk-for-python/main/sdk/formrecognizer/azure-ai-formrecognizer/tests/sample_forms/receipt/contoso-receipt.png\"\ - \n poller = form_recognizer_client.begin_recognize_receipts_from_url(receipt_url=url)\n\ - \ receipts = poller.result()\n\n for idx, receipt in enumerate(receipts):\n\ - \ print(\"--------Recognizing receipt #{}--------\".format(idx+1))\n \ - \ receipt_type = receipt.fields.get(\"ReceiptType\")\n if receipt_type:\n\ - \ print(\"Receipt Type: {} has confidence: {}\".format(receipt_type.value,\ - \ receipt_type.confidence))\n merchant_name = receipt.fields.get(\"MerchantName\"\ - )\n if merchant_name:\n print(\"Merchant Name: {} has confidence:\ - \ {}\".format(merchant_name.value, merchant_name.confidence))\n transaction_date\ - \ = receipt.fields.get(\"TransactionDate\")\n if transaction_date:\n \ - \ print(\"Transaction Date: {} has confidence: {}\".format(transaction_date.value,\ - \ transaction_date.confidence))\n if receipt.fields.get(\"Items\"):\n \ - \ print(\"Receipt items:\")\n for idx, item in enumerate(receipt.fields.get(\"\ - Items\").value):\n print(\"...Item #{}\".format(idx+1))\n \ - \ item_name = item.value.get(\"Name\")\n if item_name:\n\ - \ print(\"......Item Name: {} has confidence: {}\".format(item_name.value,\ - \ item_name.confidence))\n item_quantity = item.value.get(\"Quantity\"\ - )\n if item_quantity:\n print(\"......Item Quantity:\ - \ {} has confidence: {}\".format(item_quantity.value, item_quantity.confidence))\n\ - \ item_price = item.value.get(\"Price\")\n if item_price:\n\ - \ print(\"......Individual Item Price: {} has confidence: {}\"\ - .format(item_price.value, item_price.confidence))\n item_total_price\ - \ = item.value.get(\"TotalPrice\")\n if item_total_price:\n \ - \ print(\"......Total Item Price: {} has confidence: {}\".format(item_total_price.value,\ - \ item_total_price.confidence))\n subtotal = receipt.fields.get(\"Subtotal\"\ - )\n if subtotal:\n print(\"Subtotal: {} has confidence: {}\".format(subtotal.value,\ - \ subtotal.confidence))\n tax = receipt.fields.get(\"Tax\")\n if tax:\n\ - \ print(\"Tax: {} has confidence: {}\".format(tax.value, tax.confidence))\n\ - \ tip = receipt.fields.get(\"Tip\")\n if tip:\n print(\"\ - Tip: {} has confidence: {}\".format(tip.value, tip.confidence))\n total\ - \ = receipt.fields.get(\"Total\")\n if total:\n print(\"Total:\ - \ {} has confidence: {}\".format(total.value, total.confidence))\n print(\"\ - --------------------------------------\")\n\n ````\n" - uid: azure.ai.formrecognizer.FormRecognizerClient.close name: close summary: Close the session. diff --git a/docs-ref-autogen/azure-ai-formrecognizer/azure.ai.formrecognizer.FormTrainingClient.yml b/docs-ref-autogen/azure-ai-formrecognizer/azure.ai.formrecognizer.FormTrainingClient.yml index b8a958a507e5..8b96f6e04fca 100644 --- a/docs-ref-autogen/azure-ai-formrecognizer/azure.ai.formrecognizer.FormTrainingClient.yml +++ b/docs-ref-autogen/azure-ai-formrecognizer/azure.ai.formrecognizer.FormTrainingClient.yml @@ -58,29 +58,6 @@ constructor: types: - - -examples: -- "Creating the FormTrainingClient with an endpoint and API key.\n\n\n\n````python\n\n from azure.core.credentials import\ - \ AzureKeyCredential\n from azure.ai.formrecognizer import FormTrainingClient\n\ - \ endpoint = os.environ[\"AZURE_FORM_RECOGNIZER_ENDPOINT\"]\n key = os.environ[\"\ - AZURE_FORM_RECOGNIZER_KEY\"]\n\n form_training_client = FormTrainingClient(endpoint,\ - \ AzureKeyCredential(key))\n\n ````\n\nCreating the FormTrainingClient with a\ - \ token credential.\n\n\n\n````python\n\n \"\"\"DefaultAzureCredential\ - \ will use the values from these environment\n variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,\ - \ AZURE_CLIENT_SECRET\n \"\"\"\n from azure.ai.formrecognizer import FormTrainingClient\n\ - \ from azure.identity import DefaultAzureCredential\n\n endpoint = os.environ[\"\ - AZURE_FORM_RECOGNIZER_ENDPOINT\"]\n credential = DefaultAzureCredential()\n\n\ - \ form_training_client = FormTrainingClient(endpoint, credential)\n\n ````\n" methods: - uid: azure.ai.formrecognizer.FormTrainingClient.begin_copy_model name: begin_copy_model @@ -122,19 +99,6 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Copy a model from the source resource to the target resource\n\n\n\n````python\n\n source_client = FormTrainingClient(endpoint=source_endpoint,\ - \ credential=AzureKeyCredential(source_key))\n\n poller = source_client.begin_copy_model(\n\ - \ model_id=source_model_id,\n target=target # output from target\ - \ client's call to get_copy_authorization()\n )\n copied_over_model = poller.result()\n\ - \n print(\"Model ID: {}\".format(copied_over_model.model_id))\n print(\"Status:\ - \ {}\".format(copied_over_model.status))\n\n ````\n" - uid: azure.ai.formrecognizer.FormTrainingClient.begin_create_composed_model name: begin_create_composed_model summary: 'Creates a composed model from a collection of existing models that were @@ -175,41 +139,6 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Create a composed model\n\n\n\n````python\n\ - \n from azure.core.credentials import AzureKeyCredential\n from azure.ai.formrecognizer\ - \ import FormTrainingClient\n\n endpoint = os.environ[\"AZURE_FORM_RECOGNIZER_ENDPOINT\"\ - ]\n key = os.environ[\"AZURE_FORM_RECOGNIZER_KEY\"]\n po_supplies = os.environ['PURCHASE_ORDER_OFFICE_SUPPLIES_SAS_URL_V2']\n\ - \ po_equipment = os.environ['PURCHASE_ORDER_OFFICE_EQUIPMENT_SAS_URL_V2']\n\ - \ po_furniture = os.environ['PURCHASE_ORDER_OFFICE_FURNITURE_SAS_URL_V2']\n\ - \ po_cleaning_supplies = os.environ['PURCHASE_ORDER_OFFICE_CLEANING_SUPPLIES_SAS_URL_V2']\n\ - \n form_training_client = FormTrainingClient(endpoint=endpoint, credential=AzureKeyCredential(key))\n\ - \ supplies_poller = form_training_client.begin_training(\n po_supplies,\ - \ use_training_labels=True, model_name=\"Purchase order - Office supplies\"\n\ - \ )\n equipment_poller = form_training_client.begin_training(\n po_equipment,\ - \ use_training_labels=True, model_name=\"Purchase order - Office Equipment\"\n\ - \ )\n furniture_poller = form_training_client.begin_training(\n po_furniture,\ - \ use_training_labels=True, model_name=\"Purchase order - Furniture\"\n )\n\ - \ cleaning_supplies_poller = form_training_client.begin_training(\n po_cleaning_supplies,\ - \ use_training_labels=True, model_name=\"Purchase order - Cleaning Supplies\"\n\ - \ )\n supplies_model = supplies_poller.result()\n equipment_model = equipment_poller.result()\n\ - \ furniture_model = furniture_poller.result()\n cleaning_supplies_model =\ - \ cleaning_supplies_poller.result()\n\n models_trained_with_labels = [\n \ - \ supplies_model.model_id,\n equipment_model.model_id,\n furniture_model.model_id,\n\ - \ cleaning_supplies_model.model_id\n ]\n\n poller = form_training_client.begin_create_composed_model(\n\ - \ models_trained_with_labels, model_name=\"Office Supplies Composed Model\"\ - \n )\n model = poller.result()\n\n print(\"Office Supplies Composed Model\ - \ Info:\")\n print(\"Model ID: {}\".format(model.model_id))\n print(\"Model\ - \ name: {}\".format(model.model_name))\n print(\"Is this a composed model?:\ - \ {}\".format(model.properties.is_composed_model))\n print(\"Status: {}\".format(model.status))\n\ - \ print(\"Composed model creation started on: {}\".format(model.training_started_on))\n\ - \ print(\"Creation completed on: {}\".format(model.training_completed_on))\n\ - \n\n ````\n" - uid: azure.ai.formrecognizer.FormTrainingClient.begin_training name: begin_training summary: 'Create and train a custom model. The request must include a *training_files_url* @@ -295,29 +224,6 @@ methods: "invalid" status is still created. You can delete this model by calling' - type: azure.ai.formrecognizer.FormTrainingClient.delete_model - examples: - - "Training a model (without labels) with your custom forms.\n\n\n\n````python\n\n from azure.ai.formrecognizer\ - \ import FormTrainingClient\n from azure.core.credentials import AzureKeyCredential\n\ - \n endpoint = os.environ[\"AZURE_FORM_RECOGNIZER_ENDPOINT\"]\n key = os.environ[\"\ - AZURE_FORM_RECOGNIZER_KEY\"]\n container_sas_url = os.environ[\"CONTAINER_SAS_URL_V2\"\ - ]\n\n form_training_client = FormTrainingClient(endpoint, AzureKeyCredential(key))\n\ - \ poller = form_training_client.begin_training(container_sas_url, use_training_labels=False)\n\ - \ model = poller.result()\n\n # Custom model information\n print(\"Model\ - \ ID: {}\".format(model.model_id))\n print(\"Status: {}\".format(model.status))\n\ - \ print(\"Model name: {}\".format(model.model_name))\n print(\"Training started\ - \ on: {}\".format(model.training_started_on))\n print(\"Training completed on:\ - \ {}\".format(model.training_completed_on))\n\n print(\"Recognized fields:\"\ - )\n # Looping through the submodels, which contains the fields they were trained\ - \ on\n for submodel in model.submodels:\n print(\"...The submodel has\ - \ form type '{}'\".format(submodel.form_type))\n for name, field in submodel.fields.items():\n\ - \ print(\"...The model found field '{}' to have label '{}'\".format(\n\ - \ name, field.label\n ))\n\n ````\n" - uid: azure.ai.formrecognizer.FormTrainingClient.close name: close summary: Close the session. @@ -340,17 +246,6 @@ methods: exceptions: - type: azure.core.exceptions.HttpResponseError - type: azure.core.exceptions.ResourceNotFoundError - examples: - - "Delete a custom model.\n\n\n\n````python\n\ - \n form_training_client.delete_model(model_id=custom_model.model_id)\n\n try:\n\ - \ form_training_client.get_custom_model(model_id=custom_model.model_id)\n\ - \ except ResourceNotFoundError:\n print(\"Successfully deleted model with\ - \ id {}\".format(custom_model.model_id))\n\n ````\n" - uid: azure.ai.formrecognizer.FormTrainingClient.get_account_properties name: get_account_properties summary: Get information about the models on the form recognizer account. @@ -363,19 +258,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Get properties for the form recognizer account.\n\n\n\n````python\n\n form_training_client = FormTrainingClient(endpoint=endpoint,\ - \ credential=AzureKeyCredential(key))\n # First, we see how many custom models\ - \ we have, and what our limit is\n account_properties = form_training_client.get_account_properties()\n\ - \ print(\"Our account has {} custom models, and we can have at most {} custom\ - \ models\\n\".format(\n account_properties.custom_model_count, account_properties.custom_model_limit\n\ - \ ))\n\n ````\n" - uid: azure.ai.formrecognizer.FormTrainingClient.get_copy_authorization name: get_copy_authorization summary: 'Generate authorization for copying a custom model into the target Form @@ -414,18 +296,6 @@ methods: - [, [, ]] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Authorize the target resource to receive the copied model\n\n\n\n````python\n\n target_client = FormTrainingClient(endpoint=target_endpoint,\ - \ credential=AzureKeyCredential(target_key))\n\n target = target_client.get_copy_authorization(\n\ - \ resource_region=target_region,\n resource_id=target_resource_id\n\ - \ )\n # model ID that target client will use to access the model once copy\ - \ is complete\n print(\"Model ID: {}\".format(target[\"modelId\"]))\n\n ````\n" - uid: azure.ai.formrecognizer.FormTrainingClient.get_custom_model name: get_custom_model summary: 'Get a description of a custom model, including the types of forms @@ -445,20 +315,6 @@ methods: exceptions: - type: azure.core.exceptions.HttpResponseError - type: azure.core.exceptions.ResourceNotFoundError - examples: - - "Get a custom model with a model ID.\n\n\n\n````python\n\ - \n custom_model = form_training_client.get_custom_model(model_id=model.model_id)\n\ - \ print(\"\\nModel ID: {}\".format(custom_model.model_id))\n print(\"Status:\ - \ {}\".format(custom_model.status))\n print(\"Model name: {}\".format(custom_model.model_name))\n\ - \ print(\"Is this a composed model?: {}\".format(custom_model.properties.is_composed_model))\n\ - \ print(\"Training started on: {}\".format(custom_model.training_started_on))\n\ - \ print(\"Training completed on: {}\".format(custom_model.training_completed_on))\n\ - \n ````\n" - uid: azure.ai.formrecognizer.FormTrainingClient.get_form_recognizer_client name: get_form_recognizer_client summary: Get an instance of a FormRecognizerClient from FormTrainingClient. @@ -479,13 +335,3 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "List model information for each model on the account.\n\n\n\n````python\n\n custom_models = form_training_client.list_custom_models()\n\ - \n print(\"We have models with the following IDs:\")\n for model_info in custom_models:\n\ - \ print(model_info.model_id)\n\n ````\n" diff --git a/docs-ref-autogen/azure-ai-formrecognizer/azure.ai.formrecognizer.aio.DocumentAnalysisClient.yml b/docs-ref-autogen/azure-ai-formrecognizer/azure.ai.formrecognizer.aio.DocumentAnalysisClient.yml index ed8d741aa712..4cde5d9e9605 100644 --- a/docs-ref-autogen/azure-ai-formrecognizer/azure.ai.formrecognizer.aio.DocumentAnalysisClient.yml +++ b/docs-ref-autogen/azure-ai-formrecognizer/azure.ai.formrecognizer.aio.DocumentAnalysisClient.yml @@ -66,30 +66,6 @@ constructor: types: - - -examples: -- "Creating the DocumentAnalysisClient with an endpoint and API key.\n\n\n\n````python\n\n from azure.core.credentials\ - \ import AzureKeyCredential\n from azure.ai.formrecognizer.aio import DocumentAnalysisClient\n\ - \n endpoint = os.environ[\"AZURE_FORM_RECOGNIZER_ENDPOINT\"]\n key = os.environ[\"\ - AZURE_FORM_RECOGNIZER_KEY\"]\n\n document_analysis_client = DocumentAnalysisClient(endpoint,\ - \ AzureKeyCredential(key))\n\n ````\n\nCreating the DocumentAnalysisClient with\ - \ a token credential.\n\n\n\n````python\n\n \"\"\"DefaultAzureCredential\ - \ will use the values from these environment\n variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,\ - \ AZURE_CLIENT_SECRET\n \"\"\"\n from azure.ai.formrecognizer.aio import DocumentAnalysisClient\n\ - \ from azure.identity.aio import DefaultAzureCredential\n\n endpoint = os.environ[\"\ - AZURE_FORM_RECOGNIZER_ENDPOINT\"]\n credential = DefaultAzureCredential()\n\n\ - \ document_analysis_client = DocumentAnalysisClient(endpoint, credential)\n\n\ - \ ````\n" methods: - uid: azure.ai.formrecognizer.aio.DocumentAnalysisClient.begin_analyze_document name: begin_analyze_document @@ -137,188 +113,6 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Analyze an invoice. For more samples see the *samples* folder.\n\n\n\n````python\n\n from azure.core.credentials\ - \ import AzureKeyCredential\n from azure.ai.formrecognizer.aio import DocumentAnalysisClient\n\ - \n endpoint = os.environ[\"AZURE_FORM_RECOGNIZER_ENDPOINT\"]\n key = os.environ[\"\ - AZURE_FORM_RECOGNIZER_KEY\"]\n\n document_analysis_client = DocumentAnalysisClient(\n\ - \ endpoint=endpoint, credential=AzureKeyCredential(key)\n )\n async\ - \ with document_analysis_client:\n with open(path_to_sample_documents, \"\ - rb\") as f:\n poller = await document_analysis_client.begin_analyze_document(\n\ - \ \"prebuilt-invoice\", document=f, locale=\"en-US\"\n \ - \ )\n invoices = await poller.result()\n\n for idx, invoice in enumerate(invoices.documents):\n\ - \ print(\"--------Analyzing invoice #{}--------\".format(idx + 1))\n \ - \ vendor_name = invoice.fields.get(\"VendorName\")\n if vendor_name:\n\ - \ print(\n \"Vendor Name: {} has confidence: {}\".format(\n\ - \ vendor_name.value, vendor_name.confidence\n \ - \ )\n )\n vendor_address = invoice.fields.get(\"VendorAddress\"\ - )\n if vendor_address:\n print(\n \"Vendor Address:\ - \ {} has confidence: {}\".format(\n vendor_address.value, vendor_address.confidence\n\ - \ )\n )\n vendor_address_recipient = invoice.fields.get(\"\ - VendorAddressRecipient\")\n if vendor_address_recipient:\n print(\n\ - \ \"Vendor Address Recipient: {} has confidence: {}\".format(\n\ - \ vendor_address_recipient.value,\n vendor_address_recipient.confidence,\n\ - \ )\n )\n customer_name = invoice.fields.get(\"\ - CustomerName\")\n if customer_name:\n print(\n \"\ - Customer Name: {} has confidence: {}\".format(\n customer_name.value,\ - \ customer_name.confidence\n )\n )\n customer_id\ - \ = invoice.fields.get(\"CustomerId\")\n if customer_id:\n print(\n\ - \ \"Customer Id: {} has confidence: {}\".format(\n \ - \ customer_id.value, customer_id.confidence\n )\n \ - \ )\n customer_address = invoice.fields.get(\"CustomerAddress\")\n \ - \ if customer_address:\n print(\n \"Customer Address:\ - \ {} has confidence: {}\".format(\n customer_address.value,\ - \ customer_address.confidence\n )\n )\n customer_address_recipient\ - \ = invoice.fields.get(\"CustomerAddressRecipient\")\n if customer_address_recipient:\n\ - \ print(\n \"Customer Address Recipient: {} has confidence:\ - \ {}\".format(\n customer_address_recipient.value,\n \ - \ customer_address_recipient.confidence,\n )\n \ - \ )\n invoice_id = invoice.fields.get(\"InvoiceId\")\n if invoice_id:\n\ - \ print(\n \"Invoice Id: {} has confidence: {}\".format(\n\ - \ invoice_id.value, invoice_id.confidence\n )\n\ - \ )\n invoice_date = invoice.fields.get(\"InvoiceDate\")\n \ - \ if invoice_date:\n print(\n \"Invoice Date: {} has\ - \ confidence: {}\".format(\n invoice_date.value, invoice_date.confidence\n\ - \ )\n )\n invoice_total = invoice.fields.get(\"\ - InvoiceTotal\")\n if invoice_total:\n print(\n \"\ - Invoice Total: {} has confidence: {}\".format(\n invoice_total.value,\ - \ invoice_total.confidence\n )\n )\n due_date =\ - \ invoice.fields.get(\"DueDate\")\n if due_date:\n print(\n \ - \ \"Due Date: {} has confidence: {}\".format(\n \ - \ due_date.value, due_date.confidence\n )\n )\n \ - \ purchase_order = invoice.fields.get(\"PurchaseOrder\")\n if purchase_order:\n\ - \ print(\n \"Purchase Order: {} has confidence: {}\".format(\n\ - \ purchase_order.value, purchase_order.confidence\n \ - \ )\n )\n billing_address = invoice.fields.get(\"BillingAddress\"\ - )\n if billing_address:\n print(\n \"Billing Address:\ - \ {} has confidence: {}\".format(\n billing_address.value, billing_address.confidence\n\ - \ )\n )\n billing_address_recipient = invoice.fields.get(\"\ - BillingAddressRecipient\")\n if billing_address_recipient:\n print(\n\ - \ \"Billing Address Recipient: {} has confidence: {}\".format(\n\ - \ billing_address_recipient.value,\n billing_address_recipient.confidence,\n\ - \ )\n )\n shipping_address = invoice.fields.get(\"\ - ShippingAddress\")\n if shipping_address:\n print(\n \ - \ \"Shipping Address: {} has confidence: {}\".format(\n \ - \ shipping_address.value, shipping_address.confidence\n )\n \ - \ )\n shipping_address_recipient = invoice.fields.get(\"ShippingAddressRecipient\"\ - )\n if shipping_address_recipient:\n print(\n \"\ - Shipping Address Recipient: {} has confidence: {}\".format(\n \ - \ shipping_address_recipient.value,\n shipping_address_recipient.confidence,\n\ - \ )\n )\n print(\"Invoice items:\")\n for\ - \ idx, item in enumerate(invoice.fields.get(\"Items\").value):\n print(\"\ - ...Item #{}\".format(idx + 1))\n item_description = item.value.get(\"\ - Description\")\n if item_description:\n print(\n \ - \ \"......Description: {} has confidence: {}\".format(\n \ - \ item_description.value, item_description.confidence\n \ - \ )\n )\n item_quantity = item.value.get(\"\ - Quantity\")\n if item_quantity:\n print(\n \ - \ \"......Quantity: {} has confidence: {}\".format(\n \ - \ item_quantity.value, item_quantity.confidence\n )\n \ - \ )\n unit = item.value.get(\"Unit\")\n if unit:\n\ - \ print(\n \"......Unit: {} has confidence: {}\"\ - .format(\n unit.value, unit.confidence\n \ - \ )\n )\n unit_price = item.value.get(\"UnitPrice\"\ - )\n if unit_price:\n print(\n \"......Unit\ - \ Price: {} has confidence: {}\".format(\n unit_price.value,\ - \ unit_price.confidence\n )\n )\n product_code\ - \ = item.value.get(\"ProductCode\")\n if product_code:\n \ - \ print(\n \"......Product Code: {} has confidence: {}\"\ - .format(\n product_code.value, product_code.confidence\n\ - \ )\n )\n item_date = item.value.get(\"\ - Date\")\n if item_date:\n print(\n \"\ - ......Date: {} has confidence: {}\".format(\n item_date.value,\ - \ item_date.confidence\n )\n )\n tax\ - \ = item.value.get(\"Tax\")\n if tax:\n print(\n \ - \ \"......Tax: {} has confidence: {}\".format(tax.value, tax.confidence)\n\ - \ )\n amount = item.value.get(\"Amount\")\n \ - \ if amount:\n print(\n \"......Amount: {} has\ - \ confidence: {}\".format(\n amount.value, amount.confidence\n\ - \ )\n )\n subtotal = invoice.fields.get(\"\ - SubTotal\")\n if subtotal:\n print(\n \"Subtotal:\ - \ {} has confidence: {}\".format(\n subtotal.value, subtotal.confidence\n\ - \ )\n )\n total_tax = invoice.fields.get(\"TotalTax\"\ - )\n if total_tax:\n print(\n \"Total Tax: {} has\ - \ confidence: {}\".format(\n total_tax.value, total_tax.confidence\n\ - \ )\n )\n previous_unpaid_balance = invoice.fields.get(\"\ - PreviousUnpaidBalance\")\n if previous_unpaid_balance:\n print(\n\ - \ \"Previous Unpaid Balance: {} has confidence: {}\".format(\n \ - \ previous_unpaid_balance.value,\n previous_unpaid_balance.confidence,\n\ - \ )\n )\n amount_due = invoice.fields.get(\"AmountDue\"\ - )\n if amount_due:\n print(\n \"Amount Due: {} has\ - \ confidence: {}\".format(\n amount_due.value, amount_due.confidence\n\ - \ )\n )\n service_start_date = invoice.fields.get(\"\ - ServiceStartDate\")\n if service_start_date:\n print(\n \ - \ \"Service Start Date: {} has confidence: {}\".format(\n \ - \ service_start_date.value, service_start_date.confidence\n \ - \ )\n )\n service_end_date = invoice.fields.get(\"ServiceEndDate\"\ - )\n if service_end_date:\n print(\n \"Service End\ - \ Date: {} has confidence: {}\".format(\n service_end_date.value,\ - \ service_end_date.confidence\n )\n )\n service_address\ - \ = invoice.fields.get(\"ServiceAddress\")\n if service_address:\n \ - \ print(\n \"Service Address: {} has confidence: {}\".format(\n\ - \ service_address.value, service_address.confidence\n \ - \ )\n )\n service_address_recipient = invoice.fields.get(\"\ - ServiceAddressRecipient\")\n if service_address_recipient:\n print(\n\ - \ \"Service Address Recipient: {} has confidence: {}\".format(\n\ - \ service_address_recipient.value,\n service_address_recipient.confidence,\n\ - \ )\n )\n remittance_address = invoice.fields.get(\"\ - RemittanceAddress\")\n if remittance_address:\n print(\n \ - \ \"Remittance Address: {} has confidence: {}\".format(\n \ - \ remittance_address.value, remittance_address.confidence\n \ - \ )\n )\n remittance_address_recipient = invoice.fields.get(\"\ - RemittanceAddressRecipient\")\n if remittance_address_recipient:\n \ - \ print(\n \"Remittance Address Recipient: {} has confidence:\ - \ {}\".format(\n remittance_address_recipient.value,\n \ - \ remittance_address_recipient.confidence,\n )\n \ - \ )\n\n ````\n\nAnalyze a custom document. For more samples see the\ - \ *samples* folder.\n\n\n\n````python\n\n from azure.core.credentials\ - \ import AzureKeyCredential\n from azure.ai.formrecognizer.aio import DocumentAnalysisClient\n\ - \n endpoint = os.environ[\"AZURE_FORM_RECOGNIZER_ENDPOINT\"]\n key = os.environ[\"\ - AZURE_FORM_RECOGNIZER_KEY\"]\n model_id = os.getenv(\"CUSTOM_BUILT_MODEL_ID\"\ - , custom_model_id)\n\n document_analysis_client = DocumentAnalysisClient(\n\ - \ endpoint=endpoint, credential=AzureKeyCredential(key)\n )\n\n async\ - \ with document_analysis_client:\n # Make sure your document's type is included\ - \ in the list of document types the custom model can analyze\n with open(path_to_sample_documents,\ - \ \"rb\") as f:\n poller = await document_analysis_client.begin_analyze_document(\n\ - \ model_id=model_id, document=f\n )\n result = await\ - \ poller.result()\n\n for idx, document in enumerate(result.documents):\n \ - \ print(\"--------Analyzing document #{}--------\".format(idx + 1))\n \ - \ print(\"Document has type {}\".format(document.doc_type))\n print(\"\ - Document has document type confidence {}\".format(document.confidence))\n \ - \ print(\"Document was analyzed with model with ID {}\".format(result.model_id))\n\ - \ for name, field in document.fields.items():\n field_value =\ - \ field.value if field.value else field.content\n print(\"......found\ - \ field of type '{}' with value '{}' and with confidence {}\".format(field.value_type,\ - \ field_value, field.confidence))\n\n # iterate over tables, lines, and selection\ - \ marks on each page\n for page in result.pages:\n print(\"\\nLines found\ - \ on page {}\".format(page.page_number))\n for line in page.lines:\n \ - \ print(\"...Line '{}'\".format(line.content))\n for word in page.words:\n\ - \ print(\n \"...Word '{}' has a confidence of {}\".format(\n\ - \ word.content, word.confidence\n )\n \ - \ )\n if page.selection_marks:\n print(\"\\nSelection marks\ - \ found on page {}\".format(page.page_number))\n for selection_mark\ - \ in page.selection_marks:\n print(\n \"...Selection\ - \ mark is '{}' and has a confidence of {}\".format(\n selection_mark.state,\ - \ selection_mark.confidence\n )\n )\n\n for\ - \ i, table in enumerate(result.tables):\n print(\"\\nTable {} can be found\ - \ on page:\".format(i + 1))\n for region in table.bounding_regions:\n \ - \ print(\"...{}\".format(region.page_number))\n for cell in table.cells:\n\ - \ print(\n \"...Cell[{}][{}] has text '{}'\".format(\n\ - \ cell.row_index, cell.column_index, cell.content\n \ - \ )\n )\n print(\"-----------------------------------\")\n\n\ - \ ````\n" - uid: azure.ai.formrecognizer.aio.DocumentAnalysisClient.begin_analyze_document_from_url name: begin_analyze_document_from_url summary: 'Analyze field text and semantic values from a given document. @@ -371,59 +165,6 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Analyze a receipt. For more samples see the *samples* folder.\n\n\n\n````python\n\ - \n from azure.core.credentials import AzureKeyCredential\n from azure.ai.formrecognizer.aio\ - \ import DocumentAnalysisClient\n\n endpoint = os.environ[\"AZURE_FORM_RECOGNIZER_ENDPOINT\"\ - ]\n key = os.environ[\"AZURE_FORM_RECOGNIZER_KEY\"]\n\n document_analysis_client\ - \ = DocumentAnalysisClient(\n endpoint=endpoint, credential=AzureKeyCredential(key)\n\ - \ )\n async with document_analysis_client:\n url = \"https://raw.githubusercontent.com/Azure/azure-sdk-for-python/main/sdk/formrecognizer/azure-ai-formrecognizer/tests/sample_forms/receipt/contoso-receipt.png\"\ - \n poller = await document_analysis_client.begin_analyze_document_from_url(\n\ - \ \"prebuilt-receipt\", document_url=url\n )\n receipts\ - \ = await poller.result()\n\n for idx, receipt in enumerate(receipts.documents):\n\ - \ print(\"--------Analysis of receipt #{}--------\".format(idx + 1))\n \ - \ print(\"Receipt type: {}\".format(receipt.doc_type or \"N/A\"))\n \ - \ merchant_name = receipt.fields.get(\"MerchantName\")\n if merchant_name:\n\ - \ print(\n \"Merchant Name: {} has confidence: {}\".format(\n\ - \ merchant_name.value, merchant_name.confidence\n \ - \ )\n )\n transaction_date = receipt.fields.get(\"TransactionDate\"\ - )\n if transaction_date:\n print(\n \"Transaction\ - \ Date: {} has confidence: {}\".format(\n transaction_date.value,\ - \ transaction_date.confidence\n )\n )\n if receipt.fields.get(\"\ - Items\"):\n print(\"Receipt items:\")\n for idx, item in enumerate(receipt.fields.get(\"\ - Items\").value):\n print(\"...Item #{}\".format(idx + 1))\n \ - \ item_description = item.value.get(\"Description\")\n \ - \ if item_description:\n print(\n \"\ - ......Item Description: {} has confidence: {}\".format(\n \ - \ item_description.value, item_description.confidence\n \ - \ )\n )\n item_quantity = item.value.get(\"\ - Quantity\")\n if item_quantity:\n print(\n \ - \ \"......Item Quantity: {} has confidence: {}\".format(\n\ - \ item_quantity.value, item_quantity.confidence\n \ - \ )\n )\n item_price = item.value.get(\"\ - Price\")\n if item_price:\n print(\n \ - \ \"......Individual Item Price: {} has confidence: {}\".format(\n\ - \ item_price.value, item_price.confidence\n \ - \ )\n )\n item_total_price = item.value.get(\"\ - TotalPrice\")\n if item_total_price:\n print(\n\ - \ \"......Total Item Price: {} has confidence: {}\".format(\n\ - \ item_total_price.value, item_total_price.confidence\n\ - \ )\n )\n subtotal = receipt.fields.get(\"\ - Subtotal\")\n if subtotal:\n print(\n \"Subtotal:\ - \ {} has confidence: {}\".format(\n subtotal.value, subtotal.confidence\n\ - \ )\n )\n tax = receipt.fields.get(\"TotalTax\"\ - )\n if tax:\n print(\"Total tax: {} has confidence: {}\".format(tax.value,\ - \ tax.confidence))\n tip = receipt.fields.get(\"Tip\")\n if tip:\n\ - \ print(\"Tip: {} has confidence: {}\".format(tip.value, tip.confidence))\n\ - \ total = receipt.fields.get(\"Total\")\n if total:\n print(\"\ - Total: {} has confidence: {}\".format(total.value, total.confidence))\n \ - \ print(\"--------------------------------------\")\n\n ````\n" - uid: azure.ai.formrecognizer.aio.DocumentAnalysisClient.close name: close summary: Close the session. diff --git a/docs-ref-autogen/azure-ai-formrecognizer/azure.ai.formrecognizer.aio.DocumentModelAdministrationClient.yml b/docs-ref-autogen/azure-ai-formrecognizer/azure.ai.formrecognizer.aio.DocumentModelAdministrationClient.yml index af83b173555e..6f21d9d5d644 100644 --- a/docs-ref-autogen/azure-ai-formrecognizer/azure.ai.formrecognizer.aio.DocumentModelAdministrationClient.yml +++ b/docs-ref-autogen/azure-ai-formrecognizer/azure.ai.formrecognizer.aio.DocumentModelAdministrationClient.yml @@ -65,30 +65,6 @@ constructor: types: - - -examples: -- "Creating the DocumentModelAdministrationClient with an endpoint and API key.\n\n\n\n````python\n\n from azure.core.credentials\ - \ import AzureKeyCredential\n from azure.ai.formrecognizer.aio import DocumentModelAdministrationClient\n\ - \n endpoint = os.environ[\"AZURE_FORM_RECOGNIZER_ENDPOINT\"]\n key = os.environ[\"\ - AZURE_FORM_RECOGNIZER_KEY\"]\n\n document_model_admin_client = DocumentModelAdministrationClient(endpoint,\ - \ AzureKeyCredential(key))\n\n ````\n\nCreating the DocumentModelAdministrationClient\ - \ with a token credential.\n\n\n\n````python\n\n \"\"\"DefaultAzureCredential\ - \ will use the values from these environment\n variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,\ - \ AZURE_CLIENT_SECRET\n \"\"\"\n from azure.ai.formrecognizer.aio import DocumentModelAdministrationClient\n\ - \ from azure.identity.aio import DefaultAzureCredential\n\n endpoint = os.environ[\"\ - AZURE_FORM_RECOGNIZER_ENDPOINT\"]\n credential = DefaultAzureCredential()\n\n\ - \ document_model_admin_client = DocumentModelAdministrationClient(endpoint, credential)\n\ - \n ````\n" methods: - uid: azure.ai.formrecognizer.aio.DocumentModelAdministrationClient.begin_build_document_model name: begin_build_document_model @@ -169,31 +145,6 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Building a model from training files.\n\n\n\n````python\n\n from azure.ai.formrecognizer.aio\ - \ import DocumentModelAdministrationClient\n from azure.ai.formrecognizer import\ - \ ModelBuildMode\n from azure.core.credentials import AzureKeyCredential\n\n\ - \ endpoint = os.environ[\"AZURE_FORM_RECOGNIZER_ENDPOINT\"]\n key = os.environ[\"\ - AZURE_FORM_RECOGNIZER_KEY\"]\n container_sas_url = os.environ[\"CONTAINER_SAS_URL\"\ - ]\n\n document_model_admin_client = DocumentModelAdministrationClient(endpoint,\ - \ AzureKeyCredential(key))\n async with document_model_admin_client:\n \ - \ poller = await document_model_admin_client.begin_build_document_model(\n \ - \ ModelBuildMode.TEMPLATE, blob_container_url=container_sas_url, description=\"\ - my model description\"\n )\n model = await poller.result()\n\n print(\"\ - Model ID: {}\".format(model.model_id))\n print(\"Description: {}\".format(model.description))\n\ - \ print(\"Model created on: {}\\n\".format(model.created_on))\n print(\"Doc\ - \ types the model can recognize:\")\n for name, doc_type in model.doc_types.items():\n\ - \ print(\"\\nDoc Type: '{}' built with '{}' mode which has the following\ - \ fields:\".format(name, doc_type.build_mode))\n for field_name, field in\ - \ doc_type.field_schema.items():\n print(\"Field: '{}' has type '{}'\ - \ and confidence score {}\".format(\n field_name, field[\"type\"\ - ], doc_type.field_confidence[field_name]\n ))\n\n ````\n" - uid: azure.ai.formrecognizer.aio.DocumentModelAdministrationClient.begin_compose_document_model name: begin_compose_document_model summary: 'Creates a composed document model from a collection of existing models. @@ -238,47 +189,6 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Creating a composed model with existing models.\n\n\n\n````python\n\n from azure.core.credentials\ - \ import AzureKeyCredential\n from azure.ai.formrecognizer.aio import DocumentModelAdministrationClient\n\ - \ from azure.ai.formrecognizer import ModelBuildMode\n\n endpoint = os.environ[\"\ - AZURE_FORM_RECOGNIZER_ENDPOINT\"]\n key = os.environ[\"AZURE_FORM_RECOGNIZER_KEY\"\ - ]\n po_supplies = os.environ['PURCHASE_ORDER_OFFICE_SUPPLIES_SAS_URL']\n po_equipment\ - \ = os.environ['PURCHASE_ORDER_OFFICE_EQUIPMENT_SAS_URL']\n po_furniture = os.environ['PURCHASE_ORDER_OFFICE_FURNITURE_SAS_URL']\n\ - \ po_cleaning_supplies = os.environ['PURCHASE_ORDER_OFFICE_CLEANING_SUPPLIES_SAS_URL']\n\ - \n document_model_admin_client = DocumentModelAdministrationClient(endpoint=endpoint,\ - \ credential=AzureKeyCredential(key))\n async with document_model_admin_client:\n\ - \ supplies_poller = await document_model_admin_client.begin_build_document_model(\n\ - \ ModelBuildMode.TEMPLATE, blob_container_url=po_supplies, description=\"\ - Purchase order-Office supplies\"\n )\n equipment_poller = await document_model_admin_client.begin_build_document_model(\n\ - \ ModelBuildMode.TEMPLATE, blob_container_url=po_equipment, description=\"\ - Purchase order-Office Equipment\"\n )\n furniture_poller = await document_model_admin_client.begin_build_document_model(\n\ - \ ModelBuildMode.TEMPLATE, blob_container_url=po_furniture, description=\"\ - Purchase order-Furniture\"\n )\n cleaning_supplies_poller = await\ - \ document_model_admin_client.begin_build_document_model(\n ModelBuildMode.TEMPLATE,\ - \ blob_container_url=po_cleaning_supplies, description=\"Purchase order-Cleaning\ - \ Supplies\"\n )\n supplies_model = await supplies_poller.result()\n\ - \ equipment_model = await equipment_poller.result()\n furniture_model\ - \ = await furniture_poller.result()\n cleaning_supplies_model = await cleaning_supplies_poller.result()\n\ - \n purchase_order_models = [\n supplies_model.model_id,\n \ - \ equipment_model.model_id,\n furniture_model.model_id,\n \ - \ cleaning_supplies_model.model_id\n ]\n\n poller = await document_model_admin_client.begin_compose_document_model(\n\ - \ purchase_order_models, description=\"Office Supplies Composed Model\"\ - \n )\n model = await poller.result()\n\n print(\"Office Supplies\ - \ Composed Model Info:\")\n print(\"Model ID: {}\".format(model.model_id))\n\ - \ print(\"Description: {}\".format(model.description))\n print(\"Model created\ - \ on: {}\\n\".format(model.created_on))\n print(\"Doc types the model can recognize:\"\ - )\n for name, doc_type in model.doc_types.items():\n print(\"\\nDoc Type:\ - \ '{}' which has the following fields:\".format(name))\n for field_name,\ - \ field in doc_type.field_schema.items():\n print(\"Field: '{}' has\ - \ type '{}' and confidence score {}\".format(\n field_name, field[\"\ - type\"], doc_type.field_confidence[field_name]\n ))\n\n ````\n" - uid: azure.ai.formrecognizer.aio.DocumentModelAdministrationClient.begin_copy_document_model_to name: begin_copy_document_model_to summary: 'Copy a document model stored in this resource (the source) to the user @@ -319,36 +229,6 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Copy a model from the source resource to the target resource\n\n\n\n````python\n\n from azure.core.credentials\ - \ import AzureKeyCredential\n from azure.ai.formrecognizer.aio import DocumentModelAdministrationClient\n\ - \n source_endpoint = os.environ[\"AZURE_FORM_RECOGNIZER_SOURCE_ENDPOINT\"]\n\ - \ source_key = os.environ[\"AZURE_FORM_RECOGNIZER_SOURCE_KEY\"]\n target_endpoint\ - \ = os.environ[\"AZURE_FORM_RECOGNIZER_TARGET_ENDPOINT\"]\n target_key = os.environ[\"\ - AZURE_FORM_RECOGNIZER_TARGET_KEY\"]\n source_model_id = os.getenv(\"AZURE_SOURCE_MODEL_ID\"\ - , custom_model_id)\n\n target_client = DocumentModelAdministrationClient(endpoint=target_endpoint,\ - \ credential=AzureKeyCredential(target_key))\n async with target_client:\n \ - \ target = await target_client.get_copy_authorization(\n description=\"\ - model copied from other resource\"\n )\n\n source_client = DocumentModelAdministrationClient(endpoint=source_endpoint,\ - \ credential=AzureKeyCredential(source_key))\n async with source_client:\n \ - \ poller = await source_client.begin_copy_document_model_to(\n \ - \ model_id=source_model_id,\n target=target # output from target client's\ - \ call to get_copy_authorization()\n )\n copied_over_model = await\ - \ poller.result()\n\n print(\"Model ID: {}\".format(copied_over_model.model_id))\n\ - \ print(\"Description: {}\".format(copied_over_model.description))\n print(\"\ - Model created on: {}\\n\".format(copied_over_model.created_on))\n print(\"Doc\ - \ types the model can recognize:\")\n for name, doc_type in copied_over_model.doc_types.items():\n\ - \ print(\"\\nDoc Type: '{}' which has the following fields:\".format(name))\n\ - \ for field_name, field in doc_type.field_schema.items():\n print(\"\ - Field: '{}' has type '{}' and confidence score {}\".format(\n field_name,\ - \ field[\"type\"], doc_type.field_confidence[field_name]\n ))\n\n \ - \ ````\n" - uid: azure.ai.formrecognizer.aio.DocumentModelAdministrationClient.close name: close summary: Close the @@ -370,17 +250,6 @@ methods: exceptions: - type: azure.core.exceptions.HttpResponseError - type: azure.core.exceptions.ResourceNotFoundError - examples: - - "Delete a model.\n\n\n\n````python\n\n await document_model_admin_client.delete_document_model(model_id=my_model.model_id)\n\ - \n try:\n await document_model_admin_client.get_document_model(model_id=my_model.model_id)\n\ - \ except ResourceNotFoundError:\n print(\"Successfully deleted model with\ - \ ID {}\".format(my_model.model_id))\n\n ````\n" - uid: azure.ai.formrecognizer.aio.DocumentModelAdministrationClient.get_copy_authorization name: get_copy_authorization summary: 'Generate authorization for copying a custom model into the target Form @@ -438,17 +307,6 @@ methods: exceptions: - type: azure.core.exceptions.HttpResponseError - type: azure.core.exceptions.ResourceNotFoundError - examples: - - "Get a model by its ID.\n\n\n\n````python\n\n my_model = await document_model_admin_client.get_document_model(model_id=model.model_id)\n\ - \ print(\"\\nModel ID: {}\".format(my_model.model_id))\n print(\"Description:\ - \ {}\".format(my_model.description))\n print(\"Model created on: {}\".format(my_model.created_on))\n\ - \n ````\n" - uid: azure.ai.formrecognizer.aio.DocumentModelAdministrationClient.get_operation name: get_operation summary: 'Get an operation by its ID. @@ -475,26 +333,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Get a document model operation by its ID.\n\n\n\n````python\n\n # Get an operation\ - \ by ID\n try:\n first_operation = await operations.__anext__()\n\n \ - \ print(\"\\nGetting operation info by ID: {}\".format(first_operation.operation_id))\n\ - \ operation_info = await document_model_admin_client.get_operation(first_operation.operation_id)\n\ - \ if operation_info.status == \"succeeded\":\n print(\"My {} operation\ - \ is completed.\".format(operation_info.kind))\n result = operation_info.result\n\ - \ if result is not None:\n print(\"Model ID: {}\".format(result.model_id))\n\ - \ elif operation_info.status == \"failed\":\n print(\"My {} operation\ - \ failed.\".format(operation_info.kind))\n error = operation_info.error\n\ - \ if error is not None:\n print(\"{}: {}\".format(error.code,\ - \ error.message))\n else:\n print(\"My operation status is {}\"\ - .format(operation_info.status))\n except StopAsyncIteration:\n print(\"\ - No operations found.\")\n\n ````\n" - uid: azure.ai.formrecognizer.aio.DocumentModelAdministrationClient.get_resource_details name: get_resource_details summary: Get information about the models under the Form Recognizer resource. @@ -505,19 +343,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Get model counts and limits under the Form Recognizer resource.\n\n\n\n````python\n\n document_model_admin_client\ - \ = DocumentModelAdministrationClient(endpoint=endpoint, credential=AzureKeyCredential(key))\n\ - \n async with document_model_admin_client:\n account_details = await document_model_admin_client.get_resource_details()\n\ - \ print(\"Our resource has {} custom models, and we can have at most {}\ - \ custom models\\n\".format(\n account_details.custom_document_models.count,\ - \ account_details.custom_document_models.limit\n ))\n\n ````\n" - uid: azure.ai.formrecognizer.aio.DocumentModelAdministrationClient.list_document_models name: list_document_models summary: 'List information for each model, including its model ID, @@ -530,17 +355,6 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "List all models that were built successfully under the Form Recognizer resource.\n\n\n\n````python\n\n models = document_model_admin_client.list_document_models()\n\ - \n print(\"We have the following 'ready' models with IDs and descriptions:\"\ - )\n async for model in models:\n print(\"{} | {}\".format(model.model_id,\ - \ model.description))\n\n ````\n" - uid: azure.ai.formrecognizer.aio.DocumentModelAdministrationClient.list_operations name: list_operations summary: 'List information for each operation. @@ -561,25 +375,3 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "List all document model operations in the past 24 hours.\n\n\n\n````python\n\n from azure.core.credentials\ - \ import AzureKeyCredential\n from azure.ai.formrecognizer.aio import DocumentModelAdministrationClient\n\ - \n endpoint = os.environ[\"AZURE_FORM_RECOGNIZER_ENDPOINT\"]\n key = os.environ[\"\ - AZURE_FORM_RECOGNIZER_KEY\"]\n\n document_model_admin_client = DocumentModelAdministrationClient(endpoint=endpoint,\ - \ credential=AzureKeyCredential(key))\n\n async with document_model_admin_client:\n\ - \ operations = document_model_admin_client.list_operations()\n\n print(\"\ - The following document model operations exist under my resource:\")\n async\ - \ for operation in operations:\n print(\"\\nOperation ID: {}\".format(operation.operation_id))\n\ - \ print(\"Operation kind: {}\".format(operation.kind))\n print(\"\ - Operation status: {}\".format(operation.status))\n print(\"Operation\ - \ percent completed: {}\".format(operation.percent_completed))\n print(\"\ - Operation created on: {}\".format(operation.created_on))\n print(\"\ - Operation last updated on: {}\".format(operation.last_updated_on))\n \ - \ print(\"Resource location of successful operation: {}\".format(operation.resource_location))\n\ - \n ````\n" diff --git a/docs-ref-autogen/azure-ai-formrecognizer/azure.ai.formrecognizer.aio.FormRecognizerClient.yml b/docs-ref-autogen/azure-ai-formrecognizer/azure.ai.formrecognizer.aio.FormRecognizerClient.yml index c50488da0861..7a7362a85928 100644 --- a/docs-ref-autogen/azure-ai-formrecognizer/azure.ai.formrecognizer.aio.FormRecognizerClient.yml +++ b/docs-ref-autogen/azure-ai-formrecognizer/azure.ai.formrecognizer.aio.FormRecognizerClient.yml @@ -61,29 +61,6 @@ constructor: types: - - -examples: -- "Creating the FormRecognizerClient with an endpoint and API key.\n\n\n\n````python\n\n from azure.core.credentials\ - \ import AzureKeyCredential\n from azure.ai.formrecognizer.aio import FormRecognizerClient\n\ - \ endpoint = os.environ[\"AZURE_FORM_RECOGNIZER_ENDPOINT\"]\n key = os.environ[\"\ - AZURE_FORM_RECOGNIZER_KEY\"]\n\n form_recognizer_client = FormRecognizerClient(endpoint,\ - \ AzureKeyCredential(key))\n\n ````\n\nCreating the FormRecognizerClient with\ - \ a token credential.\n\n\n\n````python\n\n \"\"\"DefaultAzureCredential\ - \ will use the values from these environment\n variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,\ - \ AZURE_CLIENT_SECRET\n \"\"\"\n from azure.ai.formrecognizer.aio import FormRecognizerClient\n\ - \ from azure.identity.aio import DefaultAzureCredential\n\n endpoint = os.environ[\"\ - AZURE_FORM_RECOGNIZER_ENDPOINT\"]\n credential = DefaultAzureCredential()\n\n\ - \ form_recognizer_client = FormRecognizerClient(endpoint, credential)\n\n ````\n" methods: - uid: azure.ai.formrecognizer.aio.FormRecognizerClient.begin_recognize_business_cards name: begin_recognize_business_cards @@ -154,59 +131,6 @@ methods: - [[]] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Recognize business cards from a file.\n\n\n\n````python\n\ - \n from azure.core.credentials import AzureKeyCredential\n from azure.ai.formrecognizer.aio\ - \ import FormRecognizerClient\n\n endpoint = os.environ[\"AZURE_FORM_RECOGNIZER_ENDPOINT\"\ - ]\n key = os.environ[\"AZURE_FORM_RECOGNIZER_KEY\"]\n\n form_recognizer_client\ - \ = FormRecognizerClient(\n endpoint=endpoint, credential=AzureKeyCredential(key)\n\ - \ )\n async with form_recognizer_client:\n with open(path_to_sample_forms,\ - \ \"rb\") as f:\n poller = await form_recognizer_client.begin_recognize_business_cards(business_card=f,\ - \ locale=\"en-US\")\n business_cards = await poller.result()\n\n for idx,\ - \ business_card in enumerate(business_cards):\n print(\"--------Recognizing\ - \ business card #{}--------\".format(idx+1))\n contact_names = business_card.fields.get(\"\ - ContactNames\")\n if contact_names:\n for contact_name in contact_names.value:\n\ - \ print(\"Contact First Name: {} has confidence: {}\".format(\n\ - \ contact_name.value[\"FirstName\"].value, contact_name.value[\"\ - FirstName\"].confidence\n ))\n print(\"Contact Last\ - \ Name: {} has confidence: {}\".format(\n contact_name.value[\"\ - LastName\"].value, contact_name.value[\"LastName\"].confidence\n \ - \ ))\n company_names = business_card.fields.get(\"CompanyNames\")\n \ - \ if company_names:\n for company_name in company_names.value:\n\ - \ print(\"Company Name: {} has confidence: {}\".format(company_name.value,\ - \ company_name.confidence))\n departments = business_card.fields.get(\"\ - Departments\")\n if departments:\n for department in departments.value:\n\ - \ print(\"Department: {} has confidence: {}\".format(department.value,\ - \ department.confidence))\n job_titles = business_card.fields.get(\"JobTitles\"\ - )\n if job_titles:\n for job_title in job_titles.value:\n \ - \ print(\"Job Title: {} has confidence: {}\".format(job_title.value,\ - \ job_title.confidence))\n emails = business_card.fields.get(\"Emails\"\ - )\n if emails:\n for email in emails.value:\n print(\"\ - Email: {} has confidence: {}\".format(email.value, email.confidence))\n \ - \ websites = business_card.fields.get(\"Websites\")\n if websites:\n \ - \ for website in websites.value:\n print(\"Website: {} has\ - \ confidence: {}\".format(website.value, website.confidence))\n addresses\ - \ = business_card.fields.get(\"Addresses\")\n if addresses:\n \ - \ for address in addresses.value:\n print(\"Address: {} has confidence:\ - \ {}\".format(address.value, address.confidence))\n mobile_phones = business_card.fields.get(\"\ - MobilePhones\")\n if mobile_phones:\n for phone in mobile_phones.value:\n\ - \ print(\"Mobile phone number: {} has confidence: {}\".format(phone.value,\ - \ phone.confidence))\n faxes = business_card.fields.get(\"Faxes\")\n \ - \ if faxes:\n for fax in faxes.value:\n print(\"Fax\ - \ number: {} has confidence: {}\".format(fax.value, fax.confidence))\n work_phones\ - \ = business_card.fields.get(\"WorkPhones\")\n if work_phones:\n \ - \ for work_phone in work_phones.value:\n print(\"Work phone number:\ - \ {} has confidence: {}\".format(work_phone.value, work_phone.confidence))\n \ - \ other_phones = business_card.fields.get(\"OtherPhones\")\n if other_phones:\n\ - \ for other_phone in other_phones.value:\n print(\"Other\ - \ phone number: {} has confidence: {}\".format(other_phone.value, other_phone.confidence))\n\ - \n ````\n" - uid: azure.ai.formrecognizer.aio.FormRecognizerClient.begin_recognize_business_cards_from_url name: begin_recognize_business_cards_from_url summary: 'Extract field text and semantic values from a given business card. @@ -346,46 +270,6 @@ methods: - [[]] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Recognize text and content/layout information from a form.\n\n\n\n````python\n\n from azure.core.credentials\ - \ import AzureKeyCredential\n from azure.ai.formrecognizer.aio import FormRecognizerClient\n\ - \n endpoint = os.environ[\"AZURE_FORM_RECOGNIZER_ENDPOINT\"]\n key = os.environ[\"\ - AZURE_FORM_RECOGNIZER_KEY\"]\n\n async with FormRecognizerClient(\n endpoint=endpoint,\ - \ credential=AzureKeyCredential(key)\n ) as form_recognizer_client:\n\n \ - \ with open(path_to_sample_forms, \"rb\") as f:\n poller = await form_recognizer_client.begin_recognize_content(form=f)\n\ - \n form_pages = await poller.result()\n\n for idx, content in enumerate(form_pages):\n\ - \ print(\"----Recognizing content from page #{}----\".format(idx+1))\n\ - \ print(\"Page has width: {} and height: {}, measured with unit: {}\"\ - .format(\n content.width,\n content.height,\n \ - \ content.unit\n ))\n for table_idx, table in enumerate(content.tables):\n\ - \ print(\"Table # {} has {} rows and {} columns\".format(table_idx,\ - \ table.row_count, table.column_count))\n print(\"Table # {} location\ - \ on page: {}\".format(table_idx, format_bounding_box(table.bounding_box)))\n\ - \ for cell in table.cells:\n print(\"...Cell[{}][{}]\ - \ has text '{}' within bounding box '{}'\".format(\n cell.row_index,\n\ - \ cell.column_index,\n cell.text,\n\ - \ format_bounding_box(cell.bounding_box)\n \ - \ ))\n\n for line_idx, line in enumerate(content.lines):\n \ - \ print(\"Line # {} has word count '{}' and text '{}' within bounding\ - \ box '{}'\".format(\n line_idx,\n len(line.words),\n\ - \ line.text,\n format_bounding_box(line.bounding_box)\n\ - \ ))\n if line.appearance:\n if\ - \ line.appearance.style_name == \"handwriting\" and line.appearance.style_confidence\ - \ > 0.8:\n print(\"Text line '{}' is handwritten and might\ - \ be a signature.\".format(line.text))\n for word in line.words:\n\ - \ print(\"...Word '{}' has a confidence of {}\".format(word.text,\ - \ word.confidence))\n\n for selection_mark in content.selection_marks:\n\ - \ print(\"Selection mark is '{}' within bounding box '{}' and has\ - \ a confidence of {}\".format(\n selection_mark.state,\n \ - \ format_bounding_box(selection_mark.bounding_box),\n \ - \ selection_mark.confidence\n ))\n print(\"----------------------------------------\"\ - )\n\n\n ````\n" - uid: azure.ai.formrecognizer.aio.FormRecognizerClient.begin_recognize_content_from_url name: begin_recognize_content_from_url summary: 'Extract text and layout information from a given document. @@ -519,56 +403,6 @@ methods: - [[]] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Recognize fields and values from a custom form.\n\n\n\n````python\n\ - \n from azure.core.credentials import AzureKeyCredential\n from azure.ai.formrecognizer.aio\ - \ import FormRecognizerClient\n\n endpoint = os.environ[\"AZURE_FORM_RECOGNIZER_ENDPOINT\"\ - ]\n key = os.environ[\"AZURE_FORM_RECOGNIZER_KEY\"]\n model_id = os.getenv(\"\ - CUSTOM_TRAINED_MODEL_ID\", custom_model_id)\n\n async with FormRecognizerClient(\n\ - \ endpoint=endpoint, credential=AzureKeyCredential(key)\n ) as form_recognizer_client:\n\ - \n # Make sure your form's type is included in the list of form types the\ - \ custom model can recognize\n with open(path_to_sample_forms, \"rb\") as\ - \ f:\n poller = await form_recognizer_client.begin_recognize_custom_forms(\n\ - \ model_id=model_id, form=f, include_field_elements=True\n \ - \ )\n forms = await poller.result()\n\n for idx, form in enumerate(forms):\n\ - \ print(\"--------Recognizing Form #{}--------\".format(idx+1))\n \ - \ print(\"Form has type {}\".format(form.form_type))\n print(\"\ - Form has form type confidence {}\".format(form.form_type_confidence))\n \ - \ print(\"Form was analyzed with model with ID {}\".format(form.model_id))\n\ - \ for name, field in form.fields.items():\n # each field\ - \ is of type FormField\n # label_data is populated if you are using\ - \ a model trained without labels,\n # since the service needs to\ - \ make predictions for labels if not explicitly given to it.\n if\ - \ field.label_data:\n print(\"...Field '{}' has label '{}' with\ - \ a confidence score of {}\".format(\n name,\n \ - \ field.label_data.text,\n field.confidence\n\ - \ ))\n\n print(\"...Label '{}' has value '{}'\ - \ with a confidence score of {}\".format(\n field.label_data.text\ - \ if field.label_data else name, field.value, field.confidence\n \ - \ ))\n\n # iterate over tables, lines, and selection marks on each\ - \ page\n for page in form.pages:\n for i, table in enumerate(page.tables):\n\ - \ print(\"\\nTable {} on page {}\".format(i + 1, table.page_number))\n\ - \ for cell in table.cells:\n print(\"\ - ...Cell[{}][{}] has text '{}' with confidence {}\".format(\n \ - \ cell.row_index, cell.column_index, cell.text, cell.confidence\n \ - \ ))\n print(\"\\nLines found on page {}\".format(page.page_number))\n\ - \ for line in page.lines:\n print(\"...Line '{}'\ - \ is made up of the following words: \".format(line.text))\n \ - \ for word in line.words:\n print(\"......Word '{}' has\ - \ a confidence of {}\".format(\n word.text,\n \ - \ word.confidence\n ))\n \ - \ if page.selection_marks:\n print(\"\\nSelection marks found\ - \ on page {}\".format(page.page_number))\n for selection_mark\ - \ in page.selection_marks:\n print(\"......Selection mark\ - \ is '{}' and has a confidence of {}\".format(\n selection_mark.state,\n\ - \ selection_mark.confidence\n \ - \ ))\n\n print(\"-----------------------------------\")\n\n ````\n" - uid: azure.ai.formrecognizer.aio.FormRecognizerClient.begin_recognize_custom_forms_from_url name: begin_recognize_custom_forms_from_url summary: 'Analyze a custom form with a model trained with or without labels. The @@ -685,44 +519,6 @@ methods: - [[]] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Recognize identity documents from a file.\n\n\n\n````python\n\ - \n from azure.core.credentials import AzureKeyCredential\n from azure.ai.formrecognizer.aio\ - \ import FormRecognizerClient\n\n endpoint = os.environ[\"AZURE_FORM_RECOGNIZER_ENDPOINT\"\ - ]\n key = os.environ[\"AZURE_FORM_RECOGNIZER_KEY\"]\n\n async with FormRecognizerClient(\n\ - \ endpoint=endpoint, credential=AzureKeyCredential(key)\n ) as form_recognizer_client:\n\ - \ \n with open(path_to_sample_forms, \"rb\") as f:\n poller\ - \ = await form_recognizer_client.begin_recognize_identity_documents(identity_document=f)\n\ - \ \n id_documents = await poller.result()\n\n for idx, id_document\ - \ in enumerate(id_documents):\n print(\"--------Recognizing ID document\ - \ #{}--------\".format(idx+1))\n first_name = id_document.fields.get(\"\ - FirstName\")\n if first_name:\n print(\"First Name: {}\ - \ has confidence: {}\".format(first_name.value, first_name.confidence))\n \ - \ last_name = id_document.fields.get(\"LastName\")\n if last_name:\n\ - \ print(\"Last Name: {} has confidence: {}\".format(last_name.value,\ - \ last_name.confidence))\n document_number = id_document.fields.get(\"\ - DocumentNumber\")\n if document_number:\n print(\"Document\ - \ Number: {} has confidence: {}\".format(document_number.value, document_number.confidence))\n\ - \ dob = id_document.fields.get(\"DateOfBirth\")\n if dob:\n\ - \ print(\"Date of Birth: {} has confidence: {}\".format(dob.value,\ - \ dob.confidence))\n doe = id_document.fields.get(\"DateOfExpiration\"\ - )\n if doe:\n print(\"Date of Expiration: {} has confidence:\ - \ {}\".format(doe.value, doe.confidence))\n sex = id_document.fields.get(\"\ - Sex\")\n if sex:\n print(\"Sex: {} has confidence: {}\"\ - .format(sex.value, sex.confidence))\n address = id_document.fields.get(\"\ - Address\")\n if address:\n print(\"Address: {} has confidence:\ - \ {}\".format(address.value, address.confidence))\n country_region =\ - \ id_document.fields.get(\"CountryRegion\")\n if country_region:\n \ - \ print(\"Country/Region: {} has confidence: {}\".format(country_region.value,\ - \ country_region.confidence))\n region = id_document.fields.get(\"Region\"\ - )\n if region:\n print(\"Region: {} has confidence: {}\"\ - .format(region.value, region.confidence))\n\n ````\n" - uid: azure.ai.formrecognizer.aio.FormRecognizerClient.begin_recognize_identity_documents_from_url name: begin_recognize_identity_documents_from_url summary: 'Extract field text and semantic values from a given identity document. @@ -843,115 +639,6 @@ methods: - [[]] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Recognize invoices from a file.\n\n\n\n````python\n\n from azure.core.credentials\ - \ import AzureKeyCredential\n from azure.ai.formrecognizer.aio import FormRecognizerClient\n\ - \n endpoint = os.environ[\"AZURE_FORM_RECOGNIZER_ENDPOINT\"]\n key = os.environ[\"\ - AZURE_FORM_RECOGNIZER_KEY\"]\n\n async with FormRecognizerClient(\n endpoint=endpoint,\ - \ credential=AzureKeyCredential(key)\n ) as form_recognizer_client:\n \ - \ with open(path_to_sample_forms, \"rb\") as f:\n poller = await form_recognizer_client.begin_recognize_invoices(invoice=f,\ - \ locale=\"en-US\")\n invoices = await poller.result()\n\n for idx,\ - \ invoice in enumerate(invoices):\n print(\"--------Recognizing invoice\ - \ #{}--------\".format(idx+1))\n vendor_name = invoice.fields.get(\"\ - VendorName\")\n if vendor_name:\n print(\"Vendor Name:\ - \ {} has confidence: {}\".format(vendor_name.value, vendor_name.confidence))\n\ - \ vendor_address = invoice.fields.get(\"VendorAddress\")\n \ - \ if vendor_address:\n print(\"Vendor Address: {} has confidence:\ - \ {}\".format(vendor_address.value, vendor_address.confidence))\n vendor_address_recipient\ - \ = invoice.fields.get(\"VendorAddressRecipient\")\n if vendor_address_recipient:\n\ - \ print(\"Vendor Address Recipient: {} has confidence: {}\".format(vendor_address_recipient.value,\ - \ vendor_address_recipient.confidence))\n customer_name = invoice.fields.get(\"\ - CustomerName\")\n if customer_name:\n print(\"Customer\ - \ Name: {} has confidence: {}\".format(customer_name.value, customer_name.confidence))\n\ - \ customer_id = invoice.fields.get(\"CustomerId\")\n if customer_id:\n\ - \ print(\"Customer Id: {} has confidence: {}\".format(customer_id.value,\ - \ customer_id.confidence))\n customer_address = invoice.fields.get(\"\ - CustomerAddress\")\n if customer_address:\n print(\"Customer\ - \ Address: {} has confidence: {}\".format(customer_address.value, customer_address.confidence))\n\ - \ customer_address_recipient = invoice.fields.get(\"CustomerAddressRecipient\"\ - )\n if customer_address_recipient:\n print(\"Customer\ - \ Address Recipient: {} has confidence: {}\".format(customer_address_recipient.value,\ - \ customer_address_recipient.confidence))\n invoice_id = invoice.fields.get(\"\ - InvoiceId\")\n if invoice_id:\n print(\"Invoice Id: {}\ - \ has confidence: {}\".format(invoice_id.value, invoice_id.confidence))\n \ - \ invoice_date = invoice.fields.get(\"InvoiceDate\")\n if invoice_date:\n\ - \ print(\"Invoice Date: {} has confidence: {}\".format(invoice_date.value,\ - \ invoice_date.confidence))\n invoice_total = invoice.fields.get(\"\ - InvoiceTotal\")\n if invoice_total:\n print(\"Invoice\ - \ Total: {} has confidence: {}\".format(invoice_total.value, invoice_total.confidence))\n\ - \ due_date = invoice.fields.get(\"DueDate\")\n if due_date:\n\ - \ print(\"Due Date: {} has confidence: {}\".format(due_date.value,\ - \ due_date.confidence))\n purchase_order = invoice.fields.get(\"PurchaseOrder\"\ - )\n if purchase_order:\n print(\"Purchase Order: {} has\ - \ confidence: {}\".format(purchase_order.value, purchase_order.confidence))\n\ - \ billing_address = invoice.fields.get(\"BillingAddress\")\n \ - \ if billing_address:\n print(\"Billing Address: {} has confidence:\ - \ {}\".format(billing_address.value, billing_address.confidence))\n \ - \ billing_address_recipient = invoice.fields.get(\"BillingAddressRecipient\")\n\ - \ if billing_address_recipient:\n print(\"Billing Address\ - \ Recipient: {} has confidence: {}\".format(billing_address_recipient.value, billing_address_recipient.confidence))\n\ - \ shipping_address = invoice.fields.get(\"ShippingAddress\")\n \ - \ if shipping_address:\n print(\"Shipping Address: {} has confidence:\ - \ {}\".format(shipping_address.value, shipping_address.confidence))\n \ - \ shipping_address_recipient = invoice.fields.get(\"ShippingAddressRecipient\"\ - )\n if shipping_address_recipient:\n print(\"Shipping\ - \ Address Recipient: {} has confidence: {}\".format(shipping_address_recipient.value,\ - \ shipping_address_recipient.confidence))\n print(\"Invoice items:\"\ - )\n for idx, item in enumerate(invoice.fields.get(\"Items\").value):\n\ - \ print(\"...Item #{}\".format(idx+1))\n item_description\ - \ = item.value.get(\"Description\")\n if item_description:\n \ - \ print(\"......Description: {} has confidence: {}\".format(item_description.value,\ - \ item_description.confidence))\n item_quantity = item.value.get(\"\ - Quantity\")\n if item_quantity:\n print(\"......Quantity:\ - \ {} has confidence: {}\".format(item_quantity.value, item_quantity.confidence))\n\ - \ unit = item.value.get(\"Unit\")\n if unit:\n \ - \ print(\"......Unit: {} has confidence: {}\".format(unit.value,\ - \ unit.confidence))\n unit_price = item.value.get(\"UnitPrice\"\ - )\n if unit_price:\n print(\"......Unit Price:\ - \ {} has confidence: {}\".format(unit_price.value, unit_price.confidence))\n \ - \ product_code = item.value.get(\"ProductCode\")\n \ - \ if product_code:\n print(\"......Product Code: {} has confidence:\ - \ {}\".format(product_code.value, product_code.confidence))\n item_date\ - \ = item.value.get(\"Date\")\n if item_date:\n \ - \ print(\"......Date: {} has confidence: {}\".format(item_date.value, item_date.confidence))\n\ - \ tax = item.value.get(\"Tax\")\n if tax:\n \ - \ print(\"......Tax: {} has confidence: {}\".format(tax.value, tax.confidence))\n\ - \ amount = item.value.get(\"Amount\")\n if amount:\n\ - \ print(\"......Amount: {} has confidence: {}\".format(amount.value,\ - \ amount.confidence))\n subtotal = invoice.fields.get(\"SubTotal\")\n\ - \ if subtotal:\n print(\"Subtotal: {} has confidence:\ - \ {}\".format(subtotal.value, subtotal.confidence))\n total_tax = invoice.fields.get(\"\ - TotalTax\")\n if total_tax:\n print(\"Total Tax: {} has\ - \ confidence: {}\".format(total_tax.value, total_tax.confidence))\n \ - \ previous_unpaid_balance = invoice.fields.get(\"PreviousUnpaidBalance\")\n \ - \ if previous_unpaid_balance:\n print(\"Previous Unpaid\ - \ Balance: {} has confidence: {}\".format(previous_unpaid_balance.value, previous_unpaid_balance.confidence))\n\ - \ amount_due = invoice.fields.get(\"AmountDue\")\n if amount_due:\n\ - \ print(\"Amount Due: {} has confidence: {}\".format(amount_due.value,\ - \ amount_due.confidence))\n service_start_date = invoice.fields.get(\"\ - ServiceStartDate\")\n if service_start_date:\n print(\"\ - Service Start Date: {} has confidence: {}\".format(service_start_date.value, service_start_date.confidence))\n\ - \ service_end_date = invoice.fields.get(\"ServiceEndDate\")\n \ - \ if service_end_date:\n print(\"Service End Date: {} has confidence:\ - \ {}\".format(service_end_date.value, service_end_date.confidence))\n \ - \ service_address = invoice.fields.get(\"ServiceAddress\")\n if service_address:\n\ - \ print(\"Service Address: {} has confidence: {}\".format(service_address.value,\ - \ service_address.confidence))\n service_address_recipient = invoice.fields.get(\"\ - ServiceAddressRecipient\")\n if service_address_recipient:\n \ - \ print(\"Service Address Recipient: {} has confidence: {}\".format(service_address_recipient.value,\ - \ service_address_recipient.confidence))\n remittance_address = invoice.fields.get(\"\ - RemittanceAddress\")\n if remittance_address:\n print(\"\ - Remittance Address: {} has confidence: {}\".format(remittance_address.value, remittance_address.confidence))\n\ - \ remittance_address_recipient = invoice.fields.get(\"RemittanceAddressRecipient\"\ - )\n if remittance_address_recipient:\n print(\"Remittance\ - \ Address Recipient: {} has confidence: {}\".format(remittance_address_recipient.value,\ - \ remittance_address_recipient.confidence))\n\n ````\n" - uid: azure.ai.formrecognizer.aio.FormRecognizerClient.begin_recognize_invoices_from_url name: begin_recognize_invoices_from_url summary: 'Extract field text and semantic values from a given invoice. @@ -1078,53 +765,6 @@ methods: - [[]] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Recognize sales receipt fields.\n\n\n\n````python\n\n from azure.core.credentials\ - \ import AzureKeyCredential\n from azure.ai.formrecognizer.aio import FormRecognizerClient\n\ - \n endpoint = os.environ[\"AZURE_FORM_RECOGNIZER_ENDPOINT\"]\n key = os.environ[\"\ - AZURE_FORM_RECOGNIZER_KEY\"]\n\n async with FormRecognizerClient(\n endpoint=endpoint,\ - \ credential=AzureKeyCredential(key)\n ) as form_recognizer_client:\n\n \ - \ with open(path_to_sample_forms, \"rb\") as f:\n poller = await form_recognizer_client.begin_recognize_receipts(receipt=f,\ - \ locale=\"en-US\")\n\n receipts = await poller.result()\n\n for idx,\ - \ receipt in enumerate(receipts):\n print(\"--------Recognizing receipt\ - \ #{}--------\".format(idx+1))\n receipt_type = receipt.fields.get(\"\ - ReceiptType\")\n if receipt_type:\n print(\"Receipt Type:\ - \ {} has confidence: {}\".format(receipt_type.value, receipt_type.confidence))\n\ - \ merchant_name = receipt.fields.get(\"MerchantName\")\n if\ - \ merchant_name:\n print(\"Merchant Name: {} has confidence: {}\"\ - .format(merchant_name.value, merchant_name.confidence))\n transaction_date\ - \ = receipt.fields.get(\"TransactionDate\")\n if transaction_date:\n\ - \ print(\"Transaction Date: {} has confidence: {}\".format(transaction_date.value,\ - \ transaction_date.confidence))\n if receipt.fields.get(\"Items\"):\n\ - \ print(\"Receipt items:\")\n for idx, item in enumerate(receipt.fields.get(\"\ - Items\").value):\n print(\"...Item #{}\".format(idx+1))\n \ - \ item_name = item.value.get(\"Name\")\n if\ - \ item_name:\n print(\"......Item Name: {} has confidence:\ - \ {}\".format(item_name.value, item_name.confidence))\n item_quantity\ - \ = item.value.get(\"Quantity\")\n if item_quantity:\n \ - \ print(\"......Item Quantity: {} has confidence: {}\".format(item_quantity.value,\ - \ item_quantity.confidence))\n item_price = item.value.get(\"\ - Price\")\n if item_price:\n print(\"......Individual\ - \ Item Price: {} has confidence: {}\".format(item_price.value, item_price.confidence))\n\ - \ item_total_price = item.value.get(\"TotalPrice\")\n \ - \ if item_total_price:\n print(\"......Total\ - \ Item Price: {} has confidence: {}\".format(item_total_price.value, item_total_price.confidence))\n\ - \ subtotal = receipt.fields.get(\"Subtotal\")\n if subtotal:\n\ - \ print(\"Subtotal: {} has confidence: {}\".format(subtotal.value,\ - \ subtotal.confidence))\n tax = receipt.fields.get(\"Tax\")\n \ - \ if tax:\n print(\"Tax: {} has confidence: {}\".format(tax.value,\ - \ tax.confidence))\n tip = receipt.fields.get(\"Tip\")\n if\ - \ tip:\n print(\"Tip: {} has confidence: {}\".format(tip.value,\ - \ tip.confidence))\n total = receipt.fields.get(\"Total\")\n \ - \ if total:\n print(\"Total: {} has confidence: {}\".format(total.value,\ - \ total.confidence))\n print(\"--------------------------------------\"\ - )\n\n ````\n" - uid: azure.ai.formrecognizer.aio.FormRecognizerClient.begin_recognize_receipts_from_url name: begin_recognize_receipts_from_url summary: 'Extract field text and semantic values from a given sales receipt. @@ -1185,54 +825,6 @@ methods: - [[]] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Recognize sales receipt fields from a URL.\n\n\n\n````python\n\ - \n from azure.core.credentials import AzureKeyCredential\n from azure.ai.formrecognizer.aio\ - \ import FormRecognizerClient\n\n endpoint = os.environ[\"AZURE_FORM_RECOGNIZER_ENDPOINT\"\ - ]\n key = os.environ[\"AZURE_FORM_RECOGNIZER_KEY\"]\n\n async with FormRecognizerClient(\n\ - \ endpoint=endpoint, credential=AzureKeyCredential(key)\n ) as form_recognizer_client:\n\ - \ url = \"https://raw.githubusercontent.com/Azure/azure-sdk-for-python/main/sdk/formrecognizer/azure-ai-formrecognizer/tests/sample_forms/receipt/contoso-receipt.png\"\ - \n poller = await form_recognizer_client.begin_recognize_receipts_from_url(receipt_url=url)\n\ - \ receipts = await poller.result()\n\n for idx, receipt in enumerate(receipts):\n\ - \ print(\"--------Recognizing receipt #{}--------\".format(idx+1))\n\ - \ receipt_type = receipt.fields.get(\"ReceiptType\")\n if\ - \ receipt_type:\n print(\"Receipt Type: {} has confidence: {}\"\ - .format(receipt_type.value, receipt_type.confidence))\n merchant_name\ - \ = receipt.fields.get(\"MerchantName\")\n if merchant_name:\n \ - \ print(\"Merchant Name: {} has confidence: {}\".format(merchant_name.value,\ - \ merchant_name.confidence))\n transaction_date = receipt.fields.get(\"\ - TransactionDate\")\n if transaction_date:\n print(\"Transaction\ - \ Date: {} has confidence: {}\".format(transaction_date.value, transaction_date.confidence))\n\ - \ if receipt.fields.get(\"Items\"):\n print(\"Receipt\ - \ items:\")\n for idx, item in enumerate(receipt.fields.get(\"Items\"\ - ).value):\n print(\"...Item #{}\".format(idx+1))\n \ - \ item_name = item.value.get(\"Name\")\n if item_name:\n\ - \ print(\"......Item Name: {} has confidence: {}\".format(item_name.value,\ - \ item_name.confidence))\n item_quantity = item.value.get(\"\ - Quantity\")\n if item_quantity:\n print(\"\ - ......Item Quantity: {} has confidence: {}\".format(item_quantity.value, item_quantity.confidence))\n\ - \ item_price = item.value.get(\"Price\")\n \ - \ if item_price:\n print(\"......Individual Item Price:\ - \ {} has confidence: {}\".format(item_price.value, item_price.confidence))\n \ - \ item_total_price = item.value.get(\"TotalPrice\")\n \ - \ if item_total_price:\n print(\"......Total\ - \ Item Price: {} has confidence: {}\".format(item_total_price.value, item_total_price.confidence))\n\ - \ subtotal = receipt.fields.get(\"Subtotal\")\n if subtotal:\n\ - \ print(\"Subtotal: {} has confidence: {}\".format(subtotal.value,\ - \ subtotal.confidence))\n tax = receipt.fields.get(\"Tax\")\n \ - \ if tax:\n print(\"Tax: {} has confidence: {}\".format(tax.value,\ - \ tax.confidence))\n tip = receipt.fields.get(\"Tip\")\n if\ - \ tip:\n print(\"Tip: {} has confidence: {}\".format(tip.value,\ - \ tip.confidence))\n total = receipt.fields.get(\"Total\")\n \ - \ if total:\n print(\"Total: {} has confidence: {}\".format(total.value,\ - \ total.confidence))\n print(\"--------------------------------------\"\ - )\n\n ````\n" - uid: azure.ai.formrecognizer.aio.FormRecognizerClient.close name: close summary: Close the session. diff --git a/docs-ref-autogen/azure-ai-formrecognizer/azure.ai.formrecognizer.aio.FormTrainingClient.yml b/docs-ref-autogen/azure-ai-formrecognizer/azure.ai.formrecognizer.aio.FormTrainingClient.yml index 1b00b172ce25..3b012a9a29df 100644 --- a/docs-ref-autogen/azure-ai-formrecognizer/azure.ai.formrecognizer.aio.FormTrainingClient.yml +++ b/docs-ref-autogen/azure-ai-formrecognizer/azure.ai.formrecognizer.aio.FormTrainingClient.yml @@ -58,29 +58,6 @@ constructor: types: - - -examples: -- "Creating the FormTrainingClient with an endpoint and API key.\n\n\n\n````python\n\n from azure.core.credentials\ - \ import AzureKeyCredential\n from azure.ai.formrecognizer.aio import FormTrainingClient\n\ - \ endpoint = os.environ[\"AZURE_FORM_RECOGNIZER_ENDPOINT\"]\n key = os.environ[\"\ - AZURE_FORM_RECOGNIZER_KEY\"]\n\n form_training_client = FormTrainingClient(endpoint,\ - \ AzureKeyCredential(key))\n\n ````\n\nCreating the FormTrainingClient with a\ - \ token credential.\n\n\n\n````python\n\n \"\"\"DefaultAzureCredential\ - \ will use the values from these environment\n variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,\ - \ AZURE_CLIENT_SECRET\n \"\"\"\n from azure.ai.formrecognizer.aio import FormTrainingClient\n\ - \ from azure.identity.aio import DefaultAzureCredential\n\n endpoint = os.environ[\"\ - AZURE_FORM_RECOGNIZER_ENDPOINT\"]\n credential = DefaultAzureCredential()\n\n\ - \ form_training_client = FormTrainingClient(endpoint, credential)\n\n ````\n" methods: - uid: azure.ai.formrecognizer.aio.FormTrainingClient.begin_copy_model name: begin_copy_model @@ -122,20 +99,6 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Copy a model from the source resource to the target resource\n\n\n\n````python\n\n source_client\ - \ = FormTrainingClient(endpoint=source_endpoint, credential=AzureKeyCredential(source_key))\n\ - \n async with source_client:\n poller = await source_client.begin_copy_model(\n\ - \ model_id=source_model_id,\n target=target # output from\ - \ target client's call to get_copy_authorization()\n )\n copied_over_model\ - \ = await poller.result()\n\n print(\"Model ID: {}\".format(copied_over_model.model_id))\n\ - \ print(\"Status: {}\".format(copied_over_model.status))\n\n ````\n" - uid: azure.ai.formrecognizer.aio.FormTrainingClient.begin_create_composed_model name: begin_create_composed_model summary: 'Creates a composed model from a collection of existing models that were @@ -176,43 +139,6 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Create a composed model\n\n\n\n````python\n\n from azure.core.credentials import AzureKeyCredential\n\ - \ from azure.ai.formrecognizer.aio import FormTrainingClient\n\n endpoint\ - \ = os.environ[\"AZURE_FORM_RECOGNIZER_ENDPOINT\"]\n key = os.environ[\"AZURE_FORM_RECOGNIZER_KEY\"\ - ]\n po_supplies = os.environ['PURCHASE_ORDER_OFFICE_SUPPLIES_SAS_URL_V2']\n\ - \ po_equipment = os.environ['PURCHASE_ORDER_OFFICE_EQUIPMENT_SAS_URL_V2']\n\ - \ po_furniture = os.environ['PURCHASE_ORDER_OFFICE_FURNITURE_SAS_URL_V2']\n\ - \ po_cleaning_supplies = os.environ['PURCHASE_ORDER_OFFICE_CLEANING_SUPPLIES_SAS_URL_V2']\n\ - \n form_training_client = FormTrainingClient(endpoint=endpoint, credential=AzureKeyCredential(key))\n\ - \ async with form_training_client:\n supplies_poller = await form_training_client.begin_training(\n\ - \ po_supplies, use_training_labels=True, model_name=\"Purchase order\ - \ - Office supplies\"\n )\n equipment_poller = await form_training_client.begin_training(\n\ - \ po_equipment, use_training_labels=True, model_name=\"Purchase order\ - \ - Office Equipment\"\n )\n furniture_poller = await form_training_client.begin_training(\n\ - \ po_furniture, use_training_labels=True, model_name=\"Purchase order\ - \ - Furniture\"\n )\n cleaning_supplies_poller = await form_training_client.begin_training(\n\ - \ po_cleaning_supplies, use_training_labels=True, model_name=\"Purchase\ - \ order - Cleaning Supplies\"\n )\n supplies_model = await supplies_poller.result()\n\ - \ equipment_model = await equipment_poller.result()\n furniture_model\ - \ = await furniture_poller.result()\n cleaning_supplies_model = await cleaning_supplies_poller.result()\n\ - \n models_trained_with_labels = [\n supplies_model.model_id,\n\ - \ equipment_model.model_id,\n furniture_model.model_id,\n\ - \ cleaning_supplies_model.model_id\n ]\n\n poller = await\ - \ form_training_client.begin_create_composed_model(\n models_trained_with_labels,\ - \ model_name=\"Office Supplies Composed Model\"\n )\n model = await\ - \ poller.result()\n\n print(\"Office Supplies Composed Model Info:\")\n print(\"\ - Model ID: {}\".format(model.model_id))\n print(\"Model name: {}\".format(model.model_name))\n\ - \ print(\"Is this a composed model?: {}\".format(model.properties.is_composed_model))\n\ - \ print(\"Status: {}\".format(model.status))\n print(\"Composed model creation\ - \ started on: {}\".format(model.training_started_on))\n print(\"Creation completed\ - \ on: {}\".format(model.training_completed_on))\n\n\n ````\n" - uid: azure.ai.formrecognizer.aio.FormTrainingClient.begin_training name: begin_training summary: 'Create and train a custom model. The request must include a *training_files_url* @@ -298,31 +224,6 @@ methods: "invalid" status is still created. You can delete this model by calling' - type: azure.ai.formrecognizer.aio.FormTrainingClient.delete_model - examples: - - "Training a model (without labels) with your custom forms.\n\n\n\n````python\n\ - \n from azure.ai.formrecognizer.aio import FormTrainingClient\n from azure.core.credentials\ - \ import AzureKeyCredential\n\n endpoint = os.environ[\"AZURE_FORM_RECOGNIZER_ENDPOINT\"\ - ]\n key = os.environ[\"AZURE_FORM_RECOGNIZER_KEY\"]\n container_sas_url =\ - \ os.environ[\"CONTAINER_SAS_URL_V2\"]\n\n async with FormTrainingClient(\n\ - \ endpoint, AzureKeyCredential(key)\n ) as form_training_client:\n\n \ - \ poller = await form_training_client.begin_training(container_sas_url, use_training_labels=False)\n\ - \ model = await poller.result()\n\n # Custom model information\n \ - \ print(\"Model ID: {}\".format(model.model_id))\n print(\"Status:\ - \ {}\".format(model.status))\n print(\"Model name: {}\".format(model.model_name))\n\ - \ print(\"Training started on: {}\".format(model.training_started_on))\n\ - \ print(\"Training completed on: {}\".format(model.training_completed_on))\n\ - \n print(\"Recognized fields:\")\n # Looping through the submodels,\ - \ which contains the fields they were trained on\n for submodel in model.submodels:\n\ - \ print(\"...The submodel has form type '{}'\".format(submodel.form_type))\n\ - \ for name, field in submodel.fields.items():\n print(\"\ - ...The model found field '{}' to have label '{}'\".format(\n \ - \ name, field.label\n ))\n\n ````\n" - uid: azure.ai.formrecognizer.aio.FormTrainingClient.close name: close summary: Close the session. @@ -345,17 +246,6 @@ methods: exceptions: - type: azure.core.exceptions.HttpResponseError - type: azure.core.exceptions.ResourceNotFoundError - examples: - - "Delete a custom model.\n\n\n\n````python\n\n await form_training_client.delete_model(model_id=custom_model.model_id)\n\ - \n try:\n await form_training_client.get_custom_model(model_id=custom_model.model_id)\n\ - \ except ResourceNotFoundError:\n print(\"Successfully deleted model with\ - \ id {}\".format(custom_model.model_id))\n\n ````\n" - uid: azure.ai.formrecognizer.aio.FormTrainingClient.get_account_properties name: get_account_properties summary: Get information about the models on the form recognizer account. @@ -368,20 +258,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Get properties for the form recognizer account.\n\n\n\n````python\n\ - \n async with FormTrainingClient(\n endpoint=endpoint, credential=AzureKeyCredential(key)\n\ - \ ) as form_training_client:\n # First, we see how many custom models\ - \ we have, and what our limit is\n account_properties = await form_training_client.get_account_properties()\n\ - \ print(\"Our account has {} custom models, and we can have at most {} custom\ - \ models\\n\".format(\n account_properties.custom_model_count, account_properties.custom_model_limit\n\ - \ ))\n\n ````\n" - uid: azure.ai.formrecognizer.aio.FormTrainingClient.get_copy_authorization name: get_copy_authorization summary: 'Generate authorization for copying a custom model into the target Form @@ -420,20 +296,6 @@ methods: - [, [, ]] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Authorize the target resource to receive the copied model\n\n\n\n````python\n\n target_client\ - \ = FormTrainingClient(endpoint=target_endpoint, credential=AzureKeyCredential(target_key))\n\ - \n async with target_client:\n target = await target_client.get_copy_authorization(\n\ - \ resource_region=target_region,\n resource_id=target_resource_id\n\ - \ )\n # model ID that target client will use to access the model once\ - \ copy is complete\n print(\"Model ID: {}\".format(target[\"modelId\"]))\n\n\ - \ ````\n" - uid: azure.ai.formrecognizer.aio.FormTrainingClient.get_custom_model name: get_custom_model summary: 'Get a description of a custom model, including the types of forms @@ -453,21 +315,6 @@ methods: exceptions: - type: azure.core.exceptions.HttpResponseError - type: azure.core.exceptions.ResourceNotFoundError - examples: - - "Get a custom model with a model ID.\n\n\n\n````python\n\ - \n custom_model = await form_training_client.get_custom_model(model_id=model_info.model_id)\n\ - \ print(\"\\nModel ID: {}\".format(custom_model.model_id))\n print(\"Status:\ - \ {}\".format(custom_model.status))\n print(\"Model name: {}\".format(custom_model.model_name))\n\ - \ print(\"Is this a composed model?: {}\".format(custom_model.properties.is_composed_model))\n\ - \ print(\"Training started on: {}\".format(custom_model.training_started_on))\n\ - \ print(\"Training completed on: {}\".format(custom_model.training_completed_on))\n\ - \n ````\n" - uid: azure.ai.formrecognizer.aio.FormTrainingClient.get_form_recognizer_client name: get_form_recognizer_client summary: Get an instance of a FormRecognizerClient from FormTrainingClient. @@ -488,14 +335,3 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "List model information for each model on the account.\n\n\n\n````python\n\ - \n custom_models = form_training_client.list_custom_models()\n\n print(\"\ - We have models with the following IDs:\")\n async for model in custom_models:\n\ - \ print(model.model_id)\n\n ````\n" diff --git a/docs-ref-autogen/azure-ai-metricsadvisor/azure.ai.metricsadvisor.MetricsAdvisorAdministrationClient.yml b/docs-ref-autogen/azure-ai-metricsadvisor/azure.ai.metricsadvisor.MetricsAdvisorAdministrationClient.yml index b75afddc2796..8f869d34059e 100644 --- a/docs-ref-autogen/azure-ai-metricsadvisor/azure.ai.metricsadvisor.MetricsAdvisorAdministrationClient.yml +++ b/docs-ref-autogen/azure-ai-metricsadvisor/azure.ai.metricsadvisor.MetricsAdvisorAdministrationClient.yml @@ -28,19 +28,6 @@ constructor: types: - - -examples: -- "Authenticate MetricsAdvisorAdministrationClient with a MetricsAdvisorKeyCredential\n\n\n\n````python\n\n from azure.ai.metricsadvisor import MetricsAdvisorKeyCredential,\ - \ MetricsAdvisorAdministrationClient\n\n service_endpoint = os.getenv(\"METRICS_ADVISOR_ENDPOINT\"\ - )\n subscription_key = os.getenv(\"METRICS_ADVISOR_SUBSCRIPTION_KEY\")\n api_key\ - \ = os.getenv(\"METRICS_ADVISOR_API_KEY\")\n\n client = MetricsAdvisorAdministrationClient(service_endpoint,\n\ - \ MetricsAdvisorKeyCredential(subscription_key,\ - \ api_key))\n\n ````\n" methods: - uid: azure.ai.metricsadvisor.MetricsAdvisorAdministrationClient.close name: close @@ -86,42 +73,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Create an anomaly alert configuration\n\n\n\n````python\n\ - \n from azure.ai.metricsadvisor import MetricsAdvisorKeyCredential, MetricsAdvisorAdministrationClient\n\ - \ from azure.ai.metricsadvisor.models import (\n MetricAlertConfiguration,\n\ - \ MetricAnomalyAlertScope,\n TopNGroupScope,\n MetricAnomalyAlertConditions,\n\ - \ SeverityCondition,\n MetricBoundaryCondition,\n MetricAnomalyAlertSnoozeCondition,\n\ - \ )\n service_endpoint = os.getenv(\"METRICS_ADVISOR_ENDPOINT\")\n subscription_key\ - \ = os.getenv(\"METRICS_ADVISOR_SUBSCRIPTION_KEY\")\n api_key = os.getenv(\"\ - METRICS_ADVISOR_API_KEY\")\n detection_configuration_id = os.getenv(\"METRICS_ADVISOR_DETECTION_CONFIGURATION_ID\"\ - )\n hook_id = os.getenv(\"METRICS_ADVISOR_HOOK_ID\")\n\n client = MetricsAdvisorAdministrationClient(service_endpoint,\n\ - \ MetricsAdvisorKeyCredential(subscription_key,\ - \ api_key))\n\n alert_config = client.create_alert_configuration(\n name=\"\ - my alert config\",\n description=\"alert config description\",\n cross_metrics_operator=\"\ - AND\",\n metric_alert_configurations=[\n MetricAlertConfiguration(\n\ - \ detection_configuration_id=detection_configuration_id,\n \ - \ alert_scope=MetricAnomalyAlertScope(\n scope_type=\"\ - WholeSeries\"\n ),\n alert_conditions=MetricAnomalyAlertConditions(\n\ - \ severity_condition=SeverityCondition(\n \ - \ min_alert_severity=\"Low\",\n max_alert_severity=\"\ - High\"\n )\n )\n ),\n MetricAlertConfiguration(\n\ - \ detection_configuration_id=detection_configuration_id,\n \ - \ alert_scope=MetricAnomalyAlertScope(\n scope_type=\"\ - TopN\",\n top_n_group_in_scope=TopNGroupScope(\n \ - \ top=10,\n period=5,\n \ - \ min_top_count=5\n )\n ),\n alert_conditions=MetricAnomalyAlertConditions(\n\ - \ metric_boundary_condition=MetricBoundaryCondition(\n \ - \ direction=\"Up\",\n upper=50\n \ - \ )\n ),\n alert_snooze_condition=MetricAnomalyAlertSnoozeCondition(\n\ - \ auto_snooze=2,\n snooze_scope=\"Metric\"\ - ,\n only_for_successive=True\n )\n ),\n\ - \ ],\n hook_ids=[hook_id]\n )\n\n return alert_config\n\n ````\n" - uid: azure.ai.metricsadvisor.MetricsAdvisorAdministrationClient.create_data_feed name: create_data_feed summary: Create a new data feed. @@ -206,36 +157,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Create a data feed\n\n\ - \n\n````python\n\n from azure.ai.metricsadvisor\ - \ import MetricsAdvisorKeyCredential, MetricsAdvisorAdministrationClient\n from\ - \ azure.ai.metricsadvisor.models import (\n SqlServerDataFeedSource,\n \ - \ DataFeedSchema,\n DataFeedMetric,\n DataFeedDimension,\n \ - \ DataFeedRollupSettings,\n DataFeedMissingDataPointFillSettings,\n\ - \ )\n\n service_endpoint = os.getenv(\"METRICS_ADVISOR_ENDPOINT\")\n subscription_key\ - \ = os.getenv(\"METRICS_ADVISOR_SUBSCRIPTION_KEY\")\n api_key = os.getenv(\"\ - METRICS_ADVISOR_API_KEY\")\n sql_server_connection_string = os.getenv(\"METRICS_ADVISOR_SQL_SERVER_CONNECTION_STRING\"\ - )\n query = os.getenv(\"METRICS_ADVISOR_SQL_SERVER_QUERY\")\n\n client = MetricsAdvisorAdministrationClient(service_endpoint,\n\ - \ MetricsAdvisorKeyCredential(subscription_key,\ - \ api_key))\n\n data_feed = client.create_data_feed(\n name=\"My data\ - \ feed\",\n source=SqlServerDataFeedSource(\n connection_string=sql_server_connection_string,\n\ - \ query=query,\n ),\n granularity=\"Daily\",\n schema=DataFeedSchema(\n\ - \ metrics=[\n DataFeedMetric(name=\"cost\", display_name=\"\ - Cost\"),\n DataFeedMetric(name=\"revenue\", display_name=\"Revenue\"\ - )\n ],\n dimensions=[\n DataFeedDimension(name=\"\ - category\", display_name=\"Category\"),\n DataFeedDimension(name=\"\ - city\", display_name=\"City\")\n ],\n timestamp_column=\"\ - Timestamp\"\n ),\n ingestion_settings=datetime.datetime(2019, 10,\ - \ 1),\n data_feed_description=\"cost/revenue data feed\",\n rollup_settings=DataFeedRollupSettings(\n\ - \ rollup_type=\"AutoRollup\",\n rollup_method=\"Sum\",\n \ - \ rollup_identification_value=\"__CUSTOM_SUM__\"\n ),\n missing_data_point_fill_settings=DataFeedMissingDataPointFillSettings(\n\ - \ fill_type=\"SmartFilling\"\n ),\n access_mode=\"Private\"\ - \n )\n\n return data_feed\n\n\n ````\n" - uid: azure.ai.metricsadvisor.MetricsAdvisorAdministrationClient.create_datasource_credential name: create_datasource_credential summary: Create a new datasource credential. @@ -255,24 +176,6 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Create a datasource credential\n\n\n\n````python\n\ - \n from azure.ai.metricsadvisor import MetricsAdvisorKeyCredential, MetricsAdvisorAdministrationClient\n\ - \ from azure.ai.metricsadvisor.models import DatasourceSqlConnectionString\n\ - \n service_endpoint = os.getenv(\"METRICS_ADVISOR_ENDPOINT\")\n subscription_key\ - \ = os.getenv(\"METRICS_ADVISOR_SUBSCRIPTION_KEY\")\n api_key = os.getenv(\"\ - METRICS_ADVISOR_API_KEY\")\n connection_string = os.getenv(\"SQL_SERVER_CONNECTION_STRING\"\ - )\n\n client = MetricsAdvisorAdministrationClient(service_endpoint,\n \ - \ MetricsAdvisorKeyCredential(subscription_key, api_key))\n\ - \n credential = client.create_datasource_credential(\n datasource_credential=DatasourceSqlConnectionString(\n\ - \ name=\"sql datasource credential\",\n connection_string=connection_string,\n\ - \ description=\"my datasource credential\",\n )\n )\n\n return\ - \ credential\n\n ````\n" - uid: azure.ai.metricsadvisor.MetricsAdvisorAdministrationClient.create_detection_configuration name: create_detection_configuration summary: Create anomaly detection configuration. @@ -314,37 +217,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Create an anomaly detection configuration\n\n\n\n````python\n\ - \n from azure.ai.metricsadvisor import MetricsAdvisorKeyCredential, MetricsAdvisorAdministrationClient\n\ - \ from azure.ai.metricsadvisor.models import (\n ChangeThresholdCondition,\n\ - \ HardThresholdCondition,\n SmartDetectionCondition,\n SuppressCondition,\n\ - \ MetricDetectionCondition,\n )\n\n service_endpoint = os.getenv(\"\ - METRICS_ADVISOR_ENDPOINT\")\n subscription_key = os.getenv(\"METRICS_ADVISOR_SUBSCRIPTION_KEY\"\ - )\n api_key = os.getenv(\"METRICS_ADVISOR_API_KEY\")\n metric_id = os.getenv(\"\ - METRICS_ADVISOR_METRIC_ID\")\n\n client = MetricsAdvisorAdministrationClient(service_endpoint,\n\ - \ MetricsAdvisorKeyCredential(subscription_key,\ - \ api_key))\n\n change_threshold_condition = ChangeThresholdCondition(\n \ - \ anomaly_detector_direction=\"Both\",\n change_percentage=20,\n \ - \ shift_point=10,\n within_range=True,\n suppress_condition=SuppressCondition(\n\ - \ min_number=5,\n min_ratio=2\n )\n )\n hard_threshold_condition\ - \ = HardThresholdCondition(\n anomaly_detector_direction=\"Up\",\n \ - \ upper_bound=100,\n suppress_condition=SuppressCondition(\n \ - \ min_number=2,\n min_ratio=2\n )\n )\n smart_detection_condition\ - \ = SmartDetectionCondition(\n anomaly_detector_direction=\"Up\",\n \ - \ sensitivity=10,\n suppress_condition=SuppressCondition(\n \ - \ min_number=2,\n min_ratio=2\n )\n )\n\n detection_config\ - \ = client.create_detection_configuration(\n name=\"my_detection_config\"\ - ,\n metric_id=metric_id,\n description=\"anomaly detection config\ - \ for metric\",\n whole_series_detection_condition=MetricDetectionCondition(\n\ - \ condition_operator=\"OR\",\n change_threshold_condition=change_threshold_condition,\n\ - \ hard_threshold_condition=hard_threshold_condition,\n smart_detection_condition=smart_detection_condition\n\ - \ )\n )\n\n return detection_config\n\n ````\n" - uid: azure.ai.metricsadvisor.MetricsAdvisorAdministrationClient.create_hook name: create_hook summary: Create a new email or web hook. @@ -362,23 +234,6 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Create a notification hook\n\ - \n\n\n````python\n\n from azure.ai.metricsadvisor\ - \ import MetricsAdvisorKeyCredential, MetricsAdvisorAdministrationClient\n from\ - \ azure.ai.metricsadvisor.models import EmailNotificationHook\n\n service_endpoint\ - \ = os.getenv(\"METRICS_ADVISOR_ENDPOINT\")\n subscription_key = os.getenv(\"\ - METRICS_ADVISOR_SUBSCRIPTION_KEY\")\n api_key = os.getenv(\"METRICS_ADVISOR_API_KEY\"\ - )\n\n client = MetricsAdvisorAdministrationClient(service_endpoint,\n \ - \ MetricsAdvisorKeyCredential(subscription_key, api_key))\n\ - \n hook = client.create_hook(\n hook=EmailNotificationHook(\n \ - \ name=\"email hook\",\n description=\"my email hook\",\n \ - \ emails_to_alert=[\"alertme@alertme.com\"],\n external_link=\"https://docs.microsoft.com/en-us/azure/cognitive-services/metrics-advisor/how-tos/alerts\"\ - \n )\n )\n\n return hook\n\n ````\n" - uid: azure.ai.metricsadvisor.MetricsAdvisorAdministrationClient.delete_alert_configuration name: delete_alert_configuration summary: Delete an anomaly alert configuration by its ID. @@ -395,22 +250,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Delete an anomaly alert configuration by its ID\n\n\n\n````python\n\n from azure.core.exceptions import ResourceNotFoundError\n\ - \ from azure.ai.metricsadvisor import MetricsAdvisorKeyCredential, MetricsAdvisorAdministrationClient\n\ - \n service_endpoint = os.getenv(\"METRICS_ADVISOR_ENDPOINT\")\n subscription_key\ - \ = os.getenv(\"METRICS_ADVISOR_SUBSCRIPTION_KEY\")\n api_key = os.getenv(\"\ - METRICS_ADVISOR_API_KEY\")\n\n client = MetricsAdvisorAdministrationClient(service_endpoint,\n\ - \ MetricsAdvisorKeyCredential(subscription_key,\ - \ api_key))\n\n client.delete_alert_configuration(alert_config_id)\n\n try:\n\ - \ client.get_alert_configuration(alert_config_id)\n except ResourceNotFoundError:\n\ - \ print(\"Alert configuration successfully deleted.\")\n\n ````\n" - uid: azure.ai.metricsadvisor.MetricsAdvisorAdministrationClient.delete_data_feed name: delete_data_feed summary: Delete a data feed by its ID. @@ -427,22 +266,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Delete a data feed by its ID\n\n\n\n````python\n\ - \n from azure.core.exceptions import ResourceNotFoundError\n from azure.ai.metricsadvisor\ - \ import MetricsAdvisorKeyCredential, MetricsAdvisorAdministrationClient\n\n \ - \ service_endpoint = os.getenv(\"METRICS_ADVISOR_ENDPOINT\")\n subscription_key\ - \ = os.getenv(\"METRICS_ADVISOR_SUBSCRIPTION_KEY\")\n api_key = os.getenv(\"\ - METRICS_ADVISOR_API_KEY\")\n\n client = MetricsAdvisorAdministrationClient(service_endpoint,\n\ - \ MetricsAdvisorKeyCredential(subscription_key,\ - \ api_key))\n\n client.delete_data_feed(data_feed_id)\n\n try:\n client.get_data_feed(data_feed_id)\n\ - \ except ResourceNotFoundError:\n print(\"Data feed successfully deleted.\"\ - )\n\n\n ````\n" - uid: azure.ai.metricsadvisor.MetricsAdvisorAdministrationClient.delete_datasource_credential name: delete_datasource_credential summary: Delete a datasource credential by its ID. @@ -459,20 +282,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Delete a datasource credential by its ID\n\n\n\n````python\n\ - \n from azure.core.exceptions import ResourceNotFoundError\n from azure.ai.metricsadvisor\ - \ import MetricsAdvisorKeyCredential, MetricsAdvisorAdministrationClient\n\n \ - \ service_endpoint = os.getenv(\"METRICS_ADVISOR_ENDPOINT\")\n subscription_key\ - \ = os.getenv(\"METRICS_ADVISOR_SUBSCRIPTION_KEY\")\n api_key = os.getenv(\"\ - METRICS_ADVISOR_API_KEY\")\n\n client = MetricsAdvisorAdministrationClient(service_endpoint,\n\ - \ MetricsAdvisorKeyCredential(subscription_key,\ - \ api_key))\n\n client.delete_datasource_credential(credential_id)\n\n ````\n" - uid: azure.ai.metricsadvisor.MetricsAdvisorAdministrationClient.delete_detection_configuration name: delete_detection_configuration summary: Delete an anomaly detection configuration by its ID. @@ -489,23 +298,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Delete an anomaly detection configuration by its ID\n\n\n\n````python\n\n from azure.core.exceptions import\ - \ ResourceNotFoundError\n from azure.ai.metricsadvisor import MetricsAdvisorKeyCredential,\ - \ MetricsAdvisorAdministrationClient\n\n service_endpoint = os.getenv(\"METRICS_ADVISOR_ENDPOINT\"\ - )\n subscription_key = os.getenv(\"METRICS_ADVISOR_SUBSCRIPTION_KEY\")\n api_key\ - \ = os.getenv(\"METRICS_ADVISOR_API_KEY\")\n\n client = MetricsAdvisorAdministrationClient(service_endpoint,\n\ - \ MetricsAdvisorKeyCredential(subscription_key,\ - \ api_key))\n\n client.delete_detection_configuration(detection_config_id)\n\ - \n try:\n client.get_detection_configuration(detection_config_id)\n \ - \ except ResourceNotFoundError:\n print(\"Detection configuration successfully\ - \ deleted.\")\n\n ````\n" - uid: azure.ai.metricsadvisor.MetricsAdvisorAdministrationClient.delete_hook name: delete_hook summary: Delete a web or email hook by its ID. @@ -522,21 +314,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Delete a hook by its ID\n\n\ - \n\n````python\n\n from azure.core.exceptions\ - \ import ResourceNotFoundError\n from azure.ai.metricsadvisor import MetricsAdvisorKeyCredential,\ - \ MetricsAdvisorAdministrationClient\n\n service_endpoint = os.getenv(\"METRICS_ADVISOR_ENDPOINT\"\ - )\n subscription_key = os.getenv(\"METRICS_ADVISOR_SUBSCRIPTION_KEY\")\n api_key\ - \ = os.getenv(\"METRICS_ADVISOR_API_KEY\")\n\n client = MetricsAdvisorAdministrationClient(service_endpoint,\n\ - \ MetricsAdvisorKeyCredential(subscription_key,\ - \ api_key))\n\n client.delete_hook(hook_id)\n\n try:\n client.get_hook(hook_id)\n\ - \ except ResourceNotFoundError:\n print(\"Hook successfully deleted.\"\ - )\n\n ````\n" - uid: azure.ai.metricsadvisor.MetricsAdvisorAdministrationClient.get_alert_configuration name: get_alert_configuration summary: Get a single anomaly alert configuration. @@ -554,43 +331,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Get a single anomaly alert configuration by its ID\n\n\n\n````python\n\n from azure.ai.metricsadvisor import\ - \ MetricsAdvisorKeyCredential, MetricsAdvisorAdministrationClient\n\n service_endpoint\ - \ = os.getenv(\"METRICS_ADVISOR_ENDPOINT\")\n subscription_key = os.getenv(\"\ - METRICS_ADVISOR_SUBSCRIPTION_KEY\")\n api_key = os.getenv(\"METRICS_ADVISOR_API_KEY\"\ - )\n\n client = MetricsAdvisorAdministrationClient(service_endpoint,\n \ - \ MetricsAdvisorKeyCredential(subscription_key, api_key))\n\ - \n config = client.get_alert_configuration(alert_config_id)\n\n print(\"Alert\ - \ config ID: {}\".format(config.id))\n print(\"Alert config name: {}\".format(config.name))\n\ - \ print(\"Description: {}\".format(config.description))\n print(\"Ids of hooks\ - \ associated with alert: {}\".format(config.hook_ids))\n print(\"Use {} operator\ - \ for multiple alert conditions\\n\".format(config.cross_metrics_operator))\n\n\ - \ print(\"Alert uses detection configuration ID: {}\".format(\n config.metric_alert_configurations[0].detection_configuration_id\n\ - \ ))\n print(\"Alert scope type: {}\".format(config.metric_alert_configurations[0].alert_scope.scope_type))\n\ - \ print(\"Alert severity condition: min- {}, max- {}\".format(\n config.metric_alert_configurations[0].alert_conditions.severity_condition.min_alert_severity,\n\ - \ config.metric_alert_configurations[0].alert_conditions.severity_condition.max_alert_severity,\n\ - \ ))\n print(\"\\nAlert uses detection configuration ID: {}\".format(\n \ - \ config.metric_alert_configurations[1].detection_configuration_id\n ))\n\ - \ print(\"Alert scope type: {}\".format(config.metric_alert_configurations[1].alert_scope.scope_type))\n\ - \ print(\"Top N: {}\".format(config.metric_alert_configurations[1].alert_scope.top_n_group_in_scope.top))\n\ - \ print(\"Point count used to look back: {}\".format(\n config.metric_alert_configurations[1].alert_scope.top_n_group_in_scope.period\n\ - \ ))\n print(\"Min top count: {}\".format(\n config.metric_alert_configurations[1].alert_scope.top_n_group_in_scope.min_top_count\n\ - \ ))\n print(\"Alert metric boundary condition direction: {}, upper bound:\ - \ {}\".format(\n config.metric_alert_configurations[1].alert_conditions.metric_boundary_condition.direction,\n\ - \ config.metric_alert_configurations[1].alert_conditions.metric_boundary_condition.upper,\n\ - \ ))\n print(\"Alert snooze condition, snooze point count: {}\".format(\n\ - \ config.metric_alert_configurations[1].alert_snooze_condition.auto_snooze,\n\ - \ ))\n print(\"Alert snooze scope: {}\".format(\n config.metric_alert_configurations[1].alert_snooze_condition.snooze_scope,\n\ - \ ))\n print(\"Snooze only for successive anomalies?: {}\".format(\n \ - \ config.metric_alert_configurations[1].alert_snooze_condition.only_for_successive,\n\ - \ ))\n\n ````\n" - uid: azure.ai.metricsadvisor.MetricsAdvisorAdministrationClient.get_data_feed name: get_data_feed summary: Get a data feed by its id. @@ -607,33 +347,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Get a single data feed by its ID\n\n\n\n````python\n\ - \n from azure.ai.metricsadvisor import MetricsAdvisorKeyCredential, MetricsAdvisorAdministrationClient\n\ - \n service_endpoint = os.getenv(\"METRICS_ADVISOR_ENDPOINT\")\n subscription_key\ - \ = os.getenv(\"METRICS_ADVISOR_SUBSCRIPTION_KEY\")\n api_key = os.getenv(\"\ - METRICS_ADVISOR_API_KEY\")\n\n client = MetricsAdvisorAdministrationClient(service_endpoint,\n\ - \ MetricsAdvisorKeyCredential(subscription_key,\ - \ api_key))\n\n data_feed = client.get_data_feed(data_feed_id)\n\n print(\"\ - ID: {}\".format(data_feed.id))\n print(\"Data feed name: {}\".format(data_feed.name))\n\ - \ print(\"Created time: {}\".format(data_feed.created_time))\n print(\"Status:\ - \ {}\".format(data_feed.status))\n print(\"Source type: {}\".format(data_feed.source.data_source_type))\n\ - \ print(\"Granularity type: {}\".format(data_feed.granularity.granularity_type))\n\ - \ print(\"Data feed metrics: {}\".format([metric.name for metric in data_feed.schema.metrics]))\n\ - \ print(\"Data feed dimensions: {}\".format([dimension.name for dimension in\ - \ data_feed.schema.dimensions]))\n print(\"Data feed timestamp column: {}\"\ - .format(data_feed.schema.timestamp_column))\n print(\"Ingestion data starting\ - \ on: {}\".format(data_feed.ingestion_settings.ingestion_begin_time))\n print(\"\ - Data feed description: {}\".format(data_feed.data_feed_description))\n print(\"\ - Data feed rollup type: {}\".format(data_feed.rollup_settings.rollup_type))\n \ - \ print(\"Data feed rollup method: {}\".format(data_feed.rollup_settings.rollup_method))\n\ - \ print(\"Data feed fill setting: {}\".format(data_feed.missing_data_point_fill_settings.fill_type))\n\ - \ print(\"Data feed access mode: {}\".format(data_feed.access_mode))\n\n ````\n" - uid: azure.ai.metricsadvisor.MetricsAdvisorAdministrationClient.get_data_feed_ingestion_progress name: get_data_feed_ingestion_progress summary: Get last successful data ingestion job timestamp by data feed. @@ -653,23 +366,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Get the progress of data feed ingestion\n\n\n\n````python\n\ - \n from azure.ai.metricsadvisor import MetricsAdvisorKeyCredential, MetricsAdvisorAdministrationClient\n\ - \n service_endpoint = os.getenv(\"METRICS_ADVISOR_ENDPOINT\")\n subscription_key\ - \ = os.getenv(\"METRICS_ADVISOR_SUBSCRIPTION_KEY\")\n api_key = os.getenv(\"\ - METRICS_ADVISOR_API_KEY\")\n data_feed_id = os.getenv(\"METRICS_ADVISOR_DATA_FEED_ID\"\ - )\n\n client = MetricsAdvisorAdministrationClient(service_endpoint,\n \ - \ MetricsAdvisorKeyCredential(subscription_key, api_key))\n\ - \n progress = client.get_data_feed_ingestion_progress(data_feed_id)\n\n print(\"\ - Lastest active timestamp: {}\".format(progress.latest_active_timestamp))\n print(\"\ - Latest successful timestamp: {}\".format(progress.latest_success_timestamp))\n\ - \n\n ````\n" - uid: azure.ai.metricsadvisor.MetricsAdvisorAdministrationClient.get_datasource_credential name: get_datasource_credential summary: Get a datasource credential @@ -687,22 +383,6 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Get a datasource credential by its ID\n\n\n\n````python\n\ - \n from azure.ai.metricsadvisor import MetricsAdvisorKeyCredential, MetricsAdvisorAdministrationClient\n\ - \n service_endpoint = os.getenv(\"METRICS_ADVISOR_ENDPOINT\")\n subscription_key\ - \ = os.getenv(\"METRICS_ADVISOR_SUBSCRIPTION_KEY\")\n api_key = os.getenv(\"\ - METRICS_ADVISOR_API_KEY\")\n\n client = MetricsAdvisorAdministrationClient(service_endpoint,\n\ - \ MetricsAdvisorKeyCredential(subscription_key,\ - \ api_key))\n\n credential = client.get_datasource_credential(credential_id)\n\ - \n print(\"Credential type: {}\".format(credential.credential_type))\n print(\"\ - Credential name: {}\".format(credential.name))\n print(\"Description: {}\".format(credential.description))\n\ - \n\n ````\n" - uid: azure.ai.metricsadvisor.MetricsAdvisorAdministrationClient.get_detection_configuration name: get_detection_configuration summary: Get a single anomaly detection configuration. @@ -720,46 +400,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Get a single anomaly detection configuration by its ID\n\n\n\n````python\n\n from azure.ai.metricsadvisor\ - \ import MetricsAdvisorKeyCredential, MetricsAdvisorAdministrationClient\n\n \ - \ service_endpoint = os.getenv(\"METRICS_ADVISOR_ENDPOINT\")\n subscription_key\ - \ = os.getenv(\"METRICS_ADVISOR_SUBSCRIPTION_KEY\")\n api_key = os.getenv(\"\ - METRICS_ADVISOR_API_KEY\")\n\n client = MetricsAdvisorAdministrationClient(service_endpoint,\n\ - \ MetricsAdvisorKeyCredential(subscription_key,\ - \ api_key))\n\n config = client.get_detection_configuration(detection_config_id)\n\ - \n print(\"Detection config name: {}\".format(config.name))\n print(\"Description:\ - \ {}\".format(config.description))\n print(\"Metric ID: {}\".format(config.metric_id))\n\ - \n print(\"\\nDetection conditions specified for configuration...\")\n print(\"\ - \\nWhole Series Detection Conditions:\\n\")\n conditions = config.whole_series_detection_condition\n\ - \n print(\"Use {} operator for multiple detection conditions\".format(conditions.condition_operator))\n\ - \n print(\"Smart Detection Condition:\")\n print(\"- Sensitivity: {}\".format(conditions.smart_detection_condition.sensitivity))\n\ - \ print(\"- Detection direction: {}\".format(conditions.smart_detection_condition.anomaly_detector_direction))\n\ - \ print(\"- Suppress conditions: minimum number: {}; minimum ratio: {}\".format(\n\ - \ conditions.smart_detection_condition.suppress_condition.min_number,\n\ - \ conditions.smart_detection_condition.suppress_condition.min_ratio\n \ - \ ))\n\n print(\"Hard Threshold Condition:\")\n print(\"- Lower bound: {}\"\ - .format(conditions.hard_threshold_condition.lower_bound))\n print(\"- Upper\ - \ bound: {}\".format(conditions.hard_threshold_condition.upper_bound))\n print(\"\ - - Detection direction: {}\".format(conditions.smart_detection_condition.anomaly_detector_direction))\n\ - \ print(\"- Suppress conditions: minimum number: {}; minimum ratio: {}\".format(\n\ - \ conditions.smart_detection_condition.suppress_condition.min_number,\n\ - \ conditions.smart_detection_condition.suppress_condition.min_ratio\n \ - \ ))\n\n print(\"Change Threshold Condition:\")\n print(\"- Change percentage:\ - \ {}\".format(conditions.change_threshold_condition.change_percentage))\n print(\"\ - - Shift point: {}\".format(conditions.change_threshold_condition.shift_point))\n\ - \ print(\"- Detect anomaly if within range: {}\".format(conditions.change_threshold_condition.within_range))\n\ - \ print(\"- Detection direction: {}\".format(conditions.smart_detection_condition.anomaly_detector_direction))\n\ - \ print(\"- Suppress conditions: minimum number: {}; minimum ratio: {}\".format(\n\ - \ conditions.smart_detection_condition.suppress_condition.min_number,\n\ - \ conditions.smart_detection_condition.suppress_condition.min_ratio\n \ - \ ))\n\n\n ````\n" - uid: azure.ai.metricsadvisor.MetricsAdvisorAdministrationClient.get_hook name: get_hook summary: Get a web or email hook by its id. @@ -777,23 +417,6 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Get a notification hook by its ID\n\n\n\n````python\n\ - \n from azure.ai.metricsadvisor import MetricsAdvisorKeyCredential, MetricsAdvisorAdministrationClient\n\ - \n service_endpoint = os.getenv(\"METRICS_ADVISOR_ENDPOINT\")\n subscription_key\ - \ = os.getenv(\"METRICS_ADVISOR_SUBSCRIPTION_KEY\")\n api_key = os.getenv(\"\ - METRICS_ADVISOR_API_KEY\")\n\n client = MetricsAdvisorAdministrationClient(service_endpoint,\n\ - \ MetricsAdvisorKeyCredential(subscription_key,\ - \ api_key))\n\n hook = client.get_hook(hook_id)\n\n print(\"Hook name: {}\"\ - .format(hook.name))\n print(\"Description: {}\".format(hook.description))\n\ - \ print(\"Emails to alert: {}\".format(hook.emails_to_alert))\n print(\"External\ - \ link: {}\".format(hook.external_link))\n print(\"Admins: {}\".format(hook.admins))\n\ - \n\n ````\n" - uid: azure.ai.metricsadvisor.MetricsAdvisorAdministrationClient.list_alert_configurations name: list_alert_configurations summary: Query all anomaly alert configurations for specific anomaly detection configuration. @@ -811,24 +434,6 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "List all anomaly alert configurations for specific anomaly detection configuration\n\n\n\n````python\n\n from azure.ai.metricsadvisor import\ - \ MetricsAdvisorKeyCredential, MetricsAdvisorAdministrationClient\n\n service_endpoint\ - \ = os.getenv(\"METRICS_ADVISOR_ENDPOINT\")\n subscription_key = os.getenv(\"\ - METRICS_ADVISOR_SUBSCRIPTION_KEY\")\n api_key = os.getenv(\"METRICS_ADVISOR_API_KEY\"\ - )\n detection_configuration_id = os.getenv(\"METRICS_ADVISOR_DETECTION_CONFIGURATION_ID\"\ - )\n\n client = MetricsAdvisorAdministrationClient(service_endpoint,\n \ - \ MetricsAdvisorKeyCredential(subscription_key, api_key))\n\ - \n configs = client.list_alert_configurations(detection_configuration_id)\n\ - \ for config in configs:\n print(\"Alert config name: {}\".format(config.name))\n\ - \ print(\"Alert description: {}\".format(config.description))\n print(\"\ - Ids of hooks associated with alert: {}\\n\".format(config.hook_ids))\n\n\n ````\n" - uid: azure.ai.metricsadvisor.MetricsAdvisorAdministrationClient.list_data_feed_ingestion_status name: list_data_feed_ingestion_status summary: Get data ingestion status by data feed. @@ -859,24 +464,6 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "List the data feed ingestion statuses by data feed ID\n\n\n\ - \n````python\n\n import datetime\n from azure.ai.metricsadvisor import MetricsAdvisorKeyCredential,\ - \ MetricsAdvisorAdministrationClient\n\n service_endpoint = os.getenv(\"METRICS_ADVISOR_ENDPOINT\"\ - )\n subscription_key = os.getenv(\"METRICS_ADVISOR_SUBSCRIPTION_KEY\")\n api_key\ - \ = os.getenv(\"METRICS_ADVISOR_API_KEY\")\n data_feed_id = os.getenv(\"METRICS_ADVISOR_DATA_FEED_ID\"\ - )\n\n client = MetricsAdvisorAdministrationClient(service_endpoint,\n \ - \ MetricsAdvisorKeyCredential(subscription_key, api_key))\n\ - \n ingestion_status = client.list_data_feed_ingestion_status(\n data_feed_id,\n\ - \ datetime.datetime(2020, 9, 20),\n datetime.datetime(2020, 9, 25)\n\ - \ )\n for status in ingestion_status:\n print(\"Timestamp: {}\".format(status.timestamp))\n\ - \ print(\"Status: {}\".format(status.status))\n print(\"Message: {}\\\ - n\".format(status.message))\n\n\n ````\n" - uid: azure.ai.metricsadvisor.MetricsAdvisorAdministrationClient.list_data_feeds name: list_data_feeds summary: List all data feeds. @@ -914,27 +501,6 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "List data feeds under an account.\n\n\n\n````python\n\ - \n from azure.ai.metricsadvisor import MetricsAdvisorKeyCredential, MetricsAdvisorAdministrationClient\n\ - \n service_endpoint = os.getenv(\"METRICS_ADVISOR_ENDPOINT\")\n subscription_key\ - \ = os.getenv(\"METRICS_ADVISOR_SUBSCRIPTION_KEY\")\n api_key = os.getenv(\"\ - METRICS_ADVISOR_API_KEY\")\n\n client = MetricsAdvisorAdministrationClient(service_endpoint,\n\ - \ MetricsAdvisorKeyCredential(subscription_key,\ - \ api_key))\n\n data_feeds = client.list_data_feeds()\n\n for feed in data_feeds:\n\ - \ print(\"Data feed name: {}\".format(feed.name))\n print(\"ID: {}\"\ - .format(feed.id))\n print(\"Created time: {}\".format(feed.created_time))\n\ - \ print(\"Status: {}\".format(feed.status))\n print(\"Source type:\ - \ {}\".format(feed.source.data_source_type))\n print(\"Granularity type:\ - \ {}\".format(feed.granularity.granularity_type))\n\n print(\"\\nFeed metrics:\"\ - )\n for metric in feed.schema.metrics:\n print(metric.name)\n\n\ - \ print(\"\\nFeed dimensions:\")\n for dimension in feed.schema.dimensions:\n\ - \ print(dimension.name)\n\n\n ````\n" - uid: azure.ai.metricsadvisor.MetricsAdvisorAdministrationClient.list_datasource_credentials name: list_datasource_credentials summary: List all credential entities. @@ -951,23 +517,6 @@ methods: - [[]] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "List all of the datasource credentials under the account\n\n\n\n````python\n\n from azure.ai.metricsadvisor\ - \ import MetricsAdvisorKeyCredential, MetricsAdvisorAdministrationClient\n\n \ - \ service_endpoint = os.getenv(\"METRICS_ADVISOR_ENDPOINT\")\n subscription_key\ - \ = os.getenv(\"METRICS_ADVISOR_SUBSCRIPTION_KEY\")\n api_key = os.getenv(\"\ - METRICS_ADVISOR_API_KEY\")\n\n client = MetricsAdvisorAdministrationClient(service_endpoint,\n\ - \ MetricsAdvisorKeyCredential(subscription_key,\ - \ api_key))\n\n credentials = client.list_datasource_credentials()\n for credential\ - \ in credentials:\n print(\"Credential type: {}\".format(credential.credential_type))\n\ - \ print(\"Credential name: {}\".format(credential.name))\n print(\"\ - Description: {}\\n\".format(credential.description))\n\n\n ````\n" - uid: azure.ai.metricsadvisor.MetricsAdvisorAdministrationClient.list_detection_configurations name: list_detection_configurations summary: Query all anomaly detection configurations for specific metric. @@ -984,24 +533,6 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "List all anomaly detection configurations for a specific metric\n\n\n\n````python\n\n from azure.ai.metricsadvisor\ - \ import MetricsAdvisorKeyCredential, MetricsAdvisorAdministrationClient\n\n \ - \ service_endpoint = os.getenv(\"METRICS_ADVISOR_ENDPOINT\")\n subscription_key\ - \ = os.getenv(\"METRICS_ADVISOR_SUBSCRIPTION_KEY\")\n api_key = os.getenv(\"\ - METRICS_ADVISOR_API_KEY\")\n metric_id = os.getenv(\"METRICS_ADVISOR_METRIC_ID\"\ - )\n\n client = MetricsAdvisorAdministrationClient(service_endpoint,\n \ - \ MetricsAdvisorKeyCredential(subscription_key, api_key))\n\ - \n configs = client.list_detection_configurations(metric_id=metric_id)\n for\ - \ config in configs:\n print(\"Detection config name: {}\".format(config.name))\n\ - \ print(\"Description: {}\".format(config.description))\n print(\"\ - Metric ID: {}\\n\".format(config.metric_id))\n\n\n ````\n" - uid: azure.ai.metricsadvisor.MetricsAdvisorAdministrationClient.list_hooks name: list_hooks summary: List all hooks. @@ -1022,21 +553,6 @@ methods: ]] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "List all of the notification hooks under the account\n\n\n\n````python\n\ - \n from azure.ai.metricsadvisor import MetricsAdvisorKeyCredential, MetricsAdvisorAdministrationClient\n\ - \n service_endpoint = os.getenv(\"METRICS_ADVISOR_ENDPOINT\")\n subscription_key\ - \ = os.getenv(\"METRICS_ADVISOR_SUBSCRIPTION_KEY\")\n api_key = os.getenv(\"\ - METRICS_ADVISOR_API_KEY\")\n\n client = MetricsAdvisorAdministrationClient(service_endpoint,\n\ - \ MetricsAdvisorKeyCredential(subscription_key,\ - \ api_key))\n\n hooks = client.list_hooks()\n for hook in hooks:\n print(\"\ - Hook type: {}\".format(hook.hook_type))\n print(\"Hook name: {}\".format(hook.name))\n\ - \ print(\"Description: {}\\n\".format(hook.description))\n\n\n ````\n" - uid: azure.ai.metricsadvisor.MetricsAdvisorAdministrationClient.refresh_data_feed_ingestion name: refresh_data_feed_ingestion summary: Refreshes data ingestion by data feed to backfill data. @@ -1064,21 +580,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Refresh data feed ingestion over a period of time\n\n\n\ - \n````python\n\n import datetime\n from azure.ai.metricsadvisor import MetricsAdvisorKeyCredential,\ - \ MetricsAdvisorAdministrationClient\n\n service_endpoint = os.getenv(\"METRICS_ADVISOR_ENDPOINT\"\ - )\n subscription_key = os.getenv(\"METRICS_ADVISOR_SUBSCRIPTION_KEY\")\n api_key\ - \ = os.getenv(\"METRICS_ADVISOR_API_KEY\")\n data_feed_id = os.getenv(\"METRICS_ADVISOR_DATA_FEED_ID\"\ - )\n\n client = MetricsAdvisorAdministrationClient(service_endpoint,\n \ - \ MetricsAdvisorKeyCredential(subscription_key, api_key))\n\ - \n client.refresh_data_feed_ingestion(\n data_feed_id,\n datetime.datetime(2020,\ - \ 9, 20),\n datetime.datetime(2020, 9, 25)\n )\n\n\n ````\n" - uid: azure.ai.metricsadvisor.MetricsAdvisorAdministrationClient.update_alert_configuration name: update_alert_configuration summary: 'Update anomaly alerting configuration. Either pass the entire AnomalyAlertConfiguration @@ -1129,35 +630,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Update an existing anomaly alert configuration\n\n\n\n````python\n\ - \n from azure.ai.metricsadvisor import MetricsAdvisorKeyCredential, MetricsAdvisorAdministrationClient\n\ - \ from azure.ai.metricsadvisor.models import (\n MetricAlertConfiguration,\n\ - \ MetricAnomalyAlertScope,\n MetricAnomalyAlertConditions,\n \ - \ MetricBoundaryCondition\n )\n service_endpoint = os.getenv(\"METRICS_ADVISOR_ENDPOINT\"\ - )\n subscription_key = os.getenv(\"METRICS_ADVISOR_SUBSCRIPTION_KEY\")\n api_key\ - \ = os.getenv(\"METRICS_ADVISOR_API_KEY\")\n detection_configuration_id = os.getenv(\"\ - METRICS_ADVISOR_DETECTION_CONFIGURATION_ID\")\n\n client = MetricsAdvisorAdministrationClient(service_endpoint,\n\ - \ MetricsAdvisorKeyCredential(subscription_key,\ - \ api_key))\n\n alert_config.name = \"updated config name\"\n additional_alert\ - \ = MetricAlertConfiguration(\n detection_configuration_id=detection_configuration_id,\n\ - \ alert_scope=MetricAnomalyAlertScope(\n scope_type=\"SeriesGroup\"\ - ,\n series_group_in_scope={'city': 'Shenzhen'}\n ),\n alert_conditions=MetricAnomalyAlertConditions(\n\ - \ metric_boundary_condition=MetricBoundaryCondition(\n \ - \ direction=\"Down\",\n lower=5\n )\n )\n )\n\ - \ alert_config.metric_alert_configurations.append(additional_alert)\n\n updated\ - \ = client.update_alert_configuration(\n alert_config,\n cross_metrics_operator=\"\ - OR\",\n description=\"updated alert config\"\n )\n\n print(\"Updated\ - \ alert name: {}\".format(updated.name))\n print(\"Updated alert description:\ - \ {}\".format(updated.description))\n print(\"Updated cross metrics operator:\ - \ {}\".format(updated.cross_metrics_operator))\n print(\"Updated alert condition\ - \ configuration scope type: {}\".format(\n updated.metric_alert_configurations[2].alert_scope.scope_type\n\ - \ ))\n\n\n ````\n" - uid: azure.ai.metricsadvisor.MetricsAdvisorAdministrationClient.update_data_feed name: update_data_feed summary: 'Update a data feed. Either pass the entire DataFeed object with the chosen @@ -1292,28 +764,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Update an existing data feed\n\n\n\n````python\n\ - \n from azure.ai.metricsadvisor import MetricsAdvisorKeyCredential, MetricsAdvisorAdministrationClient\n\ - \n service_endpoint = os.getenv(\"METRICS_ADVISOR_ENDPOINT\")\n subscription_key\ - \ = os.getenv(\"METRICS_ADVISOR_SUBSCRIPTION_KEY\")\n api_key = os.getenv(\"\ - METRICS_ADVISOR_API_KEY\")\n\n client = MetricsAdvisorAdministrationClient(service_endpoint,\n\ - \ MetricsAdvisorKeyCredential(subscription_key,\ - \ api_key))\n\n # update data feed on the data feed itself or by using available\ - \ keyword arguments\n data_feed.name = \"updated name\"\n data_feed.data_feed_description\ - \ = \"updated description for data feed\"\n\n updated = client.update_data_feed(\n\ - \ data_feed,\n access_mode=\"Public\",\n fill_type=\"CustomValue\"\ - ,\n custom_fill_value=1\n )\n print(\"Updated name: {}\".format(updated.name))\n\ - \ print(\"Updated description: {}\".format(updated.data_feed_description))\n\ - \ print(\"Updated access mode: {}\".format(updated.access_mode))\n print(\"\ - Updated fill setting, value: {}, {}\".format(\n updated.missing_data_point_fill_settings.fill_type,\n\ - \ updated.missing_data_point_fill_settings.custom_fill_value,\n ))\n\n\ - \ ````\n" - uid: azure.ai.metricsadvisor.MetricsAdvisorAdministrationClient.update_datasource_credential name: update_datasource_credential summary: Update a datasource credential. @@ -1330,23 +780,6 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Update an existing datasource credential\n\n\n\n````python\n\ - \n from azure.ai.metricsadvisor import MetricsAdvisorKeyCredential, MetricsAdvisorAdministrationClient\n\ - \n service_endpoint = os.getenv(\"METRICS_ADVISOR_ENDPOINT\")\n subscription_key\ - \ = os.getenv(\"METRICS_ADVISOR_SUBSCRIPTION_KEY\")\n api_key = os.getenv(\"\ - METRICS_ADVISOR_API_KEY\")\n\n client = MetricsAdvisorAdministrationClient(service_endpoint,\n\ - \ MetricsAdvisorKeyCredential(subscription_key,\ - \ api_key))\n\n datasource_credential.description = \"updated description\"\n\ - \n updated = client.update_datasource_credential(datasource_credential)\n \ - \ print(\"Credential type: {}\".format(updated.credential_type))\n print(\"\ - Credential name: {}\".format(updated.name))\n print(\"Description: {}\\n\".format(updated.description))\n\ - \n ````\n" - uid: azure.ai.metricsadvisor.MetricsAdvisorAdministrationClient.update_detection_configuration name: update_detection_configuration summary: 'Update anomaly metric detection configuration. Either pass the entire @@ -1401,38 +834,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Update an existing anomaly detection configuration\n\n\n\n````python\n\n from azure.ai.metricsadvisor\ - \ import MetricsAdvisorKeyCredential, MetricsAdvisorAdministrationClient\n from\ - \ azure.ai.metricsadvisor.models import (\n MetricSeriesGroupDetectionCondition,\n\ - \ MetricSingleSeriesDetectionCondition,\n SmartDetectionCondition,\n\ - \ SuppressCondition\n )\n\n service_endpoint = os.getenv(\"METRICS_ADVISOR_ENDPOINT\"\ - )\n subscription_key = os.getenv(\"METRICS_ADVISOR_SUBSCRIPTION_KEY\")\n api_key\ - \ = os.getenv(\"METRICS_ADVISOR_API_KEY\")\n\n client = MetricsAdvisorAdministrationClient(service_endpoint,\n\ - \ MetricsAdvisorKeyCredential(subscription_key,\ - \ api_key))\n\n detection_config.name = \"updated config name\"\n detection_config.description\ - \ = \"updated with more detection conditions\"\n smart_detection_condition =\ - \ SmartDetectionCondition(\n anomaly_detector_direction=\"Up\",\n \ - \ sensitivity=10,\n suppress_condition=SuppressCondition(\n min_number=2,\n\ - \ min_ratio=2\n )\n )\n\n updated = client.update_detection_configuration(\n\ - \ detection_config,\n series_group_detection_conditions=[\n \ - \ MetricSeriesGroupDetectionCondition(\n series_group_key={\"\ - city\": \"Seoul\"},\n smart_detection_condition=smart_detection_condition\n\ - \ )\n ],\n series_detection_conditions=[\n MetricSingleSeriesDetectionCondition(\n\ - \ series_key={\"city\": \"Osaka\", \"category\": \"Cell Phones\"\ - },\n smart_detection_condition=smart_detection_condition\n \ - \ )\n ]\n )\n print(\"Updated detection name: {}\".format(updated.name))\n\ - \ print(\"Updated detection description: {}\".format(updated.description))\n\ - \ print(\"Updated detection condition for series group: {}\".format(\n \ - \ updated.series_group_detection_conditions[0].series_group_key\n ))\n print(\"\ - Updated detection condition for series: {}\".format(\n updated.series_detection_conditions[0].series_key\n\ - \ ))\n\n\n ````\n" - uid: azure.ai.metricsadvisor.MetricsAdvisorAdministrationClient.update_hook name: update_hook summary: 'Update a hook. Either pass the entire EmailNotificationHook or WebNotificationHook @@ -1504,21 +905,3 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Update an existing notification hook\n\n\n\n````python\n\ - \n from azure.ai.metricsadvisor import MetricsAdvisorKeyCredential, MetricsAdvisorAdministrationClient\n\ - \n service_endpoint = os.getenv(\"METRICS_ADVISOR_ENDPOINT\")\n subscription_key\ - \ = os.getenv(\"METRICS_ADVISOR_SUBSCRIPTION_KEY\")\n api_key = os.getenv(\"\ - METRICS_ADVISOR_API_KEY\")\n\n client = MetricsAdvisorAdministrationClient(service_endpoint,\n\ - \ MetricsAdvisorKeyCredential(subscription_key,\ - \ api_key))\n\n hook.name = \"updated hook name\"\n hook.description = \"\ - updated hook description\"\n\n client.update_hook(\n hook,\n emails_to_alert=[\"\ - newemail@alertme.com\"]\n )\n updated = client.get_hook(hook.id)\n print(\"\ - Updated name: {}\".format(updated.name))\n print(\"Updated description: {}\"\ - .format(updated.description))\n print(\"Updated emails: {}\".format(updated.emails_to_alert))\n\ - \n ````\n" diff --git a/docs-ref-autogen/azure-ai-metricsadvisor/azure.ai.metricsadvisor.MetricsAdvisorClient.yml b/docs-ref-autogen/azure-ai-metricsadvisor/azure.ai.metricsadvisor.MetricsAdvisorClient.yml index 72e396ced9c5..c2c2826465f6 100644 --- a/docs-ref-autogen/azure-ai-metricsadvisor/azure.ai.metricsadvisor.MetricsAdvisorClient.yml +++ b/docs-ref-autogen/azure-ai-metricsadvisor/azure.ai.metricsadvisor.MetricsAdvisorClient.yml @@ -45,41 +45,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Add new feedback.\n\n\n\n````python\n\n from azure.ai.metricsadvisor\ - \ import MetricsAdvisorKeyCredential, MetricsAdvisorClient\n from azure.ai.metricsadvisor.models\ - \ import AnomalyFeedback, ChangePointFeedback, CommentFeedback, PeriodFeedback\n\ - \n service_endpoint = os.getenv(\"METRICS_ADVISOR_ENDPOINT\")\n subscription_key\ - \ = os.getenv(\"METRICS_ADVISOR_SUBSCRIPTION_KEY\")\n api_key = os.getenv(\"\ - METRICS_ADVISOR_API_KEY\")\n metric_id = os.getenv(\"METRICS_ADVISOR_METRIC_ID\"\ - )\n\n client = MetricsAdvisorClient(service_endpoint,\n \ - \ MetricsAdvisorKeyCredential(subscription_key, api_key))\n\n anomaly_feedback\ - \ = AnomalyFeedback(metric_id=metric_id,\n \ - \ dimension_key={\"Dim1\": \"Common Lime\"},\n \ - \ start_time=datetime.datetime(2020, 8, 5),\n \ - \ end_time=datetime.datetime(2020, 8, 7),\n \ - \ value=\"NotAnomaly\")\n client.add_feedback(anomaly_feedback)\n\ - \n change_point_feedback = ChangePointFeedback(metric_id=metric_id,\n \ - \ dimension_key={\"Dim1\": \"Common Lime\"\ - },\n start_time=datetime.datetime(2020,\ - \ 8, 5),\n end_time=datetime.datetime(2020,\ - \ 8, 7),\n value=\"NotChangePoint\"\ - )\n client.add_feedback(change_point_feedback)\n\n comment_feedback = CommentFeedback(metric_id=metric_id,\n\ - \ dimension_key={\"Dim1\": \"Common Lime\"\ - },\n start_time=datetime.datetime(2020, 8,\ - \ 5),\n end_time=datetime.datetime(2020,\ - \ 8, 7),\n value=\"comment\")\n client.add_feedback(comment_feedback)\n\ - \n period_feedback = PeriodFeedback(metric_id=metric_id,\n \ - \ dimension_key={\"Dim1\": \"Common Lime\"},\n \ - \ start_time=datetime.datetime(2020, 8, 5),\n \ - \ end_time=datetime.datetime(2020, 8, 7),\n \ - \ period_type=\"AssignValue\",\n \ - \ value=2)\n client.add_feedback(period_feedback)\n\n ````\n" - uid: azure.ai.metricsadvisor.MetricsAdvisorClient.close name: close summary: Close the session. @@ -104,21 +69,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Get a metric feedback by its id.\n\n\n\n````python\n\ - \n from azure.ai.metricsadvisor import MetricsAdvisorKeyCredential, MetricsAdvisorClient\n\ - \n service_endpoint = os.getenv(\"METRICS_ADVISOR_ENDPOINT\")\n subscription_key\ - \ = os.getenv(\"METRICS_ADVISOR_SUBSCRIPTION_KEY\")\n api_key = os.getenv(\"\ - METRICS_ADVISOR_API_KEY\")\n feedback_id = os.getenv(\"METRICS_ADVISOR_FEEDBACK_ID\"\ - )\n\n client = MetricsAdvisorClient(service_endpoint,\n \ - \ MetricsAdvisorKeyCredential(subscription_key, api_key))\n\n result\ - \ = client.get_feedback(feedback_id=feedback_id)\n print(\"Type: {}; Id: {}\"\ - .format(result.feedback_type, result.id))\n\n ````\n" - uid: azure.ai.metricsadvisor.MetricsAdvisorClient.list_alerts name: list_alerts summary: Query alerts under anomaly alert configuration. @@ -158,24 +108,6 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Query anomaly detection results.\n\n\n\n````python\n\ - \n import datetime\n from azure.ai.metricsadvisor import MetricsAdvisorKeyCredential,\ - \ MetricsAdvisorClient\n\n service_endpoint = os.getenv(\"METRICS_ADVISOR_ENDPOINT\"\ - )\n subscription_key = os.getenv(\"METRICS_ADVISOR_SUBSCRIPTION_KEY\")\n api_key\ - \ = os.getenv(\"METRICS_ADVISOR_API_KEY\")\n\n client = MetricsAdvisorClient(service_endpoint,\n\ - \ MetricsAdvisorKeyCredential(subscription_key,\ - \ api_key))\n\n results = client.list_alerts(\n alert_configuration_id=alert_config_id,\n\ - \ start_time=datetime.datetime(2020, 1, 1),\n end_time=datetime.datetime(2020,\ - \ 9, 9),\n time_mode=\"AnomalyTime\",\n )\n\n tolist = []\n for result\ - \ in results:\n tolist.append(result)\n print(\"Alert id: {}\".format(result.id))\n\ - \ print(\"Create time: {}\".format(result.created_time))\n return tolist\n\ - \n ````\n" - uid: azure.ai.metricsadvisor.MetricsAdvisorClient.list_anomalies name: list_anomalies summary: Query anomalies under a specific alert or detection configuration. @@ -253,23 +185,6 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Query dimension values.\n\ - \n\n\n````python\n\n import datetime\n\ - \ from azure.ai.metricsadvisor import MetricsAdvisorKeyCredential, MetricsAdvisorClient\n\ - \n service_endpoint = os.getenv(\"METRICS_ADVISOR_ENDPOINT\")\n subscription_key\ - \ = os.getenv(\"METRICS_ADVISOR_SUBSCRIPTION_KEY\")\n api_key = os.getenv(\"\ - METRICS_ADVISOR_API_KEY\")\n detection_configuration_id = os.getenv(\"METRICS_ADVISOR_DETECTION_CONFIGURATION_ID\"\ - )\n dimension_name = \"city\"\n\n client = MetricsAdvisorClient(service_endpoint,\n\ - \ MetricsAdvisorKeyCredential(subscription_key,\ - \ api_key))\n\n results = client.list_anomaly_dimension_values(\n detection_configuration_id=detection_configuration_id,\n\ - \ dimension_name=dimension_name,\n start_time=datetime.datetime(2020,\ - \ 1, 1),\n end_time=datetime.datetime(2020, 10, 21),\n )\n for result\ - \ in results:\n print(str(result))\n\n\n ````\n" - uid: azure.ai.metricsadvisor.MetricsAdvisorClient.list_feedback name: list_feedback summary: List feedback on the given metric. @@ -318,22 +233,6 @@ methods: , ]] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "List feedback on the given metric.\n\n\n\n````python\n\ - \n from azure.ai.metricsadvisor import MetricsAdvisorKeyCredential, MetricsAdvisorClient\n\ - \n service_endpoint = os.getenv(\"METRICS_ADVISOR_ENDPOINT\")\n subscription_key\ - \ = os.getenv(\"METRICS_ADVISOR_SUBSCRIPTION_KEY\")\n api_key = os.getenv(\"\ - METRICS_ADVISOR_API_KEY\")\n metric_id = os.getenv(\"METRICS_ADVISOR_METRIC_ID\"\ - )\n\n client = MetricsAdvisorClient(service_endpoint,\n \ - \ MetricsAdvisorKeyCredential(subscription_key, api_key))\n\n results\ - \ = client.list_feedback(metric_id=metric_id)\n for result in results:\n \ - \ print(\"Type: {}; Id: {}\".format(result.feedback_type, result.id))\n\n \ - \ ````\n" - uid: azure.ai.metricsadvisor.MetricsAdvisorClient.list_incident_root_causes name: list_incident_root_causes summary: Query root cause for incident. @@ -356,23 +255,6 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Query incident root causes.\n\ - \n\n\n````python\n\n from azure.ai.metricsadvisor\ - \ import MetricsAdvisorKeyCredential, MetricsAdvisorClient\n\n service_endpoint\ - \ = os.getenv(\"METRICS_ADVISOR_ENDPOINT\")\n subscription_key = os.getenv(\"\ - METRICS_ADVISOR_SUBSCRIPTION_KEY\")\n api_key = os.getenv(\"METRICS_ADVISOR_API_KEY\"\ - )\n detection_configuration_id = os.getenv(\"METRICS_ADVISOR_DETECTION_CONFIGURATION_ID\"\ - )\n incident_id = os.getenv(\"METRICS_ADVISOR_INCIDENT_ID\")\n\n client =\ - \ MetricsAdvisorClient(service_endpoint,\n MetricsAdvisorKeyCredential(subscription_key,\ - \ api_key))\n results = client.list_incident_root_causes(\n detection_configuration_id=detection_configuration_id,\n\ - \ incident_id=incident_id,\n )\n for result in results:\n print(\"\ - Score: {}\".format(result.score))\n print(\"Description: {}\".format(result.description))\n\ - \n\n ````\n" - uid: azure.ai.metricsadvisor.MetricsAdvisorClient.list_incidents name: list_incidents summary: Query incidents under a specific alert or detection configuration. @@ -439,22 +321,6 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Query metric dimension values.\n\n\n\n````python\n\ - \n from azure.ai.metricsadvisor import MetricsAdvisorKeyCredential, MetricsAdvisorClient\n\ - \n service_endpoint = os.getenv(\"METRICS_ADVISOR_ENDPOINT\")\n subscription_key\ - \ = os.getenv(\"METRICS_ADVISOR_SUBSCRIPTION_KEY\")\n api_key = os.getenv(\"\ - METRICS_ADVISOR_API_KEY\")\n metric_id = os.getenv(\"METRICS_ADVISOR_METRIC_ID\"\ - )\n dimension_name = \"city\"\n\n client = MetricsAdvisorClient(service_endpoint,\n\ - \ MetricsAdvisorKeyCredential(subscription_key,\ - \ api_key))\n\n results = client.list_metric_dimension_values(\n metric_id=metric_id,\n\ - \ dimension_name=dimension_name,\n )\n for result in results:\n \ - \ print(str(result))\n\n\n ````\n" - uid: azure.ai.metricsadvisor.MetricsAdvisorClient.list_metric_enriched_series_data name: list_metric_enriched_series_data summary: Query series enriched by anomaly detection. @@ -489,24 +355,6 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Query metric enriched series data.\n\n\n\n````python\n\ - \n import datetime\n from azure.ai.metricsadvisor import MetricsAdvisorKeyCredential,\ - \ MetricsAdvisorClient\n\n service_endpoint = os.getenv(\"METRICS_ADVISOR_ENDPOINT\"\ - )\n subscription_key = os.getenv(\"METRICS_ADVISOR_SUBSCRIPTION_KEY\")\n api_key\ - \ = os.getenv(\"METRICS_ADVISOR_API_KEY\")\n detection_configuration_id = os.getenv(\"\ - METRICS_ADVISOR_DETECTION_CONFIGURATION_ID\")\n series_identity = {\"city\"\ - : \"Los Angeles\"}\n\n client = MetricsAdvisorClient(service_endpoint,\n \ - \ MetricsAdvisorKeyCredential(subscription_key, api_key))\n\ - \n results = client.list_metric_enriched_series_data(\n detection_configuration_id=detection_configuration_id,\n\ - \ start_time=datetime.datetime(2020, 9, 1),\n end_time=datetime.datetime(2020,\ - \ 11, 1),\n series=[series_identity]\n )\n for result in results:\n\ - \ print(str(result))\n\n\n ````\n" - uid: azure.ai.metricsadvisor.MetricsAdvisorClient.list_metric_enrichment_status name: list_metric_enrichment_status summary: Query anomaly detection status. @@ -537,23 +385,6 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Query metric enrichment status.\n\n\n\n````python\n\ - \n import datetime\n from azure.ai.metricsadvisor import MetricsAdvisorKeyCredential,\ - \ MetricsAdvisorClient\n\n service_endpoint = os.getenv(\"METRICS_ADVISOR_ENDPOINT\"\ - )\n subscription_key = os.getenv(\"METRICS_ADVISOR_SUBSCRIPTION_KEY\")\n api_key\ - \ = os.getenv(\"METRICS_ADVISOR_API_KEY\")\n metric_id = os.getenv(\"METRICS_ADVISOR_METRIC_ID\"\ - )\n\n client = MetricsAdvisorClient(service_endpoint,\n \ - \ MetricsAdvisorKeyCredential(subscription_key, api_key))\n\n results\ - \ = client.list_metric_enrichment_status(\n metric_id=metric_id,\n \ - \ start_time=datetime.datetime(2020, 1, 1),\n end_time=datetime.datetime(2020,\ - \ 10, 21),\n )\n for result in results:\n print(str(result))\n\n\ - \n ````\n" - uid: azure.ai.metricsadvisor.MetricsAdvisorClient.list_metric_series_data name: list_metric_series_data summary: Get time series data from metric. @@ -587,24 +418,6 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Query metrics series data.\n\ - \n\n\n````python\n\n import datetime\n\ - \ from azure.ai.metricsadvisor import MetricsAdvisorKeyCredential, MetricsAdvisorClient\n\ - \n service_endpoint = os.getenv(\"METRICS_ADVISOR_ENDPOINT\")\n subscription_key\ - \ = os.getenv(\"METRICS_ADVISOR_SUBSCRIPTION_KEY\")\n api_key = os.getenv(\"\ - METRICS_ADVISOR_API_KEY\")\n metric_id = os.getenv(\"METRICS_ADVISOR_METRIC_ID\"\ - )\n\n client = MetricsAdvisorClient(service_endpoint,\n \ - \ MetricsAdvisorKeyCredential(subscription_key, api_key))\n\n results\ - \ = client.list_metric_series_data(\n metric_id=metric_id,\n \ - \ start_time=datetime.datetime(2020, 1, 1),\n end_time=datetime.datetime(2020,\ - \ 10, 21),\n series_keys=[\n {\"city\": \"Los Angeles\"\ - , \"category\": \"Homemade\"}\n ]\n )\n for result in results:\n\ - \ print(str(result))\n\n\n ````\n" - uid: azure.ai.metricsadvisor.MetricsAdvisorClient.list_metric_series_definitions name: list_metric_series_definitions summary: List series (dimension combinations) from metric. @@ -637,19 +450,3 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Query metric series definitions.\n\n\n\n````python\n\ - \n import datetime\n from azure.ai.metricsadvisor import MetricsAdvisorKeyCredential,\ - \ MetricsAdvisorClient\n\n service_endpoint = os.getenv(\"METRICS_ADVISOR_ENDPOINT\"\ - )\n subscription_key = os.getenv(\"METRICS_ADVISOR_SUBSCRIPTION_KEY\")\n api_key\ - \ = os.getenv(\"METRICS_ADVISOR_API_KEY\")\n metric_id = os.getenv(\"METRICS_ADVISOR_METRIC_ID\"\ - )\n\n client = MetricsAdvisorClient(service_endpoint,\n \ - \ MetricsAdvisorKeyCredential(subscription_key, api_key))\n\n results\ - \ = client.list_metric_series_definitions(\n metric_id=metric_id,\n\ - \ active_since=datetime.datetime(2020, 1, 1),\n )\n for result\ - \ in results:\n print(str(result))\n\n\n ````\n" diff --git a/docs-ref-autogen/azure-ai-metricsadvisor/azure.ai.metricsadvisor.aio.MetricsAdvisorAdministrationClient.yml b/docs-ref-autogen/azure-ai-metricsadvisor/azure.ai.metricsadvisor.aio.MetricsAdvisorAdministrationClient.yml index 958fde75501c..247f5f542d02 100644 --- a/docs-ref-autogen/azure-ai-metricsadvisor/azure.ai.metricsadvisor.aio.MetricsAdvisorAdministrationClient.yml +++ b/docs-ref-autogen/azure-ai-metricsadvisor/azure.ai.metricsadvisor.aio.MetricsAdvisorAdministrationClient.yml @@ -28,20 +28,6 @@ constructor: types: - - -examples: -- "Authenticate MetricsAdvisorAdministrationClient with a MetricsAdvisorKeyCredential\n\n\n\n````python\n\n from azure.ai.metricsadvisor\ - \ import MetricsAdvisorKeyCredential\n from azure.ai.metricsadvisor.aio import\ - \ MetricsAdvisorAdministrationClient\n\n service_endpoint = os.getenv(\"METRICS_ADVISOR_ENDPOINT\"\ - )\n subscription_key = os.getenv(\"METRICS_ADVISOR_SUBSCRIPTION_KEY\")\n api_key\ - \ = os.getenv(\"METRICS_ADVISOR_API_KEY\")\n\n client = MetricsAdvisorAdministrationClient(service_endpoint,\n\ - \ MetricsAdvisorKeyCredential(subscription_key,\ - \ api_key))\n\n ````\n" methods: - uid: azure.ai.metricsadvisor.aio.MetricsAdvisorAdministrationClient.close name: close @@ -87,46 +73,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Create an anomaly alert configuration\n\n\n\n````python\n\n from azure.ai.metricsadvisor\ - \ import MetricsAdvisorKeyCredential\n from azure.ai.metricsadvisor.aio import\ - \ MetricsAdvisorAdministrationClient\n from azure.ai.metricsadvisor.models import\ - \ (\n MetricAlertConfiguration,\n MetricAnomalyAlertScope,\n \ - \ TopNGroupScope,\n MetricAnomalyAlertConditions,\n SeverityCondition,\n\ - \ MetricBoundaryCondition,\n MetricAnomalyAlertSnoozeCondition,\n\ - \ )\n service_endpoint = os.getenv(\"METRICS_ADVISOR_ENDPOINT\")\n subscription_key\ - \ = os.getenv(\"METRICS_ADVISOR_SUBSCRIPTION_KEY\")\n api_key = os.getenv(\"\ - METRICS_ADVISOR_API_KEY\")\n detection_configuration_id = os.getenv(\"METRICS_ADVISOR_DETECTION_CONFIGURATION_ID\"\ - )\n hook_id = os.getenv(\"METRICS_ADVISOR_HOOK_ID\")\n\n client = MetricsAdvisorAdministrationClient(service_endpoint,\n\ - \ MetricsAdvisorKeyCredential(subscription_key,\ - \ api_key))\n\n async with client:\n alert_config = await client.create_alert_configuration(\n\ - \ name=\"my alert config\",\n description=\"alert config description\"\ - ,\n cross_metrics_operator=\"AND\",\n metric_alert_configurations=[\n\ - \ MetricAlertConfiguration(\n detection_configuration_id=detection_configuration_id,\n\ - \ alert_scope=MetricAnomalyAlertScope(\n \ - \ scope_type=\"WholeSeries\"\n ),\n alert_conditions=MetricAnomalyAlertConditions(\n\ - \ severity_condition=SeverityCondition(\n \ - \ min_alert_severity=\"Low\",\n max_alert_severity=\"\ - High\"\n )\n )\n ),\n \ - \ MetricAlertConfiguration(\n detection_configuration_id=detection_configuration_id,\n\ - \ alert_scope=MetricAnomalyAlertScope(\n \ - \ scope_type=\"TopN\",\n top_n_group_in_scope=TopNGroupScope(\n\ - \ top=10,\n period=5,\n \ - \ min_top_count=5\n )\n \ - \ ),\n alert_conditions=MetricAnomalyAlertConditions(\n\ - \ metric_boundary_condition=MetricBoundaryCondition(\n \ - \ direction=\"Up\",\n upper=50\n\ - \ )\n ),\n alert_snooze_condition=MetricAnomalyAlertSnoozeCondition(\n\ - \ auto_snooze=2,\n snooze_scope=\"\ - Metric\",\n only_for_successive=True\n \ - \ )\n ),\n ],\n hook_ids=[hook_id]\n \ - \ )\n\n return alert_config\n\n ````\n" - uid: azure.ai.metricsadvisor.aio.MetricsAdvisorAdministrationClient.create_data_feed name: create_data_feed summary: Create a new data feed. @@ -214,40 +160,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Create a data feed\n\n\n\n````python\n\n from azure.ai.metricsadvisor import MetricsAdvisorKeyCredential\n\ - \ from azure.ai.metricsadvisor.aio import MetricsAdvisorAdministrationClient\n\ - \ from azure.ai.metricsadvisor.models import (\n SqlServerDataFeedSource,\n\ - \ DataFeedSchema,\n DataFeedMetric,\n DataFeedDimension,\n \ - \ DataFeedRollupSettings,\n DataFeedMissingDataPointFillSettings,\n\ - \ )\n\n service_endpoint = os.getenv(\"METRICS_ADVISOR_ENDPOINT\")\n subscription_key\ - \ = os.getenv(\"METRICS_ADVISOR_SUBSCRIPTION_KEY\")\n api_key = os.getenv(\"\ - METRICS_ADVISOR_API_KEY\")\n sql_server_connection_string = os.getenv(\"METRICS_ADVISOR_SQL_SERVER_CONNECTION_STRING\"\ - )\n query = os.getenv(\"METRICS_ADVISOR_SQL_SERVER_QUERY\")\n\n client = MetricsAdvisorAdministrationClient(service_endpoint,\n\ - \ MetricsAdvisorKeyCredential(subscription_key,\ - \ api_key))\n async with client:\n data_feed = await client.create_data_feed(\n\ - \ name=\"My data feed\",\n source=SqlServerDataFeedSource(\n\ - \ connection_string=sql_server_connection_string,\n \ - \ query=query,\n ),\n granularity=\"Daily\",\n \ - \ schema=DataFeedSchema(\n metrics=[\n DataFeedMetric(name=\"\ - cost\", display_name=\"Cost\"),\n DataFeedMetric(name=\"revenue\"\ - , display_name=\"Revenue\")\n ],\n dimensions=[\n\ - \ DataFeedDimension(name=\"category\", display_name=\"Category\"\ - ),\n DataFeedDimension(name=\"city\", display_name=\"City\"\ - )\n ],\n timestamp_column=\"Timestamp\"\n \ - \ ),\n ingestion_settings=datetime.datetime(2019, 10, 1),\n \ - \ data_feed_description=\"cost/revenue data feed\",\n rollup_settings=DataFeedRollupSettings(\n\ - \ rollup_type=\"AutoRollup\",\n rollup_method=\"Sum\"\ - ,\n rollup_identification_value=\"__CUSTOM_SUM__\"\n ),\n\ - \ missing_data_point_fill_settings=DataFeedMissingDataPointFillSettings(\n\ - \ fill_type=\"SmartFilling\"\n ),\n access_mode=\"\ - Private\"\n )\n\n return data_feed\n\n\n ````\n" - uid: azure.ai.metricsadvisor.aio.MetricsAdvisorAdministrationClient.create_datasource_credential name: create_datasource_credential summary: Create a new datasource credential. @@ -267,25 +179,6 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Create a datasource credential\n\n\n\n````python\n\n from azure.ai.metricsadvisor import\ - \ MetricsAdvisorKeyCredential, MetricsAdvisorAdministrationClient\n from azure.ai.metricsadvisor.models\ - \ import DatasourceSqlConnectionString\n\n service_endpoint = os.getenv(\"METRICS_ADVISOR_ENDPOINT\"\ - )\n subscription_key = os.getenv(\"METRICS_ADVISOR_SUBSCRIPTION_KEY\")\n api_key\ - \ = os.getenv(\"METRICS_ADVISOR_API_KEY\")\n connection_string = os.getenv(\"\ - SQL_SERVER_CONNECTION_STRING\")\n\n client = MetricsAdvisorAdministrationClient(service_endpoint,\n\ - \ MetricsAdvisorKeyCredential(subscription_key,\ - \ api_key))\n\n datasource_credential = await client.create_datasource_credential(\n\ - \ datasource_credential=DatasourceSqlConnectionString(\n name=\"\ - sql datasource credential\",\n connection_string=connection_string,\n\ - \ description=\"my datasource credential\",\n )\n )\n\n return\ - \ datasource_credential\n\n ````\n" - uid: azure.ai.metricsadvisor.aio.MetricsAdvisorAdministrationClient.create_detection_configuration name: create_detection_configuration summary: Create anomaly detection configuration. @@ -327,39 +220,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Create an anomaly detection configuration\n\n\n\n````python\n\n from azure.ai.metricsadvisor\ - \ import MetricsAdvisorKeyCredential\n from azure.ai.metricsadvisor.aio import\ - \ MetricsAdvisorAdministrationClient\n from azure.ai.metricsadvisor.models import\ - \ (\n ChangeThresholdCondition,\n HardThresholdCondition,\n \ - \ SmartDetectionCondition,\n SuppressCondition,\n MetricDetectionCondition,\n\ - \ )\n\n service_endpoint = os.getenv(\"METRICS_ADVISOR_ENDPOINT\")\n subscription_key\ - \ = os.getenv(\"METRICS_ADVISOR_SUBSCRIPTION_KEY\")\n api_key = os.getenv(\"\ - METRICS_ADVISOR_API_KEY\")\n metric_id = os.getenv(\"METRICS_ADVISOR_METRIC_ID\"\ - )\n\n client = MetricsAdvisorAdministrationClient(service_endpoint,\n \ - \ MetricsAdvisorKeyCredential(subscription_key, api_key))\n\ - \n change_threshold_condition = ChangeThresholdCondition(\n anomaly_detector_direction=\"\ - Both\",\n change_percentage=20,\n shift_point=10,\n within_range=True,\n\ - \ suppress_condition=SuppressCondition(\n min_number=5,\n \ - \ min_ratio=2\n )\n )\n hard_threshold_condition = HardThresholdCondition(\n\ - \ anomaly_detector_direction=\"Up\",\n upper_bound=100,\n suppress_condition=SuppressCondition(\n\ - \ min_number=2,\n min_ratio=2\n )\n )\n smart_detection_condition\ - \ = SmartDetectionCondition(\n anomaly_detector_direction=\"Up\",\n \ - \ sensitivity=10,\n suppress_condition=SuppressCondition(\n \ - \ min_number=2,\n min_ratio=2\n )\n )\n\n async with client:\n\ - \ detection_config = await client.create_detection_configuration(\n \ - \ name=\"my_detection_config\",\n metric_id=metric_id,\n \ - \ description=\"anomaly detection config for metric\",\n whole_series_detection_condition=MetricDetectionCondition(\n\ - \ condition_operator=\"OR\",\n change_threshold_condition=change_threshold_condition,\n\ - \ hard_threshold_condition=hard_threshold_condition,\n \ - \ smart_detection_condition=smart_detection_condition\n )\n \ - \ )\n\n return detection_config\n\n ````\n" - uid: azure.ai.metricsadvisor.aio.MetricsAdvisorAdministrationClient.create_hook name: create_hook summary: Create a new email or web hook. @@ -377,25 +237,6 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Create a notification hook\n\n\n\ - \n````python\n\n from azure.ai.metricsadvisor import MetricsAdvisorKeyCredential\n\ - \ from azure.ai.metricsadvisor.aio import MetricsAdvisorAdministrationClient\n\ - \ from azure.ai.metricsadvisor.models import EmailNotificationHook\n\n service_endpoint\ - \ = os.getenv(\"METRICS_ADVISOR_ENDPOINT\")\n subscription_key = os.getenv(\"\ - METRICS_ADVISOR_SUBSCRIPTION_KEY\")\n api_key = os.getenv(\"METRICS_ADVISOR_API_KEY\"\ - )\n\n client = MetricsAdvisorAdministrationClient(service_endpoint,\n \ - \ MetricsAdvisorKeyCredential(subscription_key, api_key))\n\ - \n async with client:\n hook = await client.create_hook(\n hook=EmailNotificationHook(\n\ - \ name=\"email hook\",\n description=\"my email hook\"\ - ,\n emails_to_alert=[\"alertme@alertme.com\"],\n external_link=\"\ - https://docs.microsoft.com/en-us/azure/cognitive-services/metrics-advisor/how-tos/alerts\"\ - \n )\n )\n\n return hook\n\n ````\n" - uid: azure.ai.metricsadvisor.aio.MetricsAdvisorAdministrationClient.delete_alert_configuration name: delete_alert_configuration summary: Delete an anomaly alert configuration by its ID. @@ -413,24 +254,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Delete an anomaly alert configuration by its ID\n\n\n\n````python\n\n from azure.core.exceptions\ - \ import ResourceNotFoundError\n from azure.ai.metricsadvisor import MetricsAdvisorKeyCredential\n\ - \ from azure.ai.metricsadvisor.aio import MetricsAdvisorAdministrationClient\n\ - \n service_endpoint = os.getenv(\"METRICS_ADVISOR_ENDPOINT\")\n subscription_key\ - \ = os.getenv(\"METRICS_ADVISOR_SUBSCRIPTION_KEY\")\n api_key = os.getenv(\"\ - METRICS_ADVISOR_API_KEY\")\n\n client = MetricsAdvisorAdministrationClient(service_endpoint,\n\ - \ MetricsAdvisorKeyCredential(subscription_key,\ - \ api_key))\n\n async with client:\n await client.delete_alert_configuration(alert_config_id)\n\ - \n try:\n await client.get_alert_configuration(alert_config_id)\n\ - \ except ResourceNotFoundError:\n print(\"Alert configuration\ - \ successfully deleted.\")\n\n ````\n" - uid: azure.ai.metricsadvisor.aio.MetricsAdvisorAdministrationClient.delete_data_feed name: delete_data_feed summary: Delete a data feed by its ID. @@ -447,23 +270,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Delete a data feed by its ID\n\n\n\n````python\n\n from azure.core.exceptions import ResourceNotFoundError\n\ - \ from azure.ai.metricsadvisor import MetricsAdvisorKeyCredential\n from azure.ai.metricsadvisor.aio\ - \ import MetricsAdvisorAdministrationClient\n\n service_endpoint = os.getenv(\"\ - METRICS_ADVISOR_ENDPOINT\")\n subscription_key = os.getenv(\"METRICS_ADVISOR_SUBSCRIPTION_KEY\"\ - )\n api_key = os.getenv(\"METRICS_ADVISOR_API_KEY\")\n\n client = MetricsAdvisorAdministrationClient(service_endpoint,\n\ - \ MetricsAdvisorKeyCredential(subscription_key,\ - \ api_key))\n\n async with client:\n await client.delete_data_feed(data_feed_id)\n\ - \n try:\n await client.get_data_feed(data_feed_id)\n except\ - \ ResourceNotFoundError:\n print(\"Data feed successfully deleted.\"\ - )\n\n\n ````\n" - uid: azure.ai.metricsadvisor.aio.MetricsAdvisorAdministrationClient.delete_datasource_credential name: delete_datasource_credential summary: 'Delete a datasource credential by its ID. @@ -478,21 +284,6 @@ methods: :raises ~azure.core.exceptions.HttpResponseError:' signature: 'async delete_datasource_credential(*credential_id: str, **kwargs: Any) -> None' - examples: - - "Delete a datasource credential by its ID\n\n\n\n````python\n\n from azure.core.exceptions\ - \ import ResourceNotFoundError\n from azure.ai.metricsadvisor import MetricsAdvisorKeyCredential,\ - \ MetricsAdvisorAdministrationClient\n\n service_endpoint = os.getenv(\"METRICS_ADVISOR_ENDPOINT\"\ - )\n subscription_key = os.getenv(\"METRICS_ADVISOR_SUBSCRIPTION_KEY\")\n api_key\ - \ = os.getenv(\"METRICS_ADVISOR_API_KEY\")\n\n client = MetricsAdvisorAdministrationClient(service_endpoint,\n\ - \ MetricsAdvisorKeyCredential(subscription_key,\ - \ api_key))\n\n await client.delete_datasource_credential(credential_id)\n\n\ - \ ````\n" - uid: azure.ai.metricsadvisor.aio.MetricsAdvisorAdministrationClient.delete_detection_configuration name: delete_detection_configuration summary: Delete an anomaly detection configuration by its ID. @@ -510,24 +301,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Delete an anomaly detection configuration by its ID\n\n\n\n````python\n\n from azure.core.exceptions\ - \ import ResourceNotFoundError\n from azure.ai.metricsadvisor import MetricsAdvisorKeyCredential\n\ - \ from azure.ai.metricsadvisor.aio import MetricsAdvisorAdministrationClient\n\ - \n service_endpoint = os.getenv(\"METRICS_ADVISOR_ENDPOINT\")\n subscription_key\ - \ = os.getenv(\"METRICS_ADVISOR_SUBSCRIPTION_KEY\")\n api_key = os.getenv(\"\ - METRICS_ADVISOR_API_KEY\")\n\n client = MetricsAdvisorAdministrationClient(service_endpoint,\n\ - \ MetricsAdvisorKeyCredential(subscription_key,\ - \ api_key))\n\n async with client:\n await client.delete_detection_configuration(detection_config_id)\n\ - \n try:\n await client.get_detection_configuration(detection_config_id)\n\ - \ except ResourceNotFoundError:\n print(\"Detection configuration\ - \ successfully deleted.\")\n\n ````\n" - uid: azure.ai.metricsadvisor.aio.MetricsAdvisorAdministrationClient.delete_hook name: delete_hook summary: Delete a web or email hook by its ID. @@ -544,22 +317,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Delete a hook by its ID\n\n\n\ - \n````python\n\n from azure.core.exceptions import ResourceNotFoundError\n \ - \ from azure.ai.metricsadvisor import MetricsAdvisorKeyCredential\n from azure.ai.metricsadvisor.aio\ - \ import MetricsAdvisorAdministrationClient\n\n service_endpoint = os.getenv(\"\ - METRICS_ADVISOR_ENDPOINT\")\n subscription_key = os.getenv(\"METRICS_ADVISOR_SUBSCRIPTION_KEY\"\ - )\n api_key = os.getenv(\"METRICS_ADVISOR_API_KEY\")\n\n client = MetricsAdvisorAdministrationClient(service_endpoint,\n\ - \ MetricsAdvisorKeyCredential(subscription_key,\ - \ api_key))\n\n async with client:\n await client.delete_hook(hook_id)\n\ - \n try:\n await client.get_hook(hook_id)\n except ResourceNotFoundError:\n\ - \ print(\"Hook successfully deleted.\")\n\n ````\n" - uid: azure.ai.metricsadvisor.aio.MetricsAdvisorAdministrationClient.get_alert_configuration name: get_alert_configuration summary: Get a single anomaly alert configuration. @@ -577,45 +334,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Get a single anomaly alert configuration by its ID\n\n\n\n````python\n\n from azure.ai.metricsadvisor\ - \ import MetricsAdvisorKeyCredential\n from azure.ai.metricsadvisor.aio import\ - \ MetricsAdvisorAdministrationClient\n\n service_endpoint = os.getenv(\"METRICS_ADVISOR_ENDPOINT\"\ - )\n subscription_key = os.getenv(\"METRICS_ADVISOR_SUBSCRIPTION_KEY\")\n api_key\ - \ = os.getenv(\"METRICS_ADVISOR_API_KEY\")\n\n client = MetricsAdvisorAdministrationClient(service_endpoint,\n\ - \ MetricsAdvisorKeyCredential(subscription_key,\ - \ api_key))\n\n async with client:\n config = await client.get_alert_configuration(alert_config_id)\n\ - \n print(\"Alert config ID: {}\".format(config.id))\n print(\"Alert\ - \ config name: {}\".format(config.name))\n print(\"Description: {}\".format(config.description))\n\ - \ print(\"Ids of hooks associated with alert: {}\".format(config.hook_ids))\n\ - \ print(\"Use {} operator for multiple alert conditions\\n\".format(config.cross_metrics_operator))\n\ - \n print(\"Alert uses detection configuration ID: {}\".format(\n \ - \ config.metric_alert_configurations[0].detection_configuration_id\n \ - \ ))\n print(\"Alert scope type: {}\".format(config.metric_alert_configurations[0].alert_scope.scope_type))\n\ - \ print(\"Alert severity condition: min- {}, max- {}\".format(\n \ - \ config.metric_alert_configurations[0].alert_conditions.severity_condition.min_alert_severity,\n\ - \ config.metric_alert_configurations[0].alert_conditions.severity_condition.max_alert_severity,\n\ - \ ))\n print(\"\\nAlert uses detection configuration ID: {}\".format(\n\ - \ config.metric_alert_configurations[1].detection_configuration_id\n\ - \ ))\n print(\"Alert scope type: {}\".format(config.metric_alert_configurations[1].alert_scope.scope_type))\n\ - \ print(\"Top N: {}\".format(config.metric_alert_configurations[1].alert_scope.top_n_group_in_scope.top))\n\ - \ print(\"Point count used to look back: {}\".format(\n config.metric_alert_configurations[1].alert_scope.top_n_group_in_scope.period\n\ - \ ))\n print(\"Min top count: {}\".format(\n config.metric_alert_configurations[1].alert_scope.top_n_group_in_scope.min_top_count\n\ - \ ))\n print(\"Alert metric boundary condition direction: {}, upper\ - \ bound: {}\".format(\n config.metric_alert_configurations[1].alert_conditions.metric_boundary_condition.direction,\n\ - \ config.metric_alert_configurations[1].alert_conditions.metric_boundary_condition.upper,\n\ - \ ))\n print(\"Alert snooze condition, snooze point count: {}\".format(\n\ - \ config.metric_alert_configurations[1].alert_snooze_condition.auto_snooze,\n\ - \ ))\n print(\"Alert snooze scope: {}\".format(\n config.metric_alert_configurations[1].alert_snooze_condition.snooze_scope,\n\ - \ ))\n print(\"Snooze only for successive anomalies?: {}\".format(\n\ - \ config.metric_alert_configurations[1].alert_snooze_condition.only_for_successive,\n\ - \ ))\n\n ````\n" - uid: azure.ai.metricsadvisor.aio.MetricsAdvisorAdministrationClient.get_data_feed name: get_data_feed summary: Get a data feed by its id. @@ -632,36 +350,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Get a data feed by its ID\n\n\n\n````python\n\n from azure.ai.metricsadvisor import MetricsAdvisorKeyCredential\n\ - \ from azure.ai.metricsadvisor.aio import MetricsAdvisorAdministrationClient\n\ - \n service_endpoint = os.getenv(\"METRICS_ADVISOR_ENDPOINT\")\n subscription_key\ - \ = os.getenv(\"METRICS_ADVISOR_SUBSCRIPTION_KEY\")\n api_key = os.getenv(\"\ - METRICS_ADVISOR_API_KEY\")\n\n client = MetricsAdvisorAdministrationClient(service_endpoint,\n\ - \ MetricsAdvisorKeyCredential(subscription_key,\ - \ api_key))\n\n async with client:\n data_feed = await client.get_data_feed(data_feed_id)\n\ - \n print(\"ID: {}\".format(data_feed.id))\n print(\"Data feed name:\ - \ {}\".format(data_feed.name))\n print(\"Created time: {}\".format(data_feed.created_time))\n\ - \ print(\"Status: {}\".format(data_feed.status))\n print(\"Source\ - \ type: {}\".format(data_feed.source.data_source_type))\n print(\"Granularity\ - \ type: {}\".format(data_feed.granularity.granularity_type))\n print(\"\ - Data feed metrics: {}\".format([metric.name for metric in data_feed.schema.metrics]))\n\ - \ print(\"Data feed dimensions: {}\".format([dimension.name for dimension\ - \ in data_feed.schema.dimensions]))\n print(\"Data feed timestamp column:\ - \ {}\".format(data_feed.schema.timestamp_column))\n print(\"Ingestion data\ - \ starting on: {}\".format(data_feed.ingestion_settings.ingestion_begin_time))\n\ - \ print(\"Data feed description: {}\".format(data_feed.data_feed_description))\n\ - \ print(\"Data feed rollup type: {}\".format(data_feed.rollup_settings.rollup_type))\n\ - \ print(\"Data feed rollup method: {}\".format(data_feed.rollup_settings.rollup_method))\n\ - \ print(\"Data feed fill setting: {}\".format(data_feed.missing_data_point_fill_settings.fill_type))\n\ - \ print(\"Data feed access mode: {}\".format(data_feed.access_mode))\n\n\ - \ ````\n" - uid: azure.ai.metricsadvisor.aio.MetricsAdvisorAdministrationClient.get_data_feed_ingestion_progress name: get_data_feed_ingestion_progress summary: Get last successful data ingestion job timestamp by data feed. @@ -681,24 +369,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Get the progress of data feed ingestion\n\n\n\n````python\n\n from azure.ai.metricsadvisor\ - \ import MetricsAdvisorKeyCredential\n from azure.ai.metricsadvisor.aio import\ - \ MetricsAdvisorAdministrationClient\n\n service_endpoint = os.getenv(\"METRICS_ADVISOR_ENDPOINT\"\ - )\n subscription_key = os.getenv(\"METRICS_ADVISOR_SUBSCRIPTION_KEY\")\n api_key\ - \ = os.getenv(\"METRICS_ADVISOR_API_KEY\")\n data_feed_id = os.getenv(\"METRICS_ADVISOR_DATA_FEED_ID\"\ - )\n\n client = MetricsAdvisorAdministrationClient(service_endpoint,\n \ - \ MetricsAdvisorKeyCredential(subscription_key, api_key))\n\ - \n async with client:\n progress = await client.get_data_feed_ingestion_progress(data_feed_id)\n\ - \n print(\"Lastest active timestamp: {}\".format(progress.latest_active_timestamp))\n\ - \ print(\"Latest successful timestamp: {}\".format(progress.latest_success_timestamp))\n\ - \n\n ````\n" - uid: azure.ai.metricsadvisor.aio.MetricsAdvisorAdministrationClient.get_datasource_credential name: get_datasource_credential summary: Get a datasource credential @@ -717,23 +387,6 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Get a datasource credential by its ID\n\n\n\n````python\n\n from azure.ai.metricsadvisor\ - \ import MetricsAdvisorKeyCredential, MetricsAdvisorAdministrationClient\n\n \ - \ service_endpoint = os.getenv(\"METRICS_ADVISOR_ENDPOINT\")\n subscription_key\ - \ = os.getenv(\"METRICS_ADVISOR_SUBSCRIPTION_KEY\")\n api_key = os.getenv(\"\ - METRICS_ADVISOR_API_KEY\")\n\n client = MetricsAdvisorAdministrationClient(service_endpoint,\n\ - \ MetricsAdvisorKeyCredential(subscription_key,\ - \ api_key))\n\n credential = await client.get_datasource_credential(credential_id)\n\ - \n print(\"Credential type: {}\".format(credential.credential_type))\n print(\"\ - Credential name: {}\".format(credential.name))\n print(\"Description: {}\".format(credential.description))\n\ - \n\n ````\n" - uid: azure.ai.metricsadvisor.aio.MetricsAdvisorAdministrationClient.get_detection_configuration name: get_detection_configuration summary: Get a single anomaly detection configuration. @@ -751,48 +404,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Get a single anomaly detection configuration by its ID\n\n\n\n````python\n\n from azure.ai.metricsadvisor\ - \ import MetricsAdvisorKeyCredential\n from azure.ai.metricsadvisor.aio import\ - \ MetricsAdvisorAdministrationClient\n\n service_endpoint = os.getenv(\"METRICS_ADVISOR_ENDPOINT\"\ - )\n subscription_key = os.getenv(\"METRICS_ADVISOR_SUBSCRIPTION_KEY\")\n api_key\ - \ = os.getenv(\"METRICS_ADVISOR_API_KEY\")\n\n client = MetricsAdvisorAdministrationClient(service_endpoint,\n\ - \ MetricsAdvisorKeyCredential(subscription_key,\ - \ api_key))\n\n async with client:\n config = await client.get_detection_configuration(detection_config_id)\n\ - \n print(\"Detection config name: {}\".format(config.name))\n print(\"\ - Description: {}\".format(config.description))\n print(\"Metric ID: {}\"\ - .format(config.metric_id))\n\n print(\"\\nDetection conditions specified\ - \ for configuration...\")\n print(\"\\nWhole Series Detection Conditions:\\\ - n\")\n conditions = config.whole_series_detection_condition\n\n print(\"\ - Use {} operator for multiple detection conditions\".format(conditions.condition_operator))\n\ - \n print(\"Smart Detection Condition:\")\n print(\"- Sensitivity:\ - \ {}\".format(conditions.smart_detection_condition.sensitivity))\n print(\"\ - - Detection direction: {}\".format(conditions.smart_detection_condition.anomaly_detector_direction))\n\ - \ print(\"- Suppress conditions: minimum number: {}; minimum ratio: {}\"\ - .format(\n conditions.smart_detection_condition.suppress_condition.min_number,\n\ - \ conditions.smart_detection_condition.suppress_condition.min_ratio\n\ - \ ))\n\n print(\"Hard Threshold Condition:\")\n print(\"- Lower\ - \ bound: {}\".format(conditions.hard_threshold_condition.lower_bound))\n \ - \ print(\"- Upper bound: {}\".format(conditions.hard_threshold_condition.upper_bound))\n\ - \ print(\"- Detection direction: {}\".format(conditions.smart_detection_condition.anomaly_detector_direction))\n\ - \ print(\"- Suppress conditions: minimum number: {}; minimum ratio: {}\"\ - .format(\n conditions.smart_detection_condition.suppress_condition.min_number,\n\ - \ conditions.smart_detection_condition.suppress_condition.min_ratio\n\ - \ ))\n\n print(\"Change Threshold Condition:\")\n print(\"-\ - \ Change percentage: {}\".format(conditions.change_threshold_condition.change_percentage))\n\ - \ print(\"- Shift point: {}\".format(conditions.change_threshold_condition.shift_point))\n\ - \ print(\"- Detect anomaly if within range: {}\".format(conditions.change_threshold_condition.within_range))\n\ - \ print(\"- Detection direction: {}\".format(conditions.smart_detection_condition.anomaly_detector_direction))\n\ - \ print(\"- Suppress conditions: minimum number: {}; minimum ratio: {}\"\ - .format(\n conditions.smart_detection_condition.suppress_condition.min_number,\n\ - \ conditions.smart_detection_condition.suppress_condition.min_ratio\n\ - \ ))\n\n\n ````\n" - uid: azure.ai.metricsadvisor.aio.MetricsAdvisorAdministrationClient.get_hook name: get_hook summary: Get a web or email hook by its id. @@ -810,24 +421,6 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Get a notification hook by its ID\n\n\n\n````python\n\n from azure.ai.metricsadvisor import\ - \ MetricsAdvisorKeyCredential\n from azure.ai.metricsadvisor.aio import MetricsAdvisorAdministrationClient\n\ - \n service_endpoint = os.getenv(\"METRICS_ADVISOR_ENDPOINT\")\n subscription_key\ - \ = os.getenv(\"METRICS_ADVISOR_SUBSCRIPTION_KEY\")\n api_key = os.getenv(\"\ - METRICS_ADVISOR_API_KEY\")\n\n client = MetricsAdvisorAdministrationClient(service_endpoint,\n\ - \ MetricsAdvisorKeyCredential(subscription_key,\ - \ api_key))\n async with client:\n hook = await client.get_hook(hook_id)\n\ - \n print(\"Hook name: {}\".format(hook.name))\n print(\"Description:\ - \ {}\".format(hook.description))\n print(\"Emails to alert: {}\".format(hook.emails_to_alert))\n\ - \ print(\"External link: {}\".format(hook.external_link))\n print(\"\ - Admins: {}\".format(hook.admins))\n\n\n ````\n" - uid: azure.ai.metricsadvisor.aio.MetricsAdvisorAdministrationClient.list_alert_configurations name: list_alert_configurations summary: Query all anomaly alert configurations for specific anomaly detection configuration. @@ -845,25 +438,6 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "List all anomaly alert configurations for specific anomaly detection configuration\n\n\n\n````python\n\n from azure.ai.metricsadvisor\ - \ import MetricsAdvisorKeyCredential\n from azure.ai.metricsadvisor.aio import\ - \ MetricsAdvisorAdministrationClient\n\n service_endpoint = os.getenv(\"METRICS_ADVISOR_ENDPOINT\"\ - )\n subscription_key = os.getenv(\"METRICS_ADVISOR_SUBSCRIPTION_KEY\")\n api_key\ - \ = os.getenv(\"METRICS_ADVISOR_API_KEY\")\n detection_configuration_id = os.getenv(\"\ - METRICS_ADVISOR_DETECTION_CONFIGURATION_ID\")\n\n client = MetricsAdvisorAdministrationClient(service_endpoint,\n\ - \ MetricsAdvisorKeyCredential(subscription_key,\ - \ api_key))\n\n async with client:\n configs = client.list_alert_configurations(detection_configuration_id)\n\ - \ async for config in configs:\n print(\"Alert config name: {}\"\ - .format(config.name))\n print(\"Alert description: {}\".format(config.description))\n\ - \ print(\"Ids of hooks associated with alert: {}\\n\".format(config.hook_ids))\n\ - \n\n ````\n" - uid: azure.ai.metricsadvisor.aio.MetricsAdvisorAdministrationClient.list_data_feed_ingestion_status name: list_data_feed_ingestion_status summary: Get data ingestion status by data feed. @@ -894,26 +468,6 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "List the data feed ingestion statuses by data feed ID\n\n\n\n````python\n\n import datetime\n from azure.ai.metricsadvisor\ - \ import MetricsAdvisorKeyCredential\n from azure.ai.metricsadvisor.aio import\ - \ MetricsAdvisorAdministrationClient\n\n service_endpoint = os.getenv(\"METRICS_ADVISOR_ENDPOINT\"\ - )\n subscription_key = os.getenv(\"METRICS_ADVISOR_SUBSCRIPTION_KEY\")\n api_key\ - \ = os.getenv(\"METRICS_ADVISOR_API_KEY\")\n data_feed_id = os.getenv(\"METRICS_ADVISOR_DATA_FEED_ID\"\ - )\n\n client = MetricsAdvisorAdministrationClient(service_endpoint,\n \ - \ MetricsAdvisorKeyCredential(subscription_key, api_key))\n\ - \n async with client:\n ingestion_status = client.list_data_feed_ingestion_status(\n\ - \ data_feed_id,\n datetime.datetime(2020, 9, 20),\n \ - \ datetime.datetime(2020, 9, 25)\n )\n async for status in ingestion_status:\n\ - \ print(\"Timestamp: {}\".format(status.timestamp))\n print(\"\ - Status: {}\".format(status.status))\n print(\"Message: {}\\n\".format(status.message))\n\ - \n\n ````\n" - uid: azure.ai.metricsadvisor.aio.MetricsAdvisorAdministrationClient.list_data_feeds name: list_data_feeds summary: List all data feeds. @@ -951,29 +505,6 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "List data feeds under an account.\n\n\n\n````python\n\n from azure.ai.metricsadvisor\ - \ import MetricsAdvisorKeyCredential\n from azure.ai.metricsadvisor.aio import\ - \ MetricsAdvisorAdministrationClient\n\n service_endpoint = os.getenv(\"METRICS_ADVISOR_ENDPOINT\"\ - )\n subscription_key = os.getenv(\"METRICS_ADVISOR_SUBSCRIPTION_KEY\")\n api_key\ - \ = os.getenv(\"METRICS_ADVISOR_API_KEY\")\n\n client = MetricsAdvisorAdministrationClient(service_endpoint,\n\ - \ MetricsAdvisorKeyCredential(subscription_key,\ - \ api_key))\n\n async with client:\n data_feeds = client.list_data_feeds()\n\ - \n async for feed in data_feeds:\n print(\"Data feed name: {}\"\ - .format(feed.name))\n print(\"ID: {}\".format(feed.id))\n \ - \ print(\"Created time: {}\".format(feed.created_time))\n print(\"Status:\ - \ {}\".format(feed.status))\n print(\"Source type: {}\".format(feed.source.data_source_type))\n\ - \ print(\"Granularity type: {}\".format(feed.granularity.granularity_type))\n\ - \n print(\"\\nFeed metrics:\")\n for metric in feed.schema.metrics:\n\ - \ print(metric.name)\n\n print(\"\\nFeed dimensions:\"\ - )\n for dimension in feed.schema.dimensions:\n print(dimension.name)\n\ - \n\n ````\n" - uid: azure.ai.metricsadvisor.aio.MetricsAdvisorAdministrationClient.list_datasource_credentials name: list_datasource_credentials summary: List all datasource credential. @@ -991,23 +522,6 @@ methods: - [[]] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "List all of the datasource credentials under the account\n\n\n\n````python\n\n from azure.ai.metricsadvisor\ - \ import MetricsAdvisorKeyCredential, MetricsAdvisorAdministrationClient\n\n \ - \ service_endpoint = os.getenv(\"METRICS_ADVISOR_ENDPOINT\")\n subscription_key\ - \ = os.getenv(\"METRICS_ADVISOR_SUBSCRIPTION_KEY\")\n api_key = os.getenv(\"\ - METRICS_ADVISOR_API_KEY\")\n\n client = MetricsAdvisorAdministrationClient(service_endpoint,\n\ - \ MetricsAdvisorKeyCredential(subscription_key,\ - \ api_key))\n\n credentials = client.list_datasource_credentials()\n async\ - \ for credential in credentials:\n print(\"Credential type: {}\".format(credential.credential_type))\n\ - \ print(\"Credential name: {}\".format(credential.name))\n print(\"\ - Description: {}\\n\".format(credential.description))\n\n\n ````\n" - uid: azure.ai.metricsadvisor.aio.MetricsAdvisorAdministrationClient.list_detection_configurations name: list_detection_configurations summary: Query all anomaly detection configurations for specific metric. @@ -1024,24 +538,6 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "List all anomaly detection configurations for a specific metric\n\n\n\n````python\n\n from azure.ai.metricsadvisor\ - \ import MetricsAdvisorKeyCredential\n from azure.ai.metricsadvisor.aio import\ - \ MetricsAdvisorAdministrationClient\n\n service_endpoint = os.getenv(\"METRICS_ADVISOR_ENDPOINT\"\ - )\n subscription_key = os.getenv(\"METRICS_ADVISOR_SUBSCRIPTION_KEY\")\n api_key\ - \ = os.getenv(\"METRICS_ADVISOR_API_KEY\")\n metric_id = os.getenv(\"METRICS_ADVISOR_METRIC_ID\"\ - )\n\n client = MetricsAdvisorAdministrationClient(service_endpoint,\n \ - \ MetricsAdvisorKeyCredential(subscription_key, api_key))\n\ - \n async with client:\n configs = client.list_detection_configurations(metric_id=metric_id)\n\ - \ async for config in configs:\n print(\"Detection config name:\ - \ {}\".format(config.name))\n print(\"Description: {}\".format(config.description))\n\ - \ print(\"Metric ID: {}\\n\".format(config.metric_id))\n\n\n ````\n" - uid: azure.ai.metricsadvisor.aio.MetricsAdvisorAdministrationClient.list_hooks name: list_hooks summary: List all hooks. @@ -1062,23 +558,6 @@ methods: ]] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "List all the notification hooks under an account\n\n\n\n````python\n\n from azure.ai.metricsadvisor\ - \ import MetricsAdvisorKeyCredential\n from azure.ai.metricsadvisor.aio import\ - \ MetricsAdvisorAdministrationClient\n\n service_endpoint = os.getenv(\"METRICS_ADVISOR_ENDPOINT\"\ - )\n subscription_key = os.getenv(\"METRICS_ADVISOR_SUBSCRIPTION_KEY\")\n api_key\ - \ = os.getenv(\"METRICS_ADVISOR_API_KEY\")\n\n client = MetricsAdvisorAdministrationClient(service_endpoint,\n\ - \ MetricsAdvisorKeyCredential(subscription_key,\ - \ api_key))\n\n async with client:\n hooks = client.list_hooks()\n \ - \ async for hook in hooks:\n print(\"Hook type: {}\".format(hook.hook_type))\n\ - \ print(\"Hook name: {}\".format(hook.name))\n print(\"Description:\ - \ {}\\n\".format(hook.description))\n\n\n ````\n" - uid: azure.ai.metricsadvisor.aio.MetricsAdvisorAdministrationClient.refresh_data_feed_ingestion name: refresh_data_feed_ingestion summary: Refreshes data ingestion by data feed to backfill data. @@ -1106,23 +585,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Refresh data feed ingestion over a period of time\n\n\n\n````python\n\n import datetime\n from azure.ai.metricsadvisor\ - \ import MetricsAdvisorKeyCredential\n from azure.ai.metricsadvisor.aio import\ - \ MetricsAdvisorAdministrationClient\n\n service_endpoint = os.getenv(\"METRICS_ADVISOR_ENDPOINT\"\ - )\n subscription_key = os.getenv(\"METRICS_ADVISOR_SUBSCRIPTION_KEY\")\n api_key\ - \ = os.getenv(\"METRICS_ADVISOR_API_KEY\")\n data_feed_id = os.getenv(\"METRICS_ADVISOR_DATA_FEED_ID\"\ - )\n\n client = MetricsAdvisorAdministrationClient(service_endpoint,\n \ - \ MetricsAdvisorKeyCredential(subscription_key, api_key))\n\ - \n async with client:\n await client.refresh_data_feed_ingestion(\n \ - \ data_feed_id,\n datetime.datetime(2020, 9, 20),\n \ - \ datetime.datetime(2020, 9, 25)\n )\n\n\n ````\n" - uid: azure.ai.metricsadvisor.aio.MetricsAdvisorAdministrationClient.update_alert_configuration name: update_alert_configuration summary: 'Update anomaly alerting configuration. Either pass the entire AnomalyAlertConfiguration @@ -1173,38 +635,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Update an existing anomaly alert configuration\n\n\n\n````python\n\n from azure.ai.metricsadvisor\ - \ import MetricsAdvisorKeyCredential\n from azure.ai.metricsadvisor.aio import\ - \ MetricsAdvisorAdministrationClient\n from azure.ai.metricsadvisor.models import\ - \ (\n MetricAlertConfiguration,\n MetricAnomalyAlertScope,\n \ - \ MetricAnomalyAlertConditions,\n MetricBoundaryCondition\n )\n service_endpoint\ - \ = os.getenv(\"METRICS_ADVISOR_ENDPOINT\")\n subscription_key = os.getenv(\"\ - METRICS_ADVISOR_SUBSCRIPTION_KEY\")\n api_key = os.getenv(\"METRICS_ADVISOR_API_KEY\"\ - )\n detection_configuration_id = os.getenv(\"METRICS_ADVISOR_DETECTION_CONFIGURATION_ID\"\ - )\n\n client = MetricsAdvisorAdministrationClient(service_endpoint,\n \ - \ MetricsAdvisorKeyCredential(subscription_key, api_key))\n\ - \n alert_config.name = \"updated config name\"\n additional_alert = MetricAlertConfiguration(\n\ - \ detection_configuration_id=detection_configuration_id,\n alert_scope=MetricAnomalyAlertScope(\n\ - \ scope_type=\"SeriesGroup\",\n series_group_in_scope={'city':\ - \ 'Shenzhen'}\n ),\n alert_conditions=MetricAnomalyAlertConditions(\n\ - \ metric_boundary_condition=MetricBoundaryCondition(\n \ - \ direction=\"Down\",\n lower=5\n )\n )\n )\n\ - \ alert_config.metric_alert_configurations.append(additional_alert)\n\n async\ - \ with client:\n updated = await client.update_alert_configuration(\n \ - \ alert_config,\n cross_metrics_operator=\"OR\",\n \ - \ description=\"updated alert config\"\n )\n print(\"Updated alert\ - \ name: {}\".format(updated.name))\n print(\"Updated alert description:\ - \ {}\".format(updated.description))\n print(\"Updated cross metrics operator:\ - \ {}\".format(updated.cross_metrics_operator))\n print(\"Updated alert condition\ - \ configuration scope type: {}\".format(\n updated.metric_alert_configurations[2].alert_scope.scope_type\n\ - \ ))\n\n\n ````\n" - uid: azure.ai.metricsadvisor.aio.MetricsAdvisorAdministrationClient.update_data_feed name: update_data_feed summary: 'Update a data feed. Either pass the entire DataFeed object with the chosen @@ -1340,30 +770,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Update an existing data feed\n\n\n\n````python\n\n from azure.ai.metricsadvisor import MetricsAdvisorKeyCredential\n\ - \ from azure.ai.metricsadvisor.aio import MetricsAdvisorAdministrationClient\n\ - \n service_endpoint = os.getenv(\"METRICS_ADVISOR_ENDPOINT\")\n subscription_key\ - \ = os.getenv(\"METRICS_ADVISOR_SUBSCRIPTION_KEY\")\n api_key = os.getenv(\"\ - METRICS_ADVISOR_API_KEY\")\n\n client = MetricsAdvisorAdministrationClient(service_endpoint,\n\ - \ MetricsAdvisorKeyCredential(subscription_key,\ - \ api_key))\n\n # update data feed on the data feed itself or by using available\ - \ keyword arguments\n data_feed.name = \"updated name\"\n data_feed.data_feed_description\ - \ = \"updated description for data feed\"\n\n async with client:\n updated\ - \ = await client.update_data_feed(\n data_feed,\n access_mode=\"\ - Public\",\n fill_type=\"CustomValue\",\n custom_fill_value=1\n\ - \ )\n print(\"Updated name: {}\".format(updated.name))\n print(\"\ - Updated description: {}\".format(updated.data_feed_description))\n print(\"\ - Updated access mode: {}\".format(updated.access_mode))\n print(\"Updated\ - \ fill setting, value: {}, {}\".format(\n updated.missing_data_point_fill_settings.fill_type,\n\ - \ updated.missing_data_point_fill_settings.custom_fill_value,\n \ - \ ))\n\n ````\n" - uid: azure.ai.metricsadvisor.aio.MetricsAdvisorAdministrationClient.update_datasource_credential name: update_datasource_credential summary: Update a credential entity. @@ -1382,24 +788,6 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Update an existing datasource credential\n\n\n\n````python\n\n from azure.ai.metricsadvisor\ - \ import MetricsAdvisorKeyCredential, MetricsAdvisorAdministrationClient\n\n \ - \ service_endpoint = os.getenv(\"METRICS_ADVISOR_ENDPOINT\")\n subscription_key\ - \ = os.getenv(\"METRICS_ADVISOR_SUBSCRIPTION_KEY\")\n api_key = os.getenv(\"\ - METRICS_ADVISOR_API_KEY\")\n\n client = MetricsAdvisorAdministrationClient(service_endpoint,\n\ - \ MetricsAdvisorKeyCredential(subscription_key,\ - \ api_key))\n\n datasource_credential.description = \"updated description\"\n\ - \n updated = await client.update_datasource_credential(datasource_credential)\n\ - \ print(\"Credential type: {}\".format(updated.credential_type))\n print(\"\ - Credential name: {}\".format(updated.name))\n print(\"Description: {}\\n\".format(updated.description))\n\ - \n ````\n" - uid: azure.ai.metricsadvisor.aio.MetricsAdvisorAdministrationClient.update_detection_configuration name: update_detection_configuration summary: 'Update anomaly metric detection configuration. Either pass the entire @@ -1455,41 +843,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Update an existing anomaly detection configuration\n\n\n\n````python\n\n from azure.ai.metricsadvisor\ - \ import MetricsAdvisorKeyCredential\n from azure.ai.metricsadvisor.aio import\ - \ MetricsAdvisorAdministrationClient\n from azure.ai.metricsadvisor.models import\ - \ (\n MetricSeriesGroupDetectionCondition,\n MetricSingleSeriesDetectionCondition,\n\ - \ SmartDetectionCondition,\n SuppressCondition\n )\n\n service_endpoint\ - \ = os.getenv(\"METRICS_ADVISOR_ENDPOINT\")\n subscription_key = os.getenv(\"\ - METRICS_ADVISOR_SUBSCRIPTION_KEY\")\n api_key = os.getenv(\"METRICS_ADVISOR_API_KEY\"\ - )\n\n client = MetricsAdvisorAdministrationClient(service_endpoint,\n \ - \ MetricsAdvisorKeyCredential(subscription_key, api_key))\n\ - \n detection_config.name = \"updated config name\"\n detection_config.description\ - \ = \"updated with more detection conditions\"\n smart_detection_condition =\ - \ SmartDetectionCondition(\n anomaly_detector_direction=\"Up\",\n \ - \ sensitivity=10,\n suppress_condition=SuppressCondition(\n min_number=2,\n\ - \ min_ratio=2\n )\n )\n\n async with client:\n updated\ - \ = await client.update_detection_configuration(\n detection_config,\n\ - \ series_group_detection_conditions=[\n MetricSeriesGroupDetectionCondition(\n\ - \ series_group_key={\"city\": \"Seoul\"},\n \ - \ smart_detection_condition=smart_detection_condition\n )\n \ - \ ],\n series_detection_conditions=[\n MetricSingleSeriesDetectionCondition(\n\ - \ series_key={\"city\": \"Osaka\", \"category\": \"Cell Phones\"\ - },\n smart_detection_condition=smart_detection_condition\n \ - \ )\n ]\n )\n print(\"Updated detection name:\ - \ {}\".format(updated.name))\n print(\"Updated detection description: {}\"\ - .format(updated.description))\n print(\"Updated detection condition for\ - \ series group: {}\".format(\n updated.series_group_detection_conditions[0].series_group_key\n\ - \ ))\n print(\"Updated detection condition for series: {}\".format(\n\ - \ updated.series_detection_conditions[0].series_key\n ))\n\n\n\ - \ ````\n" - uid: azure.ai.metricsadvisor.aio.MetricsAdvisorAdministrationClient.update_hook name: update_hook summary: 'Update a hook. Either pass the entire EmailNotificationHook or WebNotificationHook @@ -1561,22 +914,3 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Update an existing notification hook\n\n\n\n````python\n\n from azure.ai.metricsadvisor import\ - \ MetricsAdvisorKeyCredential\n from azure.ai.metricsadvisor.aio import MetricsAdvisorAdministrationClient\n\ - \n service_endpoint = os.getenv(\"METRICS_ADVISOR_ENDPOINT\")\n subscription_key\ - \ = os.getenv(\"METRICS_ADVISOR_SUBSCRIPTION_KEY\")\n api_key = os.getenv(\"\ - METRICS_ADVISOR_API_KEY\")\n\n client = MetricsAdvisorAdministrationClient(service_endpoint,\n\ - \ MetricsAdvisorKeyCredential(subscription_key,\ - \ api_key))\n\n hook.name = \"updated hook name\"\n hook.description = \"\ - updated hook description\"\n\n async with client:\n updated = await client.update_hook(\n\ - \ hook,\n emails_to_alert=[\"newemail@alertme.com\"]\n \ - \ )\n print(\"Updated name: {}\".format(updated.name))\n print(\"\ - Updated description: {}\".format(updated.description))\n print(\"Updated\ - \ emails: {}\".format(updated.emails_to_alert))\n\n ````\n" diff --git a/docs-ref-autogen/azure-ai-metricsadvisor/azure.ai.metricsadvisor.aio.MetricsAdvisorClient.yml b/docs-ref-autogen/azure-ai-metricsadvisor/azure.ai.metricsadvisor.aio.MetricsAdvisorClient.yml index a444d429ac40..1de4c3390a46 100644 --- a/docs-ref-autogen/azure-ai-metricsadvisor/azure.ai.metricsadvisor.aio.MetricsAdvisorClient.yml +++ b/docs-ref-autogen/azure-ai-metricsadvisor/azure.ai.metricsadvisor.aio.MetricsAdvisorClient.yml @@ -44,44 +44,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Add new feedback.\n\n\n\n````python\n\n from azure.ai.metricsadvisor import MetricsAdvisorKeyCredential\n\ - \ from azure.ai.metricsadvisor.aio import MetricsAdvisorClient\n from azure.ai.metricsadvisor.models\ - \ import AnomalyFeedback, ChangePointFeedback, CommentFeedback, PeriodFeedback\n\ - \n service_endpoint = os.getenv(\"METRICS_ADVISOR_ENDPOINT\")\n subscription_key\ - \ = os.getenv(\"METRICS_ADVISOR_SUBSCRIPTION_KEY\")\n api_key = os.getenv(\"\ - METRICS_ADVISOR_API_KEY\")\n metric_id = os.getenv(\"METRICS_ADVISOR_METRIC_ID\"\ - )\n\n client = MetricsAdvisorClient(service_endpoint,\n \ - \ MetricsAdvisorKeyCredential(subscription_key, api_key))\n\n anomaly_feedback\ - \ = AnomalyFeedback(metric_id=metric_id,\n \ - \ dimension_key={\"Dim1\": \"Common Lime\"},\n \ - \ start_time=datetime.datetime(2020, 8, 5),\n \ - \ end_time=datetime.datetime(2020, 8, 7),\n \ - \ value=\"NotAnomaly\")\n await client.add_feedback(anomaly_feedback)\n\ - \n change_point_feedback = ChangePointFeedback(metric_id=metric_id,\n \ - \ dimension_key={\"Dim1\": \"Common Lime\"\ - },\n start_time=datetime.datetime(2020,\ - \ 8, 5),\n end_time=datetime.datetime(2020,\ - \ 8, 7),\n value=\"NotChangePoint\"\ - )\n await client.add_feedback(change_point_feedback)\n\n comment_feedback\ - \ = CommentFeedback(metric_id=metric_id,\n \ - \ dimension_key={\"Dim1\": \"Common Lime\"},\n \ - \ start_time=datetime.datetime(2020, 8, 5),\n \ - \ end_time=datetime.datetime(2020, 8, 7),\n \ - \ value=\"comment\")\n await client.add_feedback(comment_feedback)\n\ - \n period_feedback = PeriodFeedback(metric_id=metric_id,\n \ - \ dimension_key={\"Dim1\": \"Common Lime\"},\n \ - \ start_time=datetime.datetime(2020, 8, 5),\n \ - \ end_time=datetime.datetime(2020, 8, 7),\n \ - \ period_type=\"AssignValue\",\n \ - \ value=2)\n await client.add_feedback(period_feedback)\n\n\ - \ ````\n" - uid: azure.ai.metricsadvisor.aio.MetricsAdvisorClient.close name: close summary: Close the session. @@ -107,22 +69,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Get a metric feedback by its id.\n\n\n\n````python\n\n from azure.ai.metricsadvisor\ - \ import MetricsAdvisorKeyCredential\n from azure.ai.metricsadvisor.aio import\ - \ MetricsAdvisorClient\n\n service_endpoint = os.getenv(\"METRICS_ADVISOR_ENDPOINT\"\ - )\n subscription_key = os.getenv(\"METRICS_ADVISOR_SUBSCRIPTION_KEY\")\n api_key\ - \ = os.getenv(\"METRICS_ADVISOR_API_KEY\")\n feedback_id = os.getenv(\"METRICS_ADVISOR_FEEDBACK_ID\"\ - )\n\n client = MetricsAdvisorClient(service_endpoint,\n \ - \ MetricsAdvisorKeyCredential(subscription_key, api_key))\n\n result\ - \ = await client.get_feedback(feedback_id=feedback_id)\n print(\"Type: {}; Id:\ - \ {}\".format(result.feedback_type, result.id))\n\n ````\n" - uid: azure.ai.metricsadvisor.aio.MetricsAdvisorClient.list_alerts name: list_alerts summary: Query alerts under anomaly alert configuration. @@ -161,26 +107,6 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Query anomaly detection results.\n\n\n\n````python\n\n import datetime\n\ - \ from azure.ai.metricsadvisor import MetricsAdvisorKeyCredential\n from azure.ai.metricsadvisor.aio\ - \ import MetricsAdvisorClient\n\n service_endpoint = os.getenv(\"METRICS_ADVISOR_ENDPOINT\"\ - )\n subscription_key = os.getenv(\"METRICS_ADVISOR_SUBSCRIPTION_KEY\")\n api_key\ - \ = os.getenv(\"METRICS_ADVISOR_API_KEY\")\n\n client = MetricsAdvisorClient(service_endpoint,\n\ - \ MetricsAdvisorKeyCredential(subscription_key,\ - \ api_key))\n\n async with client:\n results = client.list_alerts(\n \ - \ alert_configuration_id=alert_config_id,\n start_time=datetime.datetime(2020,\ - \ 1, 1),\n end_time=datetime.datetime(2020, 9, 9),\n time_mode=\"\ - AnomalyTime\",\n )\n tolist = []\n async for result in results:\n\ - \ tolist.append(result)\n print(\"Alert id: {}\".format(result.id))\n\ - \ print(\"Create time: {}\".format(result.created_time))\n return\ - \ tolist\n\n\n ````\n" - uid: azure.ai.metricsadvisor.aio.MetricsAdvisorClient.list_anomalies name: list_anomalies summary: Query anomalies under a specific alert or detection configuration. @@ -258,26 +184,6 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Query dimension values.\n\n\n\n````python\n\n import datetime\n from azure.ai.metricsadvisor\ - \ import MetricsAdvisorKeyCredential\n from azure.ai.metricsadvisor.aio import\ - \ MetricsAdvisorClient\n\n service_endpoint = os.getenv(\"METRICS_ADVISOR_ENDPOINT\"\ - )\n subscription_key = os.getenv(\"METRICS_ADVISOR_SUBSCRIPTION_KEY\")\n api_key\ - \ = os.getenv(\"METRICS_ADVISOR_API_KEY\")\n detection_configuration_id = os.getenv(\"\ - METRICS_ADVISOR_DETECTION_CONFIGURATION_ID\")\n dimension_name = \"city\"\n\n\ - \ client = MetricsAdvisorClient(service_endpoint,\n \ - \ MetricsAdvisorKeyCredential(subscription_key, api_key))\n\n async\ - \ with client:\n results = client.list_anomaly_dimension_values(\n \ - \ detection_configuration_id=detection_configuration_id,\n dimension_name=dimension_name,\n\ - \ start_time=datetime.datetime(2020, 1, 1),\n end_time=datetime.datetime(2020,\ - \ 10, 21),\n )\n async for result in results:\n print(str(result))\n\ - \n\n ````\n" - uid: azure.ai.metricsadvisor.aio.MetricsAdvisorClient.list_feedback name: list_feedback summary: List feedback on the given metric. @@ -326,23 +232,6 @@ methods: , ]] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "List feedback on the given metric.\n\n\n\n````python\n\n from azure.ai.metricsadvisor\ - \ import MetricsAdvisorKeyCredential\n from azure.ai.metricsadvisor.aio import\ - \ MetricsAdvisorClient\n\n service_endpoint = os.getenv(\"METRICS_ADVISOR_ENDPOINT\"\ - )\n subscription_key = os.getenv(\"METRICS_ADVISOR_SUBSCRIPTION_KEY\")\n api_key\ - \ = os.getenv(\"METRICS_ADVISOR_API_KEY\")\n metric_id = os.getenv(\"METRICS_ADVISOR_METRIC_ID\"\ - )\n\n client = MetricsAdvisorClient(service_endpoint,\n \ - \ MetricsAdvisorKeyCredential(subscription_key, api_key))\n\n results\ - \ = client.list_feedback(metric_id=metric_id)\n async for result in results:\n\ - \ print(\"Type: {}; Id: {}\".format(result.feedback_type, result.id))\n\n\ - \ ````\n" - uid: azure.ai.metricsadvisor.aio.MetricsAdvisorClient.list_incident_root_causes name: list_incident_root_causes summary: Query root cause for incident. @@ -365,25 +254,6 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Query incident root causes.\n\n\n\n````python\n\n from azure.ai.metricsadvisor import MetricsAdvisorKeyCredential\n\ - \ from azure.ai.metricsadvisor.aio import MetricsAdvisorClient\n\n service_endpoint\ - \ = os.getenv(\"METRICS_ADVISOR_ENDPOINT\")\n subscription_key = os.getenv(\"\ - METRICS_ADVISOR_SUBSCRIPTION_KEY\")\n api_key = os.getenv(\"METRICS_ADVISOR_API_KEY\"\ - )\n detection_configuration_id = os.getenv(\"METRICS_ADVISOR_DETECTION_CONFIGURATION_ID\"\ - )\n incident_id = os.getenv(\"METRICS_ADVISOR_INCIDENT_ID\")\n\n client =\ - \ MetricsAdvisorClient(service_endpoint,\n MetricsAdvisorKeyCredential(subscription_key,\ - \ api_key))\n async with client:\n results = client.list_incident_root_causes(\n\ - \ detection_configuration_id=detection_configuration_id,\n \ - \ incident_id=incident_id,\n )\n async for result in results:\n \ - \ print(\"Score: {}\".format(result.score))\n print(\"Description:\ - \ {}\".format(result.description))\n\n\n ````\n" - uid: azure.ai.metricsadvisor.aio.MetricsAdvisorClient.list_incidents name: list_incidents summary: Query incidents under a specific alert or detection configuration. @@ -451,24 +321,6 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Query metric dimension values.\n\n\n\n````python\n\n from azure.ai.metricsadvisor import MetricsAdvisorKeyCredential\n\ - \ from azure.ai.metricsadvisor.aio import MetricsAdvisorClient\n\n service_endpoint\ - \ = os.getenv(\"METRICS_ADVISOR_ENDPOINT\")\n subscription_key = os.getenv(\"\ - METRICS_ADVISOR_SUBSCRIPTION_KEY\")\n api_key = os.getenv(\"METRICS_ADVISOR_API_KEY\"\ - )\n metric_id = os.getenv(\"METRICS_ADVISOR_METRIC_ID\")\n dimension_name\ - \ = \"city\"\n\n client = MetricsAdvisorClient(service_endpoint,\n \ - \ MetricsAdvisorKeyCredential(subscription_key, api_key))\n\ - \n async with client:\n results = client.list_metric_dimension_values(\n\ - \ metric_id=metric_id,\n dimension_name=dimension_name,\n\ - \ )\n async for result in results:\n print(str(result))\n\ - \n\n ````\n" - uid: azure.ai.metricsadvisor.aio.MetricsAdvisorClient.list_metric_enriched_series_data name: list_metric_enriched_series_data summary: Query series enriched by anomaly detection. @@ -503,26 +355,6 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Query metric enriched series data.\n\n\n\n````python\n\n import datetime\n from azure.ai.metricsadvisor\ - \ import MetricsAdvisorKeyCredential\n from azure.ai.metricsadvisor.aio import\ - \ MetricsAdvisorClient\n\n service_endpoint = os.getenv(\"METRICS_ADVISOR_ENDPOINT\"\ - )\n subscription_key = os.getenv(\"METRICS_ADVISOR_SUBSCRIPTION_KEY\")\n api_key\ - \ = os.getenv(\"METRICS_ADVISOR_API_KEY\")\n detection_configuration_id = os.getenv(\"\ - METRICS_ADVISOR_DETECTION_CONFIGURATION_ID\")\n series_identity = {\"city\"\ - : \"Los Angeles\"}\n\n client = MetricsAdvisorClient(service_endpoint,\n \ - \ MetricsAdvisorKeyCredential(subscription_key, api_key))\n\ - \n async with client:\n results = client.list_metric_enriched_series_data(\n\ - \ detection_configuration_id=detection_configuration_id,\n \ - \ start_time=datetime.datetime(2020, 9, 1),\n end_time=datetime.datetime(2020,\ - \ 11, 1),\n series=[series_identity]\n )\n async for result\ - \ in results:\n print(str(result))\n\n\n ````\n" - uid: azure.ai.metricsadvisor.aio.MetricsAdvisorClient.list_metric_enrichment_status name: list_metric_enrichment_status summary: Query anomaly detection status. @@ -553,25 +385,6 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Query metric enrichment status.\n\n\n\n````python\n\n import datetime\n from azure.ai.metricsadvisor\ - \ import MetricsAdvisorKeyCredential\n from azure.ai.metricsadvisor.aio import\ - \ MetricsAdvisorClient\n\n service_endpoint = os.getenv(\"METRICS_ADVISOR_ENDPOINT\"\ - )\n subscription_key = os.getenv(\"METRICS_ADVISOR_SUBSCRIPTION_KEY\")\n api_key\ - \ = os.getenv(\"METRICS_ADVISOR_API_KEY\")\n metric_id = os.getenv(\"METRICS_ADVISOR_METRIC_ID\"\ - )\n\n client = MetricsAdvisorClient(service_endpoint,\n \ - \ MetricsAdvisorKeyCredential(subscription_key, api_key))\n\n async\ - \ with client:\n results = client.list_metric_enrichment_status(\n \ - \ metric_id=metric_id,\n start_time=datetime.datetime(2020,\ - \ 1, 1),\n end_time=datetime.datetime(2020, 10, 21),\n \ - \ )\n async for result in results:\n print(str(result))\n\n\n\ - \ ````\n" - uid: azure.ai.metricsadvisor.aio.MetricsAdvisorClient.list_metric_series_data name: list_metric_series_data summary: Get time series data from metric. @@ -605,26 +418,6 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Query metrics series data.\n\n\n\n````python\n\n import datetime\n from azure.ai.metricsadvisor\ - \ import MetricsAdvisorKeyCredential\n from azure.ai.metricsadvisor.aio import\ - \ MetricsAdvisorClient\n\n service_endpoint = os.getenv(\"METRICS_ADVISOR_ENDPOINT\"\ - )\n subscription_key = os.getenv(\"METRICS_ADVISOR_SUBSCRIPTION_KEY\")\n api_key\ - \ = os.getenv(\"METRICS_ADVISOR_API_KEY\")\n metric_id = os.getenv(\"METRICS_ADVISOR_METRIC_ID\"\ - )\n\n client = MetricsAdvisorClient(service_endpoint,\n \ - \ MetricsAdvisorKeyCredential(subscription_key, api_key))\n\n async\ - \ with client:\n results = client.list_metric_series_data(\n \ - \ metric_id=metric_id,\n start_time=datetime.datetime(2020, 1,\ - \ 1),\n end_time=datetime.datetime(2020, 10, 21),\n \ - \ series_keys=[\n {\"city\": \"Los Angeles\", \"category\"\ - : \"Homemade\"}\n ]\n )\n async for result in results:\n\ - \ print(str(result))\n\n\n ````\n" - uid: azure.ai.metricsadvisor.aio.MetricsAdvisorClient.list_metric_series_definitions name: list_metric_series_definitions summary: List series (dimension combinations) from metric. @@ -657,21 +450,3 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Query metric series definitions.\n\n\n\n````python\n\n import datetime\n from azure.ai.metricsadvisor\ - \ import MetricsAdvisorKeyCredential\n from azure.ai.metricsadvisor.aio import\ - \ MetricsAdvisorClient\n\n service_endpoint = os.getenv(\"METRICS_ADVISOR_ENDPOINT\"\ - )\n subscription_key = os.getenv(\"METRICS_ADVISOR_SUBSCRIPTION_KEY\")\n api_key\ - \ = os.getenv(\"METRICS_ADVISOR_API_KEY\")\n metric_id = os.getenv(\"METRICS_ADVISOR_METRIC_ID\"\ - )\n\n client = MetricsAdvisorClient(service_endpoint,\n \ - \ MetricsAdvisorKeyCredential(subscription_key, api_key))\n\n async\ - \ with client:\n results = client.list_metric_series_definitions(\n \ - \ metric_id=metric_id,\n active_since=datetime.datetime(2020,\ - \ 1, 1),\n )\n async for result in results:\n print(str(result))\n\ - \n\n ````\n" diff --git a/docs-ref-autogen/azure-ai-ml/azure.ai.ml.MLClient.yml b/docs-ref-autogen/azure-ai-ml/azure.ai.ml.MLClient.yml index 1db579d8594b..81030b6be606 100644 --- a/docs-ref-autogen/azure-ai-ml/azure.ai.ml.MLClient.yml +++ b/docs-ref-autogen/azure-ai-ml/azure.ai.ml.MLClient.yml @@ -107,33 +107,6 @@ constructor: isRequired: true types: - [] -examples: -- "Creating the MLClient with Azure Identity credentials.\n\n\n\n````python\n\n # Get a credential for authentication\n\ - \ # Default Azure Credentials attempt a chained set of authentication methods,\ - \ per documentation here: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/identity/azure-identity\n\ - \ # Alternately, one can specify the AZURE_TENANT_ID, AZURE_CLIENT_ID, and AZURE_CLIENT_SECRET\ - \ to use the EnvironmentCredentialClass.\n # The docs above specify all mechanisms\ - \ which the defaultCredential internally support.\n # Enter details of your subscription\n\ - \ subscription_id = os.environ[\"AZURE_SUBSCRIPTION_ID\"]\n resource_group =\ - \ os.environ[\"RESOURCE_GROUP_NAME\"]\n\n # Instantiate a MLClient\n from azure.identity\ - \ import AzureAuthorityHosts, DefaultAzureCredential\n\n from azure.ai.ml import\ - \ MLClient\n\n # When using sovereign domains (that is, any cloud other than AZURE_PUBLIC_CLOUD),\n\ - \ # you must use an authority with DefaultAzureCredential.\n # Default authority\ - \ value : AzureAuthorityHosts.AZURE_PUBLIC_CLOUD\n # Expected values for authority\ - \ for sovereign clouds:\n # AzureAuthorityHosts.AZURE_CHINA or AzureAuthorityHosts.AZURE_GOVERNMENT\n\ - \ # credential = DefaultAzureCredential(authority=AzureAuthorityHosts.AZURE_CHINA)\n\ - \ credential = DefaultAzureCredential(authority=AzureAuthorityHosts.AZURE_PUBLIC_CLOUD)\n\ - \n # When using sovereign domains (that is, any cloud other than AZURE_PUBLIC_CLOUD),\n\ - \ # you must pass in the cloud name in kwargs. Default cloud is AzureCloud\n \ - \ kwargs = {\"cloud\": \"AzureCloud\"}\n # get a handle to the subscription\n\ - \ ml_client = MLClient(credential, subscription_id, resource_group, **kwargs)\n\ - \n ````\n" methods: - uid: azure.ai.ml.MLClient.begin_create_or_update name: begin_create_or_update diff --git a/docs-ref-autogen/azure-ai-textanalytics/azure.ai.textanalytics.AnalyzeHealthcareEntitiesLROPoller.yml b/docs-ref-autogen/azure-ai-textanalytics/azure.ai.textanalytics.AnalyzeHealthcareEntitiesLROPoller.yml index f1f96731b4e0..05f5d65b3750 100644 --- a/docs-ref-autogen/azure-ai-textanalytics/azure.ai.textanalytics.AnalyzeHealthcareEntitiesLROPoller.yml +++ b/docs-ref-autogen/azure-ai-textanalytics/azure.ai.textanalytics.AnalyzeHealthcareEntitiesLROPoller.yml @@ -32,39 +32,6 @@ methods: exceptions: - type: azure.core.exceptions.HttpResponseError description: When the operation has already reached a terminal state. - examples: - - "Cancel an existing health operation.\n\n\n\n````python\n\ - \n from azure.core.credentials import AzureKeyCredential\n from azure.ai.textanalytics\ - \ import TextAnalyticsClient\n\n endpoint = os.environ[\"AZURE_LANGUAGE_ENDPOINT\"\ - ]\n key = os.environ[\"AZURE_LANGUAGE_KEY\"]\n\n text_analytics_client = TextAnalyticsClient(\n\ - \ endpoint=endpoint,\n credential=AzureKeyCredential(key),\n )\n\ - \n documents = [\n \"RECORD #333582770390100 | MH | 85986313 | | 054351\ - \ | 2/14/2001 12:00:00 AM | \\\n CORONARY ARTERY DISEASE | Signed | DIS\ - \ | Admission Date: 5/22/2001 \\\n Report Status: Signed Discharge Date:\ - \ 4/24/2001 ADMISSION DIAGNOSIS: \\\n CORONARY ARTERY DISEASE. HISTORY OF\ - \ PRESENT ILLNESS: \\\n The patient is a 54-year-old gentleman with a history\ - \ of progressive angina over the past several months. \\\n The patient had\ - \ a cardiac catheterization in July of this year revealing total occlusion of\ - \ the RCA and \\\n 50% left main disease , with a strong family history\ - \ of coronary artery disease with a brother dying at \\\n the age of 52\ - \ from a myocardial infarction and another brother who is status post coronary\ - \ artery bypass grafting. \\\n The patient had a stress echocardiogram done\ - \ on July , 2001 , which showed no wall motion abnormalities ,\\\n but this\ - \ was a difficult study due to body habitus. The patient went for six minutes\ - \ with minimal ST depressions \\\n in the anterior lateral leads , thought\ - \ due to fatigue and wrist pain , his anginal equivalent. Due to the patient's\ - \ \\\n increased symptoms and family history and history left main disease\ - \ with total occasional of his RCA was referred \\\n for revascularization\ - \ with open heart surgery.\"\n ]\n\n poller = text_analytics_client.begin_analyze_healthcare_entities(documents)\n\ - \n try:\n poller.cancel()\n except HttpResponseError as e:\n #\ - \ If the operation has already reached a terminal state it cannot be cancelled.\n\ - \ print(e)\n\n else:\n print(\"Healthcare entities analysis was\ - \ successfully cancelled.\")\n\n\n ````\n" - uid: azure.ai.textanalytics.AnalyzeHealthcareEntitiesLROPoller.polling_method name: polling_method summary: Return the polling method associated to this poller. diff --git a/docs-ref-autogen/azure-ai-textanalytics/azure.ai.textanalytics.TextAnalyticsClient.yml b/docs-ref-autogen/azure-ai-textanalytics/azure.ai.textanalytics.TextAnalyticsClient.yml index de0b0da34e93..1fa99d6eb7c8 100644 --- a/docs-ref-autogen/azure-ai-textanalytics/azure.ai.textanalytics.TextAnalyticsClient.yml +++ b/docs-ref-autogen/azure-ai-textanalytics/azure.ai.textanalytics.TextAnalyticsClient.yml @@ -63,27 +63,6 @@ constructor: types: - - -examples: -- "Creating the TextAnalyticsClient with endpoint and API key.\n\n\n\n````python\n\n from azure.core.credentials import AzureKeyCredential\n\ - \ from azure.ai.textanalytics import TextAnalyticsClient\n endpoint = os.environ[\"\ - AZURE_LANGUAGE_ENDPOINT\"]\n key = os.environ[\"AZURE_LANGUAGE_KEY\"]\n\n text_analytics_client\ - \ = TextAnalyticsClient(endpoint, AzureKeyCredential(key))\n\n ````\n\nCreating\ - \ the TextAnalyticsClient with endpoint and token credential from Azure Active Directory.\n\n\n\n````python\n\n from azure.ai.textanalytics import TextAnalyticsClient\n\ - \ from azure.identity import DefaultAzureCredential\n\n endpoint = os.environ[\"\ - AZURE_LANGUAGE_ENDPOINT\"]\n credential = DefaultAzureCredential()\n\n text_analytics_client\ - \ = TextAnalyticsClient(endpoint, credential=credential)\n\n ````\n" methods: - uid: azure.ai.textanalytics.TextAnalyticsClient.analyze_sentiment name: analyze_sentiment @@ -216,32 +195,6 @@ methods: - type: azure.core.exceptions.HttpResponseError - type: TypeError - type: ValueError - examples: - - "Analyze sentiment in a batch of documents.\n\n\n\n````python\n\ - \n from azure.core.credentials import AzureKeyCredential\n from azure.ai.textanalytics\ - \ import TextAnalyticsClient\n\n endpoint = os.environ[\"AZURE_LANGUAGE_ENDPOINT\"\ - ]\n key = os.environ[\"AZURE_LANGUAGE_KEY\"]\n\n text_analytics_client = TextAnalyticsClient(endpoint=endpoint,\ - \ credential=AzureKeyCredential(key))\n\n documents = [\n \"\"\"I had\ - \ the best day of my life. I decided to go sky-diving and it made me appreciate\ - \ my whole life so much more.\n I developed a deep-connection with my instructor\ - \ as well, and I feel as if I've made a life-long friend in her.\"\"\",\n \ - \ \"\"\"This was a waste of my time. All of the views on this drop are extremely\ - \ boring, all I saw was grass. 0/10 would\n not recommend to any divers,\ - \ even first timers.\"\"\",\n \"\"\"This was pretty good! The sights were\ - \ ok, and I had fun with my instructors! Can't complain too much about my experience\"\ - \"\",\n \"\"\"I only have one word for my experience: WOW!!! I can't believe\ - \ I have had such a wonderful skydiving company right\n in my backyard this\ - \ whole time! I will definitely be a repeat customer, and I want to take my grandmother\ - \ skydiving too,\n I know she'll love it!\"\"\"\n ]\n\n\n result = text_analytics_client.analyze_sentiment(documents,\ - \ show_opinion_mining=True)\n docs = [doc for doc in result if not doc.is_error]\n\ - \n print(\"Let's visualize the sentiment of each of these documents\")\n for\ - \ idx, doc in enumerate(docs):\n print(f\"Document text: {documents[idx]}\"\ - )\n print(f\"Overall sentiment: {doc.sentiment}\")\n\n ````\n" - uid: azure.ai.textanalytics.TextAnalyticsClient.begin_analyze_actions name: begin_analyze_actions summary: 'Start a long-running operation to perform a variety of text analysis actions @@ -400,72 +353,6 @@ methods: - type: azure.core.exceptions.HttpResponseError - type: TypeError - type: ValueError - examples: - - "Start a long-running operation to perform a variety of text analysis\nactions\ - \ over a batch of documents.\n\n\n\n````python\n\ - \n from azure.core.credentials import AzureKeyCredential\n from azure.ai.textanalytics\ - \ import (\n TextAnalyticsClient,\n RecognizeEntitiesAction,\n \ - \ RecognizeLinkedEntitiesAction,\n RecognizePiiEntitiesAction,\n \ - \ ExtractKeyPhrasesAction,\n AnalyzeSentimentAction,\n )\n\n endpoint\ - \ = os.environ[\"AZURE_LANGUAGE_ENDPOINT\"]\n key = os.environ[\"AZURE_LANGUAGE_KEY\"\ - ]\n\n text_analytics_client = TextAnalyticsClient(\n endpoint=endpoint,\n\ - \ credential=AzureKeyCredential(key),\n )\n\n documents = [\n \ - \ 'We went to Contoso Steakhouse located at midtown NYC last week for a dinner\ - \ party, and we adore the spot! '\n 'They provide marvelous food and they\ - \ have a great menu. The chief cook happens to be the owner (I think his name\ - \ is John Doe) '\n 'and he is super nice, coming out of the kitchen and\ - \ greeted us all.'\n ,\n\n 'We enjoyed very much dining in the place!\ - \ '\n 'The Sirloin steak I ordered was tender and juicy, and the place was\ - \ impeccably clean. You can even pre-order from their '\n 'online menu at\ - \ www.contososteakhouse.com, call 312-555-0176 or send email to order@contososteakhouse.com!\ - \ '\n 'The only complaint I have is the food didn\\'t come fast enough.\ - \ Overall I highly recommend it!'\n ]\n\n poller = text_analytics_client.begin_analyze_actions(\n\ - \ documents,\n display_name=\"Sample Text Analysis\",\n actions=[\n\ - \ RecognizeEntitiesAction(),\n RecognizePiiEntitiesAction(),\n\ - \ ExtractKeyPhrasesAction(),\n RecognizeLinkedEntitiesAction(),\n\ - \ AnalyzeSentimentAction(),\n ],\n )\n\n document_results\ - \ = poller.result()\n for doc, action_results in zip(documents, document_results):\n\ - \ print(f\"\\nDocument text: {doc}\")\n for result in action_results:\n\ - \ if result.kind == \"EntityRecognition\":\n print(\"\ - ...Results of Recognize Entities Action:\")\n for entity in result.entities:\n\ - \ print(f\"......Entity: {entity.text}\")\n \ - \ print(f\".........Category: {entity.category}\")\n print(f\"\ - .........Confidence Score: {entity.confidence_score}\")\n print(f\"\ - .........Offset: {entity.offset}\")\n\n elif result.kind == \"PiiEntityRecognition\"\ - :\n print(\"...Results of Recognize PII Entities action:\")\n \ - \ for entity in result.entities:\n print(f\"......Entity:\ - \ {entity.text}\")\n print(f\".........Category: {entity.category}\"\ - )\n print(f\".........Confidence Score: {entity.confidence_score}\"\ - )\n\n elif result.kind == \"KeyPhraseExtraction\":\n print(\"\ - ...Results of Extract Key Phrases action:\")\n print(f\"......Key\ - \ Phrases: {result.key_phrases}\")\n\n elif result.kind == \"EntityLinking\"\ - :\n print(\"...Results of Recognize Linked Entities action:\")\n\ - \ for linked_entity in result.entities:\n print(f\"\ - ......Entity name: {linked_entity.name}\")\n print(f\".........Data\ - \ source: {linked_entity.data_source}\")\n print(f\".........Data\ - \ source language: {linked_entity.language}\")\n print(\n \ - \ f\".........Data source entity ID: {linked_entity.data_source_entity_id}\"\ - \n )\n print(f\".........Data source URL:\ - \ {linked_entity.url}\")\n print(\".........Document matches:\"\ - )\n for match in linked_entity.matches:\n \ - \ print(f\"............Match text: {match.text}\")\n \ - \ print(f\"............Confidence Score: {match.confidence_score}\")\n \ - \ print(f\"............Offset: {match.offset}\")\n \ - \ print(f\"............Length: {match.length}\")\n\n elif\ - \ result.kind == \"SentimentAnalysis\":\n print(\"...Results of\ - \ Analyze Sentiment action:\")\n print(f\"......Overall sentiment:\ - \ {result.sentiment}\")\n print(\n f\"......Scores:\ - \ positive={result.confidence_scores.positive}; \\\n neutral={result.confidence_scores.neutral};\ - \ \\\n negative={result.confidence_scores.negative} \\n\"\n\ - \ )\n\n elif result.is_error is True:\n \ - \ print(\n f\"...Is an error with code '{result.code}' and message\ - \ '{result.message}'\"\n )\n\n print(\"------------------------------------------\"\ - )\n\n\n ````\n" - uid: azure.ai.textanalytics.TextAnalyticsClient.begin_analyze_healthcare_entities name: begin_analyze_healthcare_entities summary: 'Analyze healthcare entities and identify relationships between these entities @@ -603,44 +490,6 @@ methods: - type: azure.core.exceptions.HttpResponseError - type: TypeError - type: ValueError - examples: - - "Recognize healthcare entities in a batch of documents.\n\n\n\n````python\n\n import os\n from azure.core.credentials\ - \ import AzureKeyCredential\n from azure.ai.textanalytics import TextAnalyticsClient,\ - \ HealthcareEntityRelation\n\n endpoint = os.environ[\"AZURE_LANGUAGE_ENDPOINT\"\ - ]\n key = os.environ[\"AZURE_LANGUAGE_KEY\"]\n\n text_analytics_client = TextAnalyticsClient(\n\ - \ endpoint=endpoint,\n credential=AzureKeyCredential(key),\n )\n\ - \n documents = [\n \"\"\"\n Patient needs to take 100 mg of ibuprofen,\ - \ and 3 mg of potassium. Also needs to take\n 10 mg of Zocor.\n \"\ - \"\",\n \"\"\"\n Patient needs to take 50 mg of ibuprofen, and 2 mg\ - \ of Coumadin.\n \"\"\"\n ]\n\n poller = text_analytics_client.begin_analyze_healthcare_entities(documents)\n\ - \ result = poller.result()\n\n docs = [doc for doc in result if not doc.is_error]\n\ - \n print(\"Let's first visualize the outputted healthcare result:\")\n for\ - \ doc in docs:\n for entity in doc.entities:\n print(f\"Entity:\ - \ {entity.text}\")\n print(f\"...Normalized Text: {entity.normalized_text}\"\ - )\n print(f\"...Category: {entity.category}\")\n print(f\"\ - ...Subcategory: {entity.subcategory}\")\n print(f\"...Offset: {entity.offset}\"\ - )\n print(f\"...Confidence score: {entity.confidence_score}\")\n \ - \ if entity.data_sources is not None:\n print(\"...Data Sources:\"\ - )\n for data_source in entity.data_sources:\n \ - \ print(f\"......Entity ID: {data_source.entity_id}\")\n print(f\"\ - ......Name: {data_source.name}\")\n if entity.assertion is not None:\n\ - \ print(\"...Assertion:\")\n print(f\"......Conditionality:\ - \ {entity.assertion.conditionality}\")\n print(f\"......Certainty:\ - \ {entity.assertion.certainty}\")\n print(f\"......Association:\ - \ {entity.assertion.association}\")\n for relation in doc.entity_relations:\n\ - \ print(f\"Relation of type: {relation.relation_type} has the following\ - \ roles\")\n for role in relation.roles:\n print(f\"...Role\ - \ '{role.name}' with entity '{role.entity.text}'\")\n print(\"------------------------------------------\"\ - )\n\n print(\"Now, let's get all of medication dosage relations from the documents\"\ - )\n dosage_of_medication_relations = [\n entity_relation\n for doc\ - \ in docs\n for entity_relation in doc.entity_relations if entity_relation.relation_type\ - \ == HealthcareEntityRelation.DOSAGE_OF_MEDICATION\n ]\n\n ````\n" - uid: azure.ai.textanalytics.TextAnalyticsClient.begin_multi_label_classify name: begin_multi_label_classify summary: 'Start a long-running custom multi label classification operation. @@ -757,34 +606,6 @@ methods: - ]] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Perform multi label classification on a batch of documents.\n\n\n\n````python\n\n from azure.core.credentials import AzureKeyCredential\n\ - \ from azure.ai.textanalytics import TextAnalyticsClient\n\n endpoint = os.environ[\"\ - AZURE_LANGUAGE_ENDPOINT\"]\n key = os.environ[\"AZURE_LANGUAGE_KEY\"]\n project_name\ - \ = os.environ[\"MULTI_LABEL_CLASSIFY_PROJECT_NAME\"]\n deployment_name = os.environ[\"\ - MULTI_LABEL_CLASSIFY_DEPLOYMENT_NAME\"]\n path_to_sample_document = os.path.abspath(\n\ - \ os.path.join(\n os.path.abspath(__file__),\n \"..\"\ - ,\n \"./text_samples/custom_classify_sample.txt\",\n )\n )\n\ - \n text_analytics_client = TextAnalyticsClient(\n endpoint=endpoint,\n\ - \ credential=AzureKeyCredential(key),\n )\n\n with open(path_to_sample_document)\ - \ as fd:\n document = [fd.read()]\n\n poller = text_analytics_client.begin_multi_label_classify(\n\ - \ document,\n project_name=project_name,\n deployment_name=deployment_name\n\ - \ )\n\n document_results = poller.result()\n for doc, classification_result\ - \ in zip(document, document_results):\n if classification_result.kind ==\ - \ \"CustomDocumentClassification\":\n classifications = classification_result.classifications\n\ - \ print(f\"\\nThe movie plot '{doc}' was classified as the following\ - \ genres:\\n\")\n for classification in classifications:\n \ - \ print(\"'{}' with confidence score {}.\".format(\n classification.category,\ - \ classification.confidence_score\n ))\n elif classification_result.is_error\ - \ is True:\n print(\"Movie plot '{}' has an error with code '{}' and\ - \ message '{}'\".format(\n doc, classification_result.code, classification_result.message\n\ - \ ))\n\n ````\n" - uid: azure.ai.textanalytics.TextAnalyticsClient.begin_recognize_custom_entities name: begin_recognize_custom_entities summary: 'Start a long-running custom named entity recognition operation. @@ -912,33 +733,6 @@ methods: - ]] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Recognize custom entities in a batch of documents.\n\n\n\n````python\n\n from azure.core.credentials\ - \ import AzureKeyCredential\n from azure.ai.textanalytics import TextAnalyticsClient\n\ - \n endpoint = os.environ[\"AZURE_LANGUAGE_ENDPOINT\"]\n key = os.environ[\"\ - AZURE_LANGUAGE_KEY\"]\n project_name = os.environ[\"CUSTOM_ENTITIES_PROJECT_NAME\"\ - ]\n deployment_name = os.environ[\"CUSTOM_ENTITIES_DEPLOYMENT_NAME\"]\n path_to_sample_document\ - \ = os.path.abspath(\n os.path.join(\n os.path.abspath(__file__),\n\ - \ \"..\",\n \"./text_samples/custom_entities_sample.txt\"\ - ,\n )\n )\n\n text_analytics_client = TextAnalyticsClient(\n endpoint=endpoint,\n\ - \ credential=AzureKeyCredential(key),\n )\n\n with open(path_to_sample_document)\ - \ as fd:\n document = [fd.read()]\n\n poller = text_analytics_client.begin_recognize_custom_entities(\n\ - \ document,\n project_name=project_name,\n deployment_name=deployment_name\n\ - \ )\n\n document_results = poller.result()\n for custom_entities_result\ - \ in document_results:\n if custom_entities_result.kind == \"CustomEntityRecognition\"\ - :\n for entity in custom_entities_result.entities:\n print(\n\ - \ \"Entity '{}' has category '{}' with confidence score of '{}'\"\ - .format(\n entity.text, entity.category, entity.confidence_score\n\ - \ )\n )\n elif custom_entities_result.is_error\ - \ is True:\n print(\"...Is an error with code '{}' and message '{}'\"\ - .format(\n custom_entities_result.code, custom_entities_result.message\n\ - \ )\n )\n\n ````\n" - uid: azure.ai.textanalytics.TextAnalyticsClient.begin_single_label_classify name: begin_single_label_classify summary: 'Start a long-running custom single label classification operation. @@ -1055,33 +849,6 @@ methods: - ]] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Perform single label classification on a batch of documents.\n\n\n\n````python\n\n from azure.core.credentials import AzureKeyCredential\n\ - \ from azure.ai.textanalytics import TextAnalyticsClient\n\n endpoint = os.environ[\"\ - AZURE_LANGUAGE_ENDPOINT\"]\n key = os.environ[\"AZURE_LANGUAGE_KEY\"]\n project_name\ - \ = os.environ[\"SINGLE_LABEL_CLASSIFY_PROJECT_NAME\"]\n deployment_name = os.environ[\"\ - SINGLE_LABEL_CLASSIFY_DEPLOYMENT_NAME\"]\n path_to_sample_document = os.path.abspath(\n\ - \ os.path.join(\n os.path.abspath(__file__),\n \"..\"\ - ,\n \"./text_samples/custom_classify_sample.txt\",\n )\n )\n\ - \n text_analytics_client = TextAnalyticsClient(\n endpoint=endpoint,\n\ - \ credential=AzureKeyCredential(key),\n )\n\n with open(path_to_sample_document)\ - \ as fd:\n document = [fd.read()]\n\n poller = text_analytics_client.begin_single_label_classify(\n\ - \ document,\n project_name=project_name,\n deployment_name=deployment_name\n\ - \ )\n\n document_results = poller.result()\n for doc, classification_result\ - \ in zip(document, document_results):\n if classification_result.kind ==\ - \ \"CustomDocumentClassification\":\n classification = classification_result.classifications[0]\n\ - \ print(\"The document text '{}' was classified as '{}' with confidence\ - \ score {}.\".format(\n doc, classification.category, classification.confidence_score)\n\ - \ )\n elif classification_result.is_error is True:\n \ - \ print(\"Document text '{}' has an error with code '{}' and message '{}'\".format(\n\ - \ doc, classification_result.code, classification_result.message\n\ - \ ))\n\n ````\n" - uid: azure.ai.textanalytics.TextAnalyticsClient.detect_language name: detect_language summary: 'Detect language for a batch of documents. @@ -1183,33 +950,6 @@ methods: - type: azure.core.exceptions.HttpResponseError - type: TypeError - type: ValueError - examples: - - "Detecting language in a batch of documents.\n\n\n\n````python\n\ - \n from azure.core.credentials import AzureKeyCredential\n from azure.ai.textanalytics\ - \ import TextAnalyticsClient\n\n endpoint = os.environ[\"AZURE_LANGUAGE_ENDPOINT\"\ - ]\n key = os.environ[\"AZURE_LANGUAGE_KEY\"]\n\n text_analytics_client = TextAnalyticsClient(endpoint=endpoint,\ - \ credential=AzureKeyCredential(key))\n documents = [\n \"\"\"\n \ - \ The concierge Paulette was extremely helpful. Sadly when we arrived the elevator\ - \ was broken, but with Paulette's help we barely noticed this inconvenience.\n\ - \ She arranged for our baggage to be brought up to our room with no extra\ - \ charge and gave us a free meal to refurbish all of the calories we lost from\n\ - \ walking up the stairs :). Can't say enough good things about my experience!\n\ - \ \"\"\",\n \"\"\"\n \u6700\u8FD1\u7531\u4E8E\u5DE5\u4F5C\u538B\ - \u529B\u592A\u5927\uFF0C\u6211\u4EEC\u51B3\u5B9A\u53BB\u5BCC\u9152\u5E97\u5EA6\ - \u5047\u3002\u90A3\u513F\u7684\u6E29\u6CC9\u5B9E\u5728\u592A\u8212\u670D\u4E86\ - \uFF0C\u6211\u8DDF\u6211\u4E08\u592B\u90FD\u5B8C\u5168\u6062\u590D\u4E86\u5DE5\ - \u4F5C\u524D\u7684\u9752\u6625\u7CBE\u795E\uFF01\u52A0\u6CB9\uFF01\n \"\"\ - \"\n ]\n\n result = text_analytics_client.detect_language(documents)\n reviewed_docs\ - \ = [doc for doc in result if not doc.is_error]\n\n print(\"Let's see what language\ - \ each review is in!\")\n\n for idx, doc in enumerate(reviewed_docs):\n \ - \ print(\"Review #{} is in '{}', which has ISO639-1 name '{}'\\n\".format(\n\ - \ idx, doc.primary_language.name, doc.primary_language.iso6391_name\n\ - \ ))\n\n ````\n" - uid: azure.ai.textanalytics.TextAnalyticsClient.extract_key_phrases name: extract_key_phrases summary: 'Extract key phrases from a batch of documents. @@ -1315,30 +1055,6 @@ methods: - type: azure.core.exceptions.HttpResponseError - type: TypeError - type: ValueError - examples: - - "Extract the key phrases in a batch of documents.\n\n\n\n````python\n\n from azure.core.credentials import AzureKeyCredential\n\ - \ from azure.ai.textanalytics import TextAnalyticsClient\n\n endpoint = os.environ[\"\ - AZURE_LANGUAGE_ENDPOINT\"]\n key = os.environ[\"AZURE_LANGUAGE_KEY\"]\n\n \ - \ text_analytics_client = TextAnalyticsClient(endpoint=endpoint, credential=AzureKeyCredential(key))\n\ - \ articles = [\n \"\"\"\n Washington, D.C. Autumn in DC is a uniquely\ - \ beautiful season. The leaves fall from the trees\n in a city chock-full\ - \ of forests, leaving yellow leaves on the ground and a clearer view of the\n\ - \ blue sky above...\n \"\"\",\n \"\"\"\n Redmond, WA.\ - \ In the past few days, Microsoft has decided to further postpone the start date\ - \ of\n its United States workers, due to the pandemic that rages with no\ - \ end in sight...\n \"\"\",\n \"\"\"\n Redmond, WA. Employees\ - \ at Microsoft can be excited about the new coffee shop that will open on campus\n\ - \ once workers no longer have to work remotely...\n \"\"\"\n ]\n\ - \n result = text_analytics_client.extract_key_phrases(articles)\n for idx,\ - \ doc in enumerate(result):\n if not doc.is_error:\n print(\"\ - Key phrases in article #{}: {}\".format(\n idx + 1,\n \ - \ \", \".join(doc.key_phrases)\n ))\n\n ````\n" - uid: azure.ai.textanalytics.TextAnalyticsClient.recognize_entities name: recognize_entities summary: 'Recognize entities for a batch of documents. @@ -1452,29 +1168,6 @@ methods: - type: azure.core.exceptions.HttpResponseError - type: TypeError - type: ValueError - examples: - - "Recognize entities in a batch of documents.\n\n\n\n````python\n\ - \n from azure.core.credentials import AzureKeyCredential\n from azure.ai.textanalytics\ - \ import TextAnalyticsClient\n\n endpoint = os.environ[\"AZURE_LANGUAGE_ENDPOINT\"\ - ]\n key = os.environ[\"AZURE_LANGUAGE_KEY\"]\n\n text_analytics_client = TextAnalyticsClient(endpoint=endpoint,\ - \ credential=AzureKeyCredential(key))\n reviews = [\n \"\"\"I work for\ - \ Foo Company, and we hired Contoso for our annual founding ceremony. The food\n\ - \ was amazing and we all can't say enough good words about the quality and\ - \ the level of service.\"\"\",\n \"\"\"We at the Foo Company re-hired Contoso\ - \ after all of our past successes with the company.\n Though the food was\ - \ still great, I feel there has been a quality drop since their last time\n \ - \ catering for us. Is anyone else running into the same problem?\"\"\",\n\ - \ \"\"\"Bar Company is over the moon about the service we received from\ - \ Contoso, the best sliders ever!!!!\"\"\"\n ]\n\n result = text_analytics_client.recognize_entities(reviews)\n\ - \ result = [review for review in result if not review.is_error]\n\n for idx,\ - \ review in enumerate(result):\n for entity in review.entities:\n \ - \ print(f\"Entity '{entity.text}' has category '{entity.category}'\")\n\n\ - \ ````\n" - uid: azure.ai.textanalytics.TextAnalyticsClient.recognize_linked_entities name: recognize_linked_entities summary: 'Recognize linked entities from a well-known knowledge base for a batch @@ -1593,31 +1286,6 @@ methods: - type: azure.core.exceptions.HttpResponseError - type: TypeError - type: ValueError - examples: - - "Recognize linked entities in a batch of documents.\n\n\n\n````python\n\n from azure.core.credentials\ - \ import AzureKeyCredential\n from azure.ai.textanalytics import TextAnalyticsClient\n\ - \n endpoint = os.environ[\"AZURE_LANGUAGE_ENDPOINT\"]\n key = os.environ[\"\ - AZURE_LANGUAGE_KEY\"]\n\n text_analytics_client = TextAnalyticsClient(endpoint=endpoint,\ - \ credential=AzureKeyCredential(key))\n documents = [\n \"\"\"\n \ - \ Microsoft was founded by Bill Gates with some friends he met at Harvard. One\ - \ of his friends,\n Steve Ballmer, eventually became CEO after Bill Gates\ - \ as well. Steve Ballmer eventually stepped\n down as CEO of Microsoft,\ - \ and was succeeded by Satya Nadella.\n Microsoft originally moved its headquarters\ - \ to Bellevue, Washington in January 1979, but is now\n headquartered in\ - \ Redmond.\n \"\"\"\n ]\n\n result = text_analytics_client.recognize_linked_entities(documents)\n\ - \ docs = [doc for doc in result if not doc.is_error]\n\n print(\n \"\ - Let's map each entity to it's Wikipedia article. I also want to see how many times\ - \ each \"\n \"entity is mentioned in a document\\n\\n\"\n )\n entity_to_url\ - \ = {}\n for doc in docs:\n for entity in doc.entities:\n print(\"\ - Entity '{}' has been mentioned '{}' time(s)\".format(\n entity.name,\ - \ len(entity.matches)\n ))\n if entity.data_source == \"Wikipedia\"\ - :\n entity_to_url[entity.name] = entity.url\n\n ````\n" - uid: azure.ai.textanalytics.TextAnalyticsClient.recognize_pii_entities name: recognize_pii_entities summary: 'Recognize entities containing personal information for a batch of documents. @@ -1751,27 +1419,3 @@ methods: - type: azure.core.exceptions.HttpResponseError - type: TypeError - type: ValueError - examples: - - "Recognize personally identifiable information entities in a batch of documents.\n\n\n\n````python\n\n from azure.core.credentials\ - \ import AzureKeyCredential\n from azure.ai.textanalytics import TextAnalyticsClient\n\ - \n endpoint = os.environ[\"AZURE_LANGUAGE_ENDPOINT\"]\n key = os.environ[\"\ - AZURE_LANGUAGE_KEY\"]\n\n text_analytics_client = TextAnalyticsClient(\n \ - \ endpoint=endpoint, credential=AzureKeyCredential(key)\n )\n documents\ - \ = [\n \"\"\"Parker Doe has repaid all of their loans as of 2020-04-25.\n\ - \ Their SSN is 859-98-0987. To contact them, use their phone number\n \ - \ 555-555-5555. They are originally from Brazil and have Brazilian CPF number\ - \ 998.214.865-68\"\"\"\n ]\n\n result = text_analytics_client.recognize_pii_entities(documents)\n\ - \ docs = [doc for doc in result if not doc.is_error]\n\n print(\n \"\ - Let's compare the original document with the documents after redaction. \"\n \ - \ \"I also want to comb through all of the entities that got redacted\"\n\ - \ )\n for idx, doc in enumerate(docs):\n print(f\"Document text: {documents[idx]}\"\ - )\n print(f\"Redacted document text: {doc.redacted_text}\")\n for\ - \ entity in doc.entities:\n print(\"...Entity '{}' with category '{}'\ - \ got redacted\".format(\n entity.text, entity.category\n \ - \ ))\n\n\n ````\n" diff --git a/docs-ref-autogen/azure-ai-textanalytics/azure.ai.textanalytics.aio.AsyncAnalyzeHealthcareEntitiesLROPoller.yml b/docs-ref-autogen/azure-ai-textanalytics/azure.ai.textanalytics.aio.AsyncAnalyzeHealthcareEntitiesLROPoller.yml index fa93108166db..841fc89e33e4 100644 --- a/docs-ref-autogen/azure-ai-textanalytics/azure.ai.textanalytics.aio.AsyncAnalyzeHealthcareEntitiesLROPoller.yml +++ b/docs-ref-autogen/azure-ai-textanalytics/azure.ai.textanalytics.aio.AsyncAnalyzeHealthcareEntitiesLROPoller.yml @@ -32,41 +32,6 @@ methods: exceptions: - type: azure.core.exceptions.HttpResponseError description: When the operation has already reached a terminal state. - examples: - - "Cancel an existing health operation.\n\n\n\n````python\n\ - \n from azure.core.credentials import AzureKeyCredential\n from azure.ai.textanalytics.aio\ - \ import TextAnalyticsClient\n\n endpoint = os.environ[\"AZURE_LANGUAGE_ENDPOINT\"\ - ]\n key = os.environ[\"AZURE_LANGUAGE_KEY\"]\n\n text_analytics_client = TextAnalyticsClient(\n\ - \ endpoint=endpoint,\n credential=AzureKeyCredential(key),\n )\n\ - \n documents = [\n \"RECORD #333582770390100 | MH | 85986313 | | 054351\ - \ | 2/14/2001 12:00:00 AM | \\\n CORONARY ARTERY DISEASE | Signed | DIS\ - \ | Admission Date: 5/22/2001 \\\n Report Status: Signed Discharge Date:\ - \ 4/24/2001 ADMISSION DIAGNOSIS: \\\n CORONARY ARTERY DISEASE. HISTORY OF\ - \ PRESENT ILLNESS: \\\n The patient is a 54-year-old gentleman with a history\ - \ of progressive angina over the past several months. \\\n The patient had\ - \ a cardiac catheterization in July of this year revealing total occlusion of\ - \ the RCA and \\\n 50% left main disease , with a strong family history\ - \ of coronary artery disease with a brother dying at \\\n the age of 52\ - \ from a myocardial infarction and another brother who is status post coronary\ - \ artery bypass grafting. \\\n The patient had a stress echocardiogram done\ - \ on July , 2001 , which showed no wall motion abnormalities ,\\\n but this\ - \ was a difficult study due to body habitus. The patient went for six minutes\ - \ with minimal ST depressions \\\n in the anterior lateral leads , thought\ - \ due to fatigue and wrist pain , his anginal equivalent. Due to the patient's\ - \ \\\n increased symptoms and family history and history left main disease\ - \ with total occasional of his RCA was referred \\\n for revascularization\ - \ with open heart surgery.\"\n ]\n\n async with text_analytics_client:\n \ - \ poller = await text_analytics_client.begin_analyze_healthcare_entities(documents)\n\ - \n try:\n await poller.cancel()\n except HttpResponseError\ - \ as e:\n # If the operation has already reached a terminal state it\ - \ cannot be cancelled.\n print(e)\n\n else:\n print(\"\ - Healthcare entities analysis was successfully cancelled.\")\n\n\n ````\n" - uid: azure.ai.textanalytics.aio.AsyncAnalyzeHealthcareEntitiesLROPoller.polling_method name: polling_method summary: Return the polling method associated to this poller. diff --git a/docs-ref-autogen/azure-ai-textanalytics/azure.ai.textanalytics.aio.TextAnalyticsClient.yml b/docs-ref-autogen/azure-ai-textanalytics/azure.ai.textanalytics.aio.TextAnalyticsClient.yml index 2a922ecc9ffb..6673663cd400 100644 --- a/docs-ref-autogen/azure-ai-textanalytics/azure.ai.textanalytics.aio.TextAnalyticsClient.yml +++ b/docs-ref-autogen/azure-ai-textanalytics/azure.ai.textanalytics.aio.TextAnalyticsClient.yml @@ -63,28 +63,6 @@ constructor: types: - - -examples: -- "Creating the TextAnalyticsClient with endpoint and API key.\n\n\n\n````python\n\n from azure.core.credentials\ - \ import AzureKeyCredential\n from azure.ai.textanalytics.aio import TextAnalyticsClient\n\ - \ endpoint = os.environ[\"AZURE_LANGUAGE_ENDPOINT\"]\n key = os.environ[\"AZURE_LANGUAGE_KEY\"\ - ]\n\n text_analytics_client = TextAnalyticsClient(endpoint, AzureKeyCredential(key))\n\ - \n ````\n\nCreating the TextAnalyticsClient with endpoint and token credential\ - \ from Azure Active Directory.\n\n\n\n````python\n\n from azure.ai.textanalytics.aio\ - \ import TextAnalyticsClient\n from azure.identity.aio import DefaultAzureCredential\n\ - \n endpoint = os.environ[\"AZURE_LANGUAGE_ENDPOINT\"]\n credential = DefaultAzureCredential()\n\ - \n text_analytics_client = TextAnalyticsClient(endpoint, credential=credential)\n\ - \n ````\n" methods: - uid: azure.ai.textanalytics.aio.TextAnalyticsClient.analyze_sentiment name: analyze_sentiment @@ -217,34 +195,6 @@ methods: - type: azure.core.exceptions.HttpResponseError - type: TypeError - type: ValueError - examples: - - "Analyze sentiment in a batch of documents.\n\n\n\n````python\n\n from azure.core.credentials\ - \ import AzureKeyCredential\n from azure.ai.textanalytics.aio import TextAnalyticsClient\n\ - \n endpoint = os.environ[\"AZURE_LANGUAGE_ENDPOINT\"]\n key = os.environ[\"\ - AZURE_LANGUAGE_KEY\"]\n\n text_analytics_client = TextAnalyticsClient(endpoint=endpoint,\ - \ credential=AzureKeyCredential(key))\n\n documents = [\n \"\"\"I had\ - \ the best day of my life. I decided to go sky-diving and it made me appreciate\ - \ my whole life so much more.\n I developed a deep-connection with my instructor\ - \ as well, and I feel as if I've made a life-long friend in her.\"\"\",\n \ - \ \"\"\"This was a waste of my time. All of the views on this drop are extremely\ - \ boring, all I saw was grass. 0/10 would\n not recommend to any divers,\ - \ even first timers.\"\"\",\n \"\"\"This was pretty good! The sights were\ - \ ok, and I had fun with my instructors! Can't complain too much about my experience\"\ - \"\",\n \"\"\"I only have one word for my experience: WOW!!! I can't believe\ - \ I have had such a wonderful skydiving company right\n in my backyard this\ - \ whole time! I will definitely be a repeat customer, and I want to take my grandmother\ - \ skydiving too,\n I know she'll love it!\"\"\"\n ]\n\n async with text_analytics_client:\n\ - \ result = await text_analytics_client.analyze_sentiment(documents)\n\n\ - \ docs = [doc for doc in result if not doc.is_error]\n\n print(\"Let's visualize\ - \ the sentiment of each of these documents\")\n for idx, doc in enumerate(docs):\n\ - \ print(f\"Document text: {documents[idx]}\")\n print(f\"Overall sentiment:\ - \ {doc.sentiment}\")\n\n ````\n" - uid: azure.ai.textanalytics.aio.TextAnalyticsClient.begin_analyze_actions name: begin_analyze_actions summary: 'Start a long-running operation to perform a variety of text analysis actions @@ -403,80 +353,6 @@ methods: - type: azure.core.exceptions.HttpResponseError - type: TypeError - type: ValueError - examples: - - "Start a long-running operation to perform a variety of text analysis actions\ - \ over\na batch of documents.\n\n\n\n````python\n\n from azure.core.credentials import AzureKeyCredential\n\ - \ from azure.ai.textanalytics.aio import TextAnalyticsClient\n from azure.ai.textanalytics\ - \ import (\n RecognizeEntitiesAction,\n RecognizeLinkedEntitiesAction,\n\ - \ RecognizePiiEntitiesAction,\n ExtractKeyPhrasesAction,\n AnalyzeSentimentAction,\n\ - \ )\n\n endpoint = os.environ[\"AZURE_LANGUAGE_ENDPOINT\"]\n key = os.environ[\"\ - AZURE_LANGUAGE_KEY\"]\n\n text_analytics_client = TextAnalyticsClient(\n \ - \ endpoint=endpoint,\n credential=AzureKeyCredential(key),\n )\n\n\ - \ documents = [\n 'We went to Contoso Steakhouse located at midtown NYC\ - \ last week for a dinner party, and we adore the spot! '\n 'They provide\ - \ marvelous food and they have a great menu. The chief cook happens to be the\ - \ owner (I think his name is John Doe) '\n 'and he is super nice, coming\ - \ out of the kitchen and greeted us all.'\n ,\n\n 'We enjoyed very\ - \ much dining in the place! '\n 'The Sirloin steak I ordered was tender\ - \ and juicy, and the place was impeccably clean. You can even pre-order from their\ - \ '\n 'online menu at www.contososteakhouse.com, call 312-555-0176 or send\ - \ email to order@contososteakhouse.com! '\n 'The only complaint I have is\ - \ the food didn\\'t come fast enough. Overall I highly recommend it!'\n ]\n\n\ - \ async with text_analytics_client:\n poller = await text_analytics_client.begin_analyze_actions(\n\ - \ documents,\n display_name=\"Sample Text Analysis\",\n \ - \ actions=[\n RecognizeEntitiesAction(),\n \ - \ RecognizePiiEntitiesAction(),\n ExtractKeyPhrasesAction(),\n\ - \ RecognizeLinkedEntitiesAction(),\n AnalyzeSentimentAction(),\n\ - \ ]\n )\n\n pages = await poller.result()\n\n # To\ - \ enumerate / zip for async, unless you install a third party library,\n \ - \ # you have to read in all of the elements into memory first.\n # If you're\ - \ not looking to enumerate / zip, we recommend you just asynchronously\n \ - \ # loop over it immediately, without going through this step of reading them\ - \ into memory\n document_results = []\n async for page in pages:\n\ - \ document_results.append(page)\n\n for doc, action_results in zip(documents,\ - \ document_results):\n print(f\"\\nDocument text: {doc}\")\n for result\ - \ in action_results:\n if result.kind == \"EntityRecognition\":\n \ - \ print(\"...Results of Recognize Entities Action:\")\n \ - \ for entity in result.entities:\n print(f\"......Entity:\ - \ {entity.text}\")\n print(f\".........Category: {entity.category}\"\ - )\n print(f\".........Confidence Score: {entity.confidence_score}\"\ - )\n print(f\".........Offset: {entity.offset}\")\n\n \ - \ elif result.kind == \"PiiEntityRecognition\":\n print(\"...Results\ - \ of Recognize PII Entities action:\")\n for entity in result.entities:\n\ - \ print(f\"......Entity: {entity.text}\")\n \ - \ print(f\".........Category: {entity.category}\")\n print(f\"\ - .........Confidence Score: {entity.confidence_score}\")\n\n elif result.kind\ - \ == \"KeyPhraseExtraction\":\n print(\"...Results of Extract Key\ - \ Phrases action:\")\n print(f\"......Key Phrases: {result.key_phrases}\"\ - )\n\n elif result.kind == \"EntityLinking\":\n print(\"\ - ...Results of Recognize Linked Entities action:\")\n for linked_entity\ - \ in result.entities:\n print(f\"......Entity name: {linked_entity.name}\"\ - )\n print(f\".........Data source: {linked_entity.data_source}\"\ - )\n print(f\".........Data source language: {linked_entity.language}\"\ - )\n print(\n f\".........Data source entity\ - \ ID: {linked_entity.data_source_entity_id}\"\n )\n \ - \ print(f\".........Data source URL: {linked_entity.url}\")\n \ - \ print(\".........Document matches:\")\n for match\ - \ in linked_entity.matches:\n print(f\"............Match\ - \ text: {match.text}\")\n print(f\"............Confidence\ - \ Score: {match.confidence_score}\")\n print(f\"............Offset:\ - \ {match.offset}\")\n print(f\"............Length: {match.length}\"\ - )\n\n elif result.kind == \"SentimentAnalysis\":\n print(\"\ - ...Results of Analyze Sentiment action:\")\n print(f\"......Overall\ - \ sentiment: {result.sentiment}\")\n print(\n \ - \ f\"......Scores: positive={result.confidence_scores.positive}; \\\n \ - \ neutral={result.confidence_scores.neutral}; \\\n \ - \ negative={result.confidence_scores.negative} \\n\"\n )\n\n \ - \ elif result.is_error is True:\n print(\n \ - \ f\"...Is an error with code '{result.code}' and message '{result.message}'\"\ - \n )\n\n print(\"------------------------------------------\"\ - )\n\n\n ````\n" - uid: azure.ai.textanalytics.aio.TextAnalyticsClient.begin_analyze_healthcare_entities name: begin_analyze_healthcare_entities summary: 'Analyze healthcare entities and identify relationships between these entities @@ -611,46 +487,6 @@ methods: - type: azure.core.exceptions.HttpResponseError - type: TypeError - type: ValueError - examples: - - "Analyze healthcare entities in a batch of documents.\n\n\n\n````python\n\n import os\n\ - \ from azure.core.credentials import AzureKeyCredential\n from azure.ai.textanalytics\ - \ import HealthcareEntityRelation\n from azure.ai.textanalytics.aio import TextAnalyticsClient\n\ - \n endpoint = os.environ[\"AZURE_LANGUAGE_ENDPOINT\"]\n key = os.environ[\"\ - AZURE_LANGUAGE_KEY\"]\n\n text_analytics_client = TextAnalyticsClient(\n \ - \ endpoint=endpoint,\n credential=AzureKeyCredential(key),\n )\n\n\ - \ documents = [\n \"\"\"\n Patient needs to take 100 mg of ibuprofen,\ - \ and 3 mg of potassium. Also needs to take\n 10 mg of Zocor.\n \"\ - \"\",\n \"\"\"\n Patient needs to take 50 mg of ibuprofen, and 2 mg\ - \ of Coumadin.\n \"\"\"\n ]\n\n async with text_analytics_client:\n\ - \ poller = await text_analytics_client.begin_analyze_healthcare_entities(documents)\n\ - \ result = await poller.result()\n docs = [doc async for doc in result\ - \ if not doc.is_error]\n\n print(\"Let's first visualize the outputted healthcare\ - \ result:\")\n for doc in docs:\n for entity in doc.entities:\n \ - \ print(f\"Entity: {entity.text}\")\n print(f\"...Normalized Text:\ - \ {entity.normalized_text}\")\n print(f\"...Category: {entity.category}\"\ - )\n print(f\"...Subcategory: {entity.subcategory}\")\n print(f\"\ - ...Offset: {entity.offset}\")\n print(f\"...Confidence score: {entity.confidence_score}\"\ - )\n if entity.data_sources is not None:\n print(\"...Data\ - \ Sources:\")\n for data_source in entity.data_sources:\n \ - \ print(f\"......Entity ID: {data_source.entity_id}\")\n \ - \ print(f\"......Name: {data_source.name}\")\n if entity.assertion\ - \ is not None:\n print(\"...Assertion:\")\n print(f\"\ - ......Conditionality: {entity.assertion.conditionality}\")\n print(f\"\ - ......Certainty: {entity.assertion.certainty}\")\n print(f\"......Association:\ - \ {entity.assertion.association}\")\n for relation in doc.entity_relations:\n\ - \ print(f\"Relation of type: {relation.relation_type} has the following\ - \ roles\")\n for role in relation.roles:\n print(f\"...Role\ - \ '{role.name}' with entity '{role.entity.text}'\")\n print(\"------------------------------------------\"\ - )\n\n print(\"Now, let's get all of medication dosage relations from the documents\"\ - )\n dosage_of_medication_relations = [\n entity_relation\n for doc\ - \ in docs\n for entity_relation in doc.entity_relations if entity_relation.relation_type\ - \ == HealthcareEntityRelation.DOSAGE_OF_MEDICATION\n ]\n\n ````\n" - uid: azure.ai.textanalytics.aio.TextAnalyticsClient.begin_multi_label_classify name: begin_multi_label_classify summary: 'Start a long-running custom multi label classification operation. @@ -767,37 +603,6 @@ methods: - ]] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Perform multi label classification on a batch of documents.\n\n\n\n````python\n\n from azure.core.credentials\ - \ import AzureKeyCredential\n from azure.ai.textanalytics.aio import TextAnalyticsClient\n\ - \n endpoint = os.environ[\"AZURE_LANGUAGE_ENDPOINT\"]\n key = os.environ[\"\ - AZURE_LANGUAGE_KEY\"]\n project_name = os.environ[\"MULTI_LABEL_CLASSIFY_PROJECT_NAME\"\ - ]\n deployment_name = os.environ[\"MULTI_LABEL_CLASSIFY_DEPLOYMENT_NAME\"]\n\ - \ path_to_sample_document = os.path.abspath(\n os.path.join(\n \ - \ os.path.abspath(__file__),\n \"..\",\n \"..\",\n \ - \ \"./text_samples/custom_classify_sample.txt\",\n )\n )\n\n with\ - \ open(path_to_sample_document) as fd:\n document = [fd.read()]\n\n text_analytics_client\ - \ = TextAnalyticsClient(\n endpoint=endpoint,\n credential=AzureKeyCredential(key),\n\ - \ )\n\n async with text_analytics_client:\n poller = await text_analytics_client.begin_multi_label_classify(\n\ - \ document,\n project_name=project_name,\n deployment_name=deployment_name\n\ - \ )\n\n pages = await poller.result()\n document_results = []\n\ - \ async for page in pages:\n document_results.append(page)\n\n\ - \ for doc, classification_result in zip(document, document_results):\n \ - \ if classification_result.kind == \"CustomDocumentClassification\":\n \ - \ classifications = classification_result.classifications\n print(f\"\ - \\nThe movie plot '{doc}' was classified as the following genres:\\n\")\n \ - \ for classification in classifications:\n print(\"'{}' with\ - \ confidence score {}.\".format(\n classification.category,\ - \ classification.confidence_score\n ))\n elif classification_result.is_error\ - \ is True:\n print(\"Movie plot '{}' has an error with code '{}' and\ - \ message '{}'\".format(\n doc, classification_result.code, classification_result.message\n\ - \ ))\n\n ````\n" - uid: azure.ai.textanalytics.aio.TextAnalyticsClient.begin_recognize_custom_entities name: begin_recognize_custom_entities summary: 'Start a long-running custom named entity recognition operation. @@ -925,35 +730,6 @@ methods: - ]] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Recognize custom entities in a batch of documents.\n\n\n\n````python\n\n from azure.core.credentials\ - \ import AzureKeyCredential\n from azure.ai.textanalytics.aio import TextAnalyticsClient\n\ - \n endpoint = os.environ[\"AZURE_LANGUAGE_ENDPOINT\"]\n key = os.environ[\"\ - AZURE_LANGUAGE_KEY\"]\n project_name = os.environ[\"CUSTOM_ENTITIES_PROJECT_NAME\"\ - ]\n deployment_name = os.environ[\"CUSTOM_ENTITIES_DEPLOYMENT_NAME\"]\n path_to_sample_document\ - \ = os.path.abspath(\n os.path.join(\n os.path.abspath(__file__),\n\ - \ \"..\",\n \"..\",\n \"./text_samples/custom_entities_sample.txt\"\ - ,\n )\n )\n\n text_analytics_client = TextAnalyticsClient(\n endpoint=endpoint,\n\ - \ credential=AzureKeyCredential(key),\n )\n\n with open(path_to_sample_document)\ - \ as fd:\n document = [fd.read()]\n\n async with text_analytics_client:\n\ - \ poller = await text_analytics_client.begin_recognize_custom_entities(\n\ - \ document,\n project_name=project_name,\n deployment_name=deployment_name\n\ - \ )\n\n document_results = await poller.result()\n\n async for\ - \ custom_entities_result in document_results:\n if custom_entities_result.kind\ - \ == \"CustomEntityRecognition\":\n for entity in custom_entities_result.entities:\n\ - \ print(\n \"Entity '{}' has category\ - \ '{}' with confidence score of '{}'\".format(\n entity.text,\ - \ entity.category, entity.confidence_score\n )\n \ - \ )\n elif custom_entities_result.is_error is True:\n \ - \ print(\"...Is an error with code '{}' and message '{}'\".format(\n\ - \ custom_entities_result.code, custom_entities_result.message\n\ - \ )\n )\n\n ````\n" - uid: azure.ai.textanalytics.aio.TextAnalyticsClient.begin_single_label_classify name: begin_single_label_classify summary: 'Start a long-running custom single label classification operation. @@ -1070,36 +846,6 @@ methods: - ]] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Perform single label classification on a batch of documents.\n\n\n\n````python\n\n from azure.core.credentials\ - \ import AzureKeyCredential\n from azure.ai.textanalytics.aio import TextAnalyticsClient\n\ - \n endpoint = os.environ[\"AZURE_LANGUAGE_ENDPOINT\"]\n key = os.environ[\"\ - AZURE_LANGUAGE_KEY\"]\n project_name = os.environ[\"SINGLE_LABEL_CLASSIFY_PROJECT_NAME\"\ - ]\n deployment_name = os.environ[\"SINGLE_LABEL_CLASSIFY_DEPLOYMENT_NAME\"]\n\ - \ path_to_sample_document = os.path.abspath(\n os.path.join(\n \ - \ os.path.abspath(__file__),\n \"..\",\n \"..\",\n \ - \ \"./text_samples/custom_classify_sample.txt\",\n )\n )\n\n text_analytics_client\ - \ = TextAnalyticsClient(\n endpoint=endpoint,\n credential=AzureKeyCredential(key),\n\ - \ )\n\n with open(path_to_sample_document) as fd:\n document = [fd.read()]\n\ - \n async with text_analytics_client:\n poller = await text_analytics_client.begin_single_label_classify(\n\ - \ document,\n project_name=project_name,\n deployment_name=deployment_name\n\ - \ )\n\n pages = await poller.result()\n\n document_results =\ - \ []\n async for page in pages:\n document_results.append(page)\n\ - \n for doc, classification_result in zip(document, document_results):\n \ - \ if classification_result.kind == \"CustomDocumentClassification\":\n \ - \ classification = classification_result.classifications[0]\n print(\"\ - The document text '{}' was classified as '{}' with confidence score {}.\".format(\n\ - \ doc, classification.category, classification.confidence_score)\n\ - \ )\n elif classification_result.is_error is True:\n \ - \ print(\"Document text '{}' has an error with code '{}' and message '{}'\".format(\n\ - \ doc, classification_result.code, classification_result.message\n\ - \ ))\n\n ````\n" - uid: azure.ai.textanalytics.aio.TextAnalyticsClient.detect_language name: detect_language summary: 'Detect language for a batch of documents. @@ -1199,34 +945,6 @@ methods: - type: azure.core.exceptions.HttpResponseError - type: TypeError - type: ValueError - examples: - - "Detecting language in a batch of documents.\n\n\n\n````python\n\n from azure.core.credentials\ - \ import AzureKeyCredential\n from azure.ai.textanalytics.aio import TextAnalyticsClient\n\ - \n endpoint = os.environ[\"AZURE_LANGUAGE_ENDPOINT\"]\n key = os.environ[\"\ - AZURE_LANGUAGE_KEY\"]\n\n text_analytics_client = TextAnalyticsClient(endpoint=endpoint,\ - \ credential=AzureKeyCredential(key))\n documents = [\n \"\"\"\n \ - \ The concierge Paulette was extremely helpful. Sadly when we arrived the elevator\ - \ was broken, but with Paulette's help we barely noticed this inconvenience.\n\ - \ She arranged for our baggage to be brought up to our room with no extra\ - \ charge and gave us a free meal to refurbish all of the calories we lost from\n\ - \ walking up the stairs :). Can't say enough good things about my experience!\n\ - \ \"\"\",\n \"\"\"\n \u6700\u8FD1\u7531\u4E8E\u5DE5\u4F5C\u538B\ - \u529B\u592A\u5927\uFF0C\u6211\u4EEC\u51B3\u5B9A\u53BB\u5BCC\u9152\u5E97\u5EA6\ - \u5047\u3002\u90A3\u513F\u7684\u6E29\u6CC9\u5B9E\u5728\u592A\u8212\u670D\u4E86\ - \uFF0C\u6211\u8DDF\u6211\u4E08\u592B\u90FD\u5B8C\u5168\u6062\u590D\u4E86\u5DE5\ - \u4F5C\u524D\u7684\u9752\u6625\u7CBE\u795E\uFF01\u52A0\u6CB9\uFF01\n \"\"\ - \"\n ]\n async with text_analytics_client:\n result = await text_analytics_client.detect_language(documents)\n\ - \n reviewed_docs = [doc for doc in result if not doc.is_error]\n\n print(\"\ - Let's see what language each review is in!\")\n\n for idx, doc in enumerate(reviewed_docs):\n\ - \ print(\"Review #{} is in '{}', which has ISO639-1 name '{}'\\n\".format(\n\ - \ idx, doc.primary_language.name, doc.primary_language.iso6391_name\n\ - \ ))\n\n ````\n" - uid: azure.ai.textanalytics.aio.TextAnalyticsClient.extract_key_phrases name: extract_key_phrases summary: 'Extract key phrases from a batch of documents. @@ -1332,31 +1050,6 @@ methods: - type: azure.core.exceptions.HttpResponseError - type: TypeError - type: ValueError - examples: - - "Extract the key phrases in a batch of documents.\n\n\n\n````python\n\n from azure.core.credentials\ - \ import AzureKeyCredential\n from azure.ai.textanalytics.aio import TextAnalyticsClient\n\ - \n endpoint = os.environ[\"AZURE_LANGUAGE_ENDPOINT\"]\n key = os.environ[\"\ - AZURE_LANGUAGE_KEY\"]\n\n text_analytics_client = TextAnalyticsClient(endpoint=endpoint,\ - \ credential=AzureKeyCredential(key))\n articles = [\n \"\"\"\n \ - \ Washington, D.C. Autumn in DC is a uniquely beautiful season. The leaves fall\ - \ from the trees\n in a city chock-full of forests, leaving yellow leaves\ - \ on the ground and a clearer view of the\n blue sky above...\n \"\ - \"\",\n \"\"\"\n Redmond, WA. In the past few days, Microsoft has\ - \ decided to further postpone the start date of\n its United States workers,\ - \ due to the pandemic that rages with no end in sight...\n \"\"\",\n \ - \ \"\"\"\n Redmond, WA. Employees at Microsoft can be excited about the\ - \ new coffee shop that will open on campus\n once workers no longer have\ - \ to work remotely...\n \"\"\"\n ]\n\n async with text_analytics_client:\n\ - \ result = await text_analytics_client.extract_key_phrases(articles)\n\n\ - \ for idx, doc in enumerate(result):\n if not doc.is_error:\n \ - \ print(\"Key phrases in article #{}: {}\".format(\n idx + 1,\n\ - \ \", \".join(doc.key_phrases)\n ))\n\n ````\n" - uid: azure.ai.textanalytics.aio.TextAnalyticsClient.recognize_entities name: recognize_entities summary: 'Recognize entities for a batch of documents. @@ -1472,31 +1165,6 @@ methods: - type: azure.core.exceptions.HttpResponseError - type: TypeError - type: ValueError - examples: - - "Recognize entities in a batch of documents.\n\n\n\n````python\n\n from azure.core.credentials\ - \ import AzureKeyCredential\n from azure.ai.textanalytics.aio import TextAnalyticsClient\n\ - \n endpoint = os.environ[\"AZURE_LANGUAGE_ENDPOINT\"]\n key = os.environ[\"\ - AZURE_LANGUAGE_KEY\"]\n\n text_analytics_client = TextAnalyticsClient(endpoint=endpoint,\ - \ credential=AzureKeyCredential(key))\n reviews = [\n \"\"\"I work for\ - \ Foo Company, and we hired Contoso for our annual founding ceremony. The food\n\ - \ was amazing and we all can't say enough good words about the quality and\ - \ the level of service.\"\"\",\n \"\"\"We at the Foo Company re-hired Contoso\ - \ after all of our past successes with the company.\n Though the food was\ - \ still great, I feel there has been a quality drop since their last time\n \ - \ catering for us. Is anyone else running into the same problem?\"\"\",\n\ - \ \"\"\"Bar Company is over the moon about the service we received from\ - \ Contoso, the best sliders ever!!!!\"\"\"\n ]\n\n async with text_analytics_client:\n\ - \ result = await text_analytics_client.recognize_entities(reviews)\n\n \ - \ result = [review for review in result if not review.is_error]\n\n for idx,\ - \ review in enumerate(result):\n for entity in review.entities:\n \ - \ print(f\"Entity '{entity.text}' has category '{entity.category}'\")\n\n\ - \ ````\n" - uid: azure.ai.textanalytics.aio.TextAnalyticsClient.recognize_linked_entities name: recognize_linked_entities summary: 'Recognize linked entities from a well-known knowledge base for a batch @@ -1615,32 +1283,6 @@ methods: - type: azure.core.exceptions.HttpResponseError - type: TypeError - type: ValueError - examples: - - "Recognize linked entities in a batch of documents.\n\n\n\n````python\n\n from azure.core.credentials\ - \ import AzureKeyCredential\n from azure.ai.textanalytics.aio import TextAnalyticsClient\n\ - \n endpoint = os.environ[\"AZURE_LANGUAGE_ENDPOINT\"]\n key = os.environ[\"\ - AZURE_LANGUAGE_KEY\"]\n\n text_analytics_client = TextAnalyticsClient(endpoint=endpoint,\ - \ credential=AzureKeyCredential(key))\n documents = [\n \"\"\"\n \ - \ Microsoft was founded by Bill Gates with some friends he met at Harvard. One\ - \ of his friends,\n Steve Ballmer, eventually became CEO after Bill Gates\ - \ as well. Steve Ballmer eventually stepped\n down as CEO of Microsoft,\ - \ and was succeeded by Satya Nadella.\n Microsoft originally moved its headquarters\ - \ to Bellevue, Washington in January 1979, but is now\n headquartered in\ - \ Redmond.\n \"\"\"\n ]\n\n async with text_analytics_client:\n \ - \ result = await text_analytics_client.recognize_linked_entities(documents)\n\ - \n docs = [doc for doc in result if not doc.is_error]\n\n print(\n \"\ - Let's map each entity to it's Wikipedia article. I also want to see how many times\ - \ each \"\n \"entity is mentioned in a document\\n\\n\"\n )\n entity_to_url\ - \ = {}\n for doc in docs:\n for entity in doc.entities:\n print(\"\ - Entity '{}' has been mentioned '{}' time(s)\".format(\n entity.name,\ - \ len(entity.matches)\n ))\n if entity.data_source == \"Wikipedia\"\ - :\n entity_to_url[entity.name] = entity.url\n\n ````\n" - uid: azure.ai.textanalytics.aio.TextAnalyticsClient.recognize_pii_entities name: recognize_pii_entities summary: 'Recognize entities containing personal information for a batch of documents. @@ -1774,27 +1416,3 @@ methods: - type: azure.core.exceptions.HttpResponseError - type: TypeError - type: ValueError - examples: - - "Recognize personally identifiable information entities in a batch of documents.\n\n\n\n````python\n\n from azure.core.credentials\ - \ import AzureKeyCredential\n from azure.ai.textanalytics import TextAnalyticsClient\n\ - \n endpoint = os.environ[\"AZURE_LANGUAGE_ENDPOINT\"]\n key = os.environ[\"\ - AZURE_LANGUAGE_KEY\"]\n\n text_analytics_client = TextAnalyticsClient(\n \ - \ endpoint=endpoint, credential=AzureKeyCredential(key)\n )\n documents\ - \ = [\n \"\"\"Parker Doe has repaid all of their loans as of 2020-04-25.\n\ - \ Their SSN is 859-98-0987. To contact them, use their phone number\n \ - \ 555-555-5555. They are originally from Brazil and have Brazilian CPF number\ - \ 998.214.865-68\"\"\"\n ]\n\n result = text_analytics_client.recognize_pii_entities(documents)\n\ - \ docs = [doc for doc in result if not doc.is_error]\n\n print(\n \"\ - Let's compare the original document with the documents after redaction. \"\n \ - \ \"I also want to comb through all of the entities that got redacted\"\n\ - \ )\n for idx, doc in enumerate(docs):\n print(f\"Document text: {documents[idx]}\"\ - )\n print(f\"Redacted document text: {doc.redacted_text}\")\n for\ - \ entity in doc.entities:\n print(\"...Entity '{}' with category '{}'\ - \ got redacted\".format(\n entity.text, entity.category\n \ - \ ))\n\n\n ````\n" diff --git a/docs-ref-autogen/azure-ai-translation-document/azure.ai.translation.document.DocumentTranslationClient.yml b/docs-ref-autogen/azure-ai-translation-document/azure.ai.translation.document.DocumentTranslationClient.yml index 1dcf065ac6b3..088b902133d1 100644 --- a/docs-ref-autogen/azure-ai-translation-document/azure.ai.translation.document.DocumentTranslationClient.yml +++ b/docs-ref-autogen/azure-ai-translation-document/azure.ai.translation.document.DocumentTranslationClient.yml @@ -41,30 +41,6 @@ constructor: types: - - -examples: -- "Creating the DocumentTranslationClient with an endpoint and API key.\n\n\n\n````python\n\n from azure.core.credentials import AzureKeyCredential\n\ - \ from azure.ai.translation.document import DocumentTranslationClient\n\n endpoint\ - \ = os.environ[\"AZURE_DOCUMENT_TRANSLATION_ENDPOINT\"]\n key = os.environ[\"\ - AZURE_DOCUMENT_TRANSLATION_KEY\"]\n\n document_translation_client = DocumentTranslationClient(endpoint,\ - \ AzureKeyCredential(key))\n\n ````\n\nCreating the DocumentTranslationClient\ - \ with a token credential.\n\n\n\n````python\n\n \"\"\"DefaultAzureCredential\ - \ will use the values from these environment\n variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,\ - \ AZURE_CLIENT_SECRET\n \"\"\"\n from azure.identity import DefaultAzureCredential\n\ - \ from azure.ai.translation.document import DocumentTranslationClient\n\n endpoint\ - \ = os.environ[\"AZURE_DOCUMENT_TRANSLATION_ENDPOINT\"]\n credential = DefaultAzureCredential()\n\ - \n document_translation_client = DocumentTranslationClient(endpoint, credential)\n\ - \n ````\n" methods: - uid: azure.ai.translation.document.DocumentTranslationClient.begin_translation name: begin_translation @@ -197,33 +173,6 @@ methods: - [[]] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Translate the documents in your storage container.\n\n\n\n````python\n\n import os\n from azure.core.credentials\ - \ import AzureKeyCredential\n from azure.ai.translation.document import DocumentTranslationClient\n\ - \n endpoint = os.environ[\"AZURE_DOCUMENT_TRANSLATION_ENDPOINT\"]\n key =\ - \ os.environ[\"AZURE_DOCUMENT_TRANSLATION_KEY\"]\n source_container_url = os.environ[\"\ - AZURE_SOURCE_CONTAINER_URL\"]\n target_container_url = os.environ[\"AZURE_TARGET_CONTAINER_URL\"\ - ]\n\n client = DocumentTranslationClient(endpoint, AzureKeyCredential(key))\n\ - \n poller = client.begin_translation(source_container_url, target_container_url,\ - \ \"fr\")\n result = poller.result()\n\n print(f\"Status: {poller.status()}\"\ - )\n print(f\"Created on: {poller.details.created_on}\")\n print(f\"Last updated\ - \ on: {poller.details.last_updated_on}\")\n print(f\"Total number of translations\ - \ on documents: {poller.details.documents_total_count}\")\n\n print(\"\\nOf\ - \ total documents...\")\n print(f\"{poller.details.documents_failed_count} failed\"\ - )\n print(f\"{poller.details.documents_succeeded_count} succeeded\")\n\n for\ - \ document in result:\n print(f\"Document ID: {document.id}\")\n print(f\"\ - Document status: {document.status}\")\n if document.status == \"Succeeded\"\ - :\n print(f\"Source document location: {document.source_document_url}\"\ - )\n print(f\"Translated document location: {document.translated_document_url}\"\ - )\n print(f\"Translated to language: {document.translated_to}\\n\")\n\ - \ else:\n print(f\"Error Code: {document.error.code}, Message:\ - \ {document.error.message}\\n\")\n\n ````\n" - uid: azure.ai.translation.document.DocumentTranslationClient.cancel_translation name: cancel_translation summary: 'Cancel a currently processing or queued translation operation. @@ -384,34 +333,6 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "List all the document statuses as they are being translated.\n\n\n\n````python\n\n import os\n import time\n\ - \ from azure.core.credentials import AzureKeyCredential\n from azure.ai.translation.document\ - \ import DocumentTranslationClient\n\n endpoint = os.environ[\"AZURE_DOCUMENT_TRANSLATION_ENDPOINT\"\ - ]\n key = os.environ[\"AZURE_DOCUMENT_TRANSLATION_KEY\"]\n source_container_url\ - \ = os.environ[\"AZURE_SOURCE_CONTAINER_URL\"]\n target_container_url = os.environ[\"\ - AZURE_TARGET_CONTAINER_URL\"]\n\n client = DocumentTranslationClient(endpoint,\ - \ AzureKeyCredential(key))\n\n poller = client.begin_translation(source_container_url,\ - \ target_container_url, \"es\")\n\n completed_docs = []\n while not poller.done():\n\ - \ time.sleep(30)\n\n doc_statuses = client.list_document_statuses(poller.id)\n\ - \ for document in doc_statuses:\n if document.id not in completed_docs:\n\ - \ if document.status == \"Succeeded\":\n print(f\"\ - Document at {document.source_document_url} was translated to {document.translated_to}\ - \ \"\n f\"language. You can find translated document at\ - \ {document.translated_document_url}\")\n completed_docs.append(document.id)\n\ - \ if document.status == \"Failed\":\n print(f\"\ - Document at {document.source_document_url} failed translation. \"\n \ - \ f\"Error Code: {document.error.code}, Message: {document.error.message}\"\ - )\n completed_docs.append(document.id)\n if document.status\ - \ == \"Running\":\n print(f\"Document ID: {document.id}, translation\ - \ progress is \"\n f\"{document.translation_progress *\ - \ 100} percent\")\n\n print(\"\\nTranslation completed.\")\n\n ````\n" - uid: azure.ai.translation.document.DocumentTranslationClient.list_translation_statuses name: list_translation_statuses summary: List all the submitted translation operations under the Document Translation @@ -472,25 +393,3 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "List all submitted translations under the resource.\n\n\n\n````python\n\n from azure.core.credentials import AzureKeyCredential\n\ - \ from azure.ai.translation.document import DocumentTranslationClient\n\n\n\ - \ endpoint = os.environ[\"AZURE_DOCUMENT_TRANSLATION_ENDPOINT\"]\n key = os.environ[\"\ - AZURE_DOCUMENT_TRANSLATION_KEY\"]\n\n client = DocumentTranslationClient(endpoint,\ - \ AzureKeyCredential(key))\n operations = client.list_translation_statuses()\ - \ # type: ItemPaged[TranslationStatus]\n\n for operation in operations:\n \ - \ print(f\"ID: {operation.id}\")\n print(f\"Status: {operation.status}\"\ - )\n print(f\"Created on: {operation.created_on}\")\n print(f\"Last\ - \ updated on: {operation.last_updated_on}\")\n print(f\"Total number of\ - \ operations on documents: {operation.documents_total_count}\")\n print(f\"\ - Total number of characters charged: {operation.total_characters_charged}\")\n\n\ - \ print(\"\\nOf total documents...\")\n print(f\"{operation.documents_failed_count}\ - \ failed\")\n print(f\"{operation.documents_succeeded_count} succeeded\"\ - )\n print(f\"{operation.documents_canceled_count} canceled\\n\")\n\n\n \ - \ ````\n" diff --git a/docs-ref-autogen/azure-ai-translation-document/azure.ai.translation.document.aio.DocumentTranslationClient.yml b/docs-ref-autogen/azure-ai-translation-document/azure.ai.translation.document.aio.DocumentTranslationClient.yml index 08aead065efd..8ccd62c42d02 100644 --- a/docs-ref-autogen/azure-ai-translation-document/azure.ai.translation.document.aio.DocumentTranslationClient.yml +++ b/docs-ref-autogen/azure-ai-translation-document/azure.ai.translation.document.aio.DocumentTranslationClient.yml @@ -41,30 +41,6 @@ constructor: types: - - -examples: -- "Creating the DocumentTranslationClient with an endpoint and API key.\n\n\n\n````python\n\n from azure.core.credentials\ - \ import AzureKeyCredential\n from azure.ai.translation.document.aio import DocumentTranslationClient\n\ - \n endpoint = os.environ[\"AZURE_DOCUMENT_TRANSLATION_ENDPOINT\"]\n key = os.environ[\"\ - AZURE_DOCUMENT_TRANSLATION_KEY\"]\n\n document_translation_client = DocumentTranslationClient(endpoint,\ - \ AzureKeyCredential(key))\n\n ````\n\nCreating the DocumentTranslationClient\ - \ with a token credential.\n\n\n\n````python\n\n \"\"\"DefaultAzureCredential\ - \ will use the values from these environment\n variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,\ - \ AZURE_CLIENT_SECRET\n \"\"\"\n from azure.identity.aio import DefaultAzureCredential\n\ - \ from azure.ai.translation.document.aio import DocumentTranslationClient\n\n\ - \ endpoint = os.environ[\"AZURE_DOCUMENT_TRANSLATION_ENDPOINT\"]\n credential\ - \ = DefaultAzureCredential()\n\n document_translation_client = DocumentTranslationClient(endpoint,\ - \ credential)\n\n ````\n" methods: - uid: azure.ai.translation.document.aio.DocumentTranslationClient.begin_translation name: begin_translation @@ -197,33 +173,6 @@ methods: - [[]] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Translate the documents in your storage container.\n\n\n\n````python\n\n import os\n\ - \ from azure.core.credentials import AzureKeyCredential\n from azure.ai.translation.document.aio\ - \ import DocumentTranslationClient\n\n endpoint = os.environ[\"AZURE_DOCUMENT_TRANSLATION_ENDPOINT\"\ - ]\n key = os.environ[\"AZURE_DOCUMENT_TRANSLATION_KEY\"]\n source_container_url\ - \ = os.environ[\"AZURE_SOURCE_CONTAINER_URL\"]\n target_container_url = os.environ[\"\ - AZURE_TARGET_CONTAINER_URL\"]\n\n client = DocumentTranslationClient(endpoint,\ - \ AzureKeyCredential(key))\n\n async with client:\n poller = await client.begin_translation(source_container_url,\ - \ target_container_url, \"fr\")\n result = await poller.result()\n\n \ - \ print(f\"Status: {poller.status()}\")\n print(f\"Created on: {poller.details.created_on}\"\ - )\n print(f\"Last updated on: {poller.details.last_updated_on}\")\n \ - \ print(f\"Total number of translations on documents: {poller.details.documents_total_count}\"\ - )\n\n print(\"\\nOf total documents...\")\n print(f\"{poller.details.documents_failed_count}\ - \ failed\")\n print(f\"{poller.details.documents_succeeded_count} succeeded\"\ - )\n\n async for document in result:\n print(f\"Document ID: {document.id}\"\ - )\n print(f\"Document status: {document.status}\")\n if document.status\ - \ == \"Succeeded\":\n print(f\"Source document location: {document.source_document_url}\"\ - )\n print(f\"Translated document location: {document.translated_document_url}\"\ - )\n print(f\"Translated to language: {document.translated_to}\\\ - n\")\n else:\n print(f\"Error Code: {document.error.code},\ - \ Message: {document.error.message}\\n\")\n\n ````\n" - uid: azure.ai.translation.document.aio.DocumentTranslationClient.cancel_translation name: cancel_translation summary: 'Cancel a currently processing or queued translation operation. @@ -385,36 +334,6 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "List all the document statuses as they are being translated.\n\n\n\n````python\n\n import os\n\ - \ from azure.core.credentials import AzureKeyCredential\n from azure.ai.translation.document.aio\ - \ import DocumentTranslationClient\n\n endpoint = os.environ[\"AZURE_DOCUMENT_TRANSLATION_ENDPOINT\"\ - ]\n key = os.environ[\"AZURE_DOCUMENT_TRANSLATION_KEY\"]\n source_container_url\ - \ = os.environ[\"AZURE_SOURCE_CONTAINER_URL\"]\n target_container_url = os.environ[\"\ - AZURE_TARGET_CONTAINER_URL\"]\n\n client = DocumentTranslationClient(endpoint,\ - \ AzureKeyCredential(key))\n\n async with client:\n poller = await client.begin_translation(source_container_url,\ - \ target_container_url, \"es\")\n\n completed_docs = []\n while poller.status()\ - \ in [\"Running\", \"NotStarted\"]:\n await asyncio.sleep(30)\n\n \ - \ doc_statuses = client.list_document_statuses(poller.id)\n \ - \ async for document in doc_statuses:\n if document.id not in completed_docs:\n\ - \ if document.status == \"Succeeded\":\n \ - \ print(f\"Document at {document.source_document_url} was translated to {document.translated_to}\ - \ \"\n f\"language. You can find translated document\ - \ at {document.translated_document_url}\")\n completed_docs.append(document.id)\n\ - \ if document.status == \"Failed\":\n \ - \ print(f\"Document at {document.source_document_url} failed translation. \"\n\ - \ f\"Error Code: {document.error.code}, Message: {document.error.message}\"\ - )\n completed_docs.append(document.id)\n \ - \ if document.status == \"Running\":\n print(f\"Document\ - \ ID: {document.id}, translation progress is \"\n \ - \ f\"{document.translation_progress * 100} percent\")\n\n print(\"\\nTranslation\ - \ completed.\")\n\n ````\n" - uid: azure.ai.translation.document.aio.DocumentTranslationClient.list_translation_statuses name: list_translation_statuses summary: List all the submitted translation operations under the Document Translation @@ -475,25 +394,3 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "List all submitted translations under the resource.\n\n\n\n````python\n\n from azure.core.credentials\ - \ import AzureKeyCredential\n from azure.ai.translation.document.aio import\ - \ DocumentTranslationClient\n\n endpoint = os.environ[\"AZURE_DOCUMENT_TRANSLATION_ENDPOINT\"\ - ]\n key = os.environ[\"AZURE_DOCUMENT_TRANSLATION_KEY\"]\n\n client = DocumentTranslationClient(endpoint,\ - \ AzureKeyCredential(key))\n async with client:\n operations = client.list_translation_statuses()\ - \ # type: AsyncItemPaged[TranslationStatus]\n\n async for operation in\ - \ operations:\n print(f\"ID: {operation.id}\")\n print(f\"\ - Status: {operation.status}\")\n print(f\"Created on: {operation.created_on}\"\ - )\n print(f\"Last updated on: {operation.last_updated_on}\")\n \ - \ print(f\"Total number of operations on documents: {operation.documents_total_count}\"\ - )\n print(f\"Total number of characters charged: {operation.total_characters_charged}\"\ - )\n\n print(\"\\nOf total documents...\")\n print(f\"{operation.documents_failed_count}\ - \ failed\")\n print(f\"{operation.documents_succeeded_count} succeeded\"\ - )\n print(f\"{operation.documents_canceled_count} canceled\\n\")\n\n\ - \ ````\n" diff --git a/docs-ref-autogen/azure-communication-chat/azure.communication.chat.ChatClient.yml b/docs-ref-autogen/azure-communication-chat/azure.communication.chat.ChatClient.yml index a87444e515b7..b0c26e5c434b 100644 --- a/docs-ref-autogen/azure-communication-chat/azure.communication.chat.ChatClient.yml +++ b/docs-ref-autogen/azure-communication-chat/azure.communication.chat.ChatClient.yml @@ -25,16 +25,6 @@ constructor: isRequired: true types: - -examples: -- "Creating the ChatClient from a URL and token.\n\n\n\n````python\n\n from azure.communication.chat\ - \ import ChatClient, CommunicationTokenCredential\n\n # set `endpoint` to an existing\ - \ ACS endpoint\n chat_client = ChatClient(endpoint, CommunicationTokenCredential(token))\n\ - \n ````\n" methods: - uid: azure.communication.chat.ChatClient.close name: close @@ -76,25 +66,6 @@ methods: - exceptions: - type: , - examples: - - "Creating a new chat thread.\n\n\n\n````python\n\ - \n from datetime import datetime\n\n from azure.communication.chat import(\n\ - \ ChatClient,\n ChatParticipant,\n CommunicationUserIdentifier,\n\ - \ CommunicationTokenCredential\n )\n\n # set `endpoint` to an existing\ - \ ACS endpoint\n chat_client = ChatClient(endpoint, CommunicationTokenCredential(token))\n\ - \n topic = \"test topic\"\n participants = [ChatParticipant(\n identifier=user,\n\ - \ display_name='name',\n share_history_time=datetime.utcnow()\n \ - \ )]\n\n # creates a new chat_thread everytime\n create_chat_thread_result\ - \ = chat_client.create_chat_thread(topic, thread_participants=participants)\n\n\ - \ # creates a new chat_thread if not exists\n idempotency_token = 'b66d6031-fdcc-41df-8306-e524c9f226b8'\ - \ # unique identifier\n create_chat_thread_result_w_repeatability_id = chat_client.create_chat_thread(\n\ - \ topic,\n thread_participants=participants,\n idempotency_token=idempotency_token\n\ - \ )\n\n ````\n" - uid: azure.communication.chat.ChatClient.delete_chat_thread name: delete_chat_thread summary: Deletes a chat thread. @@ -111,17 +82,6 @@ methods: - exceptions: - type: , - examples: - - "Deleting a chat thread.\n\ - \n\n\n````python\n\ - \n from azure.communication.chat import ChatClient, CommunicationTokenCredential\n\ - \n # set `endpoint` to an existing ACS endpoint\n chat_client = ChatClient(endpoint,\ - \ CommunicationTokenCredential(token))\n\n # set `thread_id` to an existing\ - \ chat thread id\n chat_client.delete_chat_thread(thread_id)\n\n ````\n" - uid: azure.communication.chat.ChatClient.get_chat_thread_client name: get_chat_thread_client summary: Get ChatThreadClient by providing a thread_id. @@ -138,18 +98,6 @@ methods: - exceptions: - type: , - examples: - - "Retrieving the ChatThreadClient from an existing chat thread id.\n\n\n\ - \n````python\n\n from azure.communication.chat import ChatClient, CommunicationTokenCredential\n\ - \n # set `endpoint` to an existing ACS endpoint\n chat_client = ChatClient(endpoint,\ - \ CommunicationTokenCredential(token))\n\n # set `thread_id` to an existing\ - \ chat thread id\n chat_thread_client = chat_client.get_chat_thread_client(thread_id)\n\ - \n ````\n" - uid: azure.communication.chat.ChatClient.list_chat_threads name: list_chat_threads summary: Gets the list of chat threads of a user. @@ -169,18 +117,3 @@ methods: - [] exceptions: - type: , - examples: - - "Listing chat threads.\n\ - \n\n\n````python\n\ - \n from azure.communication.chat import ChatClient, CommunicationTokenCredential\n\ - \ from datetime import datetime, timedelta\n\n # set `endpoint` to an existing\ - \ ACS endpoint\n chat_client = ChatClient(endpoint, CommunicationTokenCredential(token))\n\ - \ start_time = datetime.utcnow() - timedelta(days=2)\n chat_threads = chat_client.list_chat_threads(results_per_page=5,\ - \ start_time=start_time)\n\n print(\"list_threads succeeded with results_per_page\ - \ is 5, and were created since 2 days ago.\")\n for chat_thread_item_page in\ - \ chat_threads.by_page():\n for chat_thread_item in chat_thread_item_page:\n\ - \ print(\"thread id:\", chat_thread_item.id)\n\n ````\n" diff --git a/docs-ref-autogen/azure-communication-chat/azure.communication.chat.ChatThreadClient.yml b/docs-ref-autogen/azure-communication-chat/azure.communication.chat.ChatThreadClient.yml index a7e982e314f0..3bc944c4b771 100644 --- a/docs-ref-autogen/azure-communication-chat/azure.communication.chat.ChatThreadClient.yml +++ b/docs-ref-autogen/azure-communication-chat/azure.communication.chat.ChatThreadClient.yml @@ -43,24 +43,6 @@ variables: name: thread_id types: - -examples: -- "Creating the ChatThreadClient.\n\n\n\n````python\n\n from datetime\ - \ import datetime\n from azure.communication.chat import (\n ChatClient,\n\ - \ ChatParticipant,\n CommunicationUserIdentifier,\n CommunicationTokenCredential\n\ - \ )\n # retrieve `token` using CommunicationIdentityClient.get_token method\n\ - \ # set `endpoint` to ACS service endpoint\n # create `user` using CommunicationIdentityClient.create_user\ - \ method for new users;\n # else for existing users set `user` = CommunicationUserIdentifier(some_user_id)\n\ - \ chat_client = ChatClient(endpoint, CommunicationTokenCredential(token))\n \ - \ topic = \"test topic\"\n participants = [ChatParticipant(\n identifier=user,\n\ - \ display_name='name',\n share_history_time=datetime.utcnow()\n )]\n\ - \ create_chat_thread_result = chat_client.create_chat_thread(topic, thread_participants=participants)\n\ - \ chat_thread_client = chat_client.get_chat_thread_client(create_chat_thread_result.chat_thread.id)\n\ - \n ````\n" methods: - uid: azure.communication.chat.ChatThreadClient.add_participants name: add_participants @@ -87,26 +69,6 @@ methods: - [[, ]] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Adding participants to chat thread.\n\n\n\n````python\n\ - \n from azure.communication.chat import ChatParticipant\n from datetime import\ - \ datetime\n\n def decide_to_retry(error):\n \"\"\"\n Custom logic\ - \ to decide whether to retry to add or not\n \"\"\"\n return True\n\ - \n # set `thread_id` to an existing thread id\n chat_thread_client = chat_client.get_chat_thread_client(thread_id=thread_id)\n\ - \n # create `user` using CommunicationIdentityClient.create_user method for\ - \ new users;\n # else for existing users set `user` = CommunicationUserIdentifier(some_user_id)\n\ - \ new_participant = ChatParticipant(\n identifier=user,\n display_name='name',\n\ - \ share_history_time=datetime.utcnow())\n\n # create list containing one\ - \ or more participants\n thread_participants = [new_participant]\n result\ - \ = chat_thread_client.add_participants(thread_participants)\n\n # list of participants\ - \ which were unsuccessful to be added to chat thread\n retry = [p for p, e in\ - \ result if decide_to_retry(e)]\n if retry:\n chat_thread_client.add_participants(retry)\n\ - \n ````\n" - uid: azure.communication.chat.ChatThreadClient.close name: close signature: close() -> None @@ -126,16 +88,6 @@ methods: - exceptions: - type: , - examples: - - "Deleting a message.\n\n\n\n````python\n\ - \n # set `thread_id` to an existing thread id\n chat_thread_client = chat_client.get_chat_thread_client(thread_id=thread_id)\n\ - \n # set `message_id` to an existing message id\n chat_thread_client.delete_message(message_id)\n\ - \n ````\n" - uid: azure.communication.chat.ChatThreadClient.get_message name: get_message summary: Gets a message by id. @@ -152,17 +104,6 @@ methods: - exceptions: - type: , - examples: - - "Retrieving a message by message id.\n\n\n\n````python\n\ - \n # set `thread_id` to an existing thread id\n chat_thread_client = chat_client.get_chat_thread_client(thread_id=thread_id)\n\ - \n # set `message_id` to an existing message id\n chat_message = chat_thread_client.get_message(message_id)\n\ - \n print(\"Message received: ChatMessage: content=\", chat_message.content.message,\ - \ \", id=\", chat_message.id)\n\n ````\n" - uid: azure.communication.chat.ChatThreadClient.get_properties name: get_properties summary: Gets the properties of the chat thread. @@ -173,19 +114,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Retrieving chat thread properties by chat thread id.\n\n\n\n````python\n\n from azure.communication.chat import\ - \ ChatClient, CommunicationTokenCredential\n\n # set `endpoint` to an existing\ - \ ACS endpoint\n chat_client = ChatClient(endpoint, CommunicationTokenCredential(token))\n\ - \ chat_thread_client = chat_client.get_chat_thread_client(thread_id)\n chat_thread_properties\ - \ = chat_thread_client.get_properties()\n print('Expected Thread Id: ', thread_id,\ - \ ' Actual Value: ', chat_thread_properties.id)\n\n ````\n" - uid: azure.communication.chat.ChatThreadClient.list_messages name: list_messages summary: 'Gets a list of messages from a thread. @@ -208,20 +136,6 @@ methods: description: The earliest point in time to get messages up to. types: - - examples: - - "Listing messages of a chat thread.\n\n\n\n````python\n\ - \n from datetime import datetime, timedelta\n\n # set `thread_id` to an existing\ - \ thread id\n chat_thread_client = chat_client.get_chat_thread_client(thread_id=thread_id)\n\ - \n start_time = datetime.utcnow() - timedelta(days=1)\n chat_messages = chat_thread_client.list_messages(results_per_page=1,\ - \ start_time=start_time)\n\n print(\"list_messages succeeded with results_per_page\ - \ is 1, and start time is yesterday UTC\")\n for chat_message_page in chat_messages.by_page():\n\ - \ for chat_message in chat_message_page:\n print(\"ChatMessage:\ - \ message=\", chat_message.content.message)\n\n ````\n" - uid: azure.communication.chat.ChatThreadClient.list_participants name: list_participants summary: Gets the participants of a thread. @@ -241,18 +155,6 @@ methods: - [] exceptions: - type: , - examples: - - "Listing participants of chat thread.\n\n\n\n````python\n\ - \n\n # set `thread_id` to an existing thread id\n chat_thread_client = chat_client.get_chat_thread_client(thread_id=thread_id)\n\ - \n chat_thread_participants = chat_thread_client.list_participants()\n\n for\ - \ chat_thread_participant_page in chat_thread_participants.by_page():\n \ - \ for chat_thread_participant in chat_thread_participant_page:\n print(\"\ - ChatParticipant: \", chat_thread_participant)\n\n ````\n" - uid: azure.communication.chat.ChatThreadClient.list_read_receipts name: list_read_receipts summary: Gets read receipts for a thread. @@ -273,17 +175,6 @@ methods: - [] exceptions: - type: , - examples: - - "Listing read receipts.\n\n\n\n````python\n\ - \n # set `thread_id` to an existing thread id\n chat_thread_client = chat_client.get_chat_thread_client(thread_id=thread_id)\n\ - \n read_receipts = chat_thread_client.list_read_receipts()\n\n for read_receipt_page\ - \ in read_receipts.by_page():\n for read_receipt in read_receipt_page:\n\ - \ print(read_receipt)\n\n ````\n" - uid: azure.communication.chat.ChatThreadClient.remove_participant name: remove_participant summary: Remove a participant from a thread. @@ -302,25 +193,6 @@ methods: - exceptions: - type: , - examples: - - "Removing participant from chat thread.\n\n\n\n````python\n\ - \n # Option 1 : Iterate through all participants, find and delete Fred Flinstone\n\ - \ chat_thread_participants = chat_thread_client.list_participants()\n\n for\ - \ chat_thread_participant_page in chat_thread_participants.by_page():\n \ - \ for chat_thread_participant in chat_thread_participant_page:\n print(\"\ - ChatParticipant: \", chat_thread_participant)\n if chat_thread_participant.identifier.properties['id']\ - \ == user1.properties['id']:\n print(\"Found Fred!\")\n \ - \ chat_thread_client.remove_participant(chat_thread_participant.identifier)\n\ - \ print(\"Fred has been removed from the thread...\")\n \ - \ break\n\n # Option 2: Directly remove Wilma Flinstone\n unique_identifier\ - \ = user2.properties['id'] # in real scenario the identifier would need to be\ - \ retrieved from elsewhere\n chat_thread_client.remove_participant(CommunicationUserIdentifier(unique_identifier))\n\ - \ print(\"Wilma has been removed from the thread...\")\n\n ````\n" - uid: azure.communication.chat.ChatThreadClient.send_message name: send_message summary: Sends a message to a thread. @@ -352,26 +224,6 @@ methods: - exceptions: - type: , - examples: - - "Sending a message.\n\ - \n\n\n````python\n\ - \n from azure.communication.chat import ChatMessageType\n\n # set `thread_id`\ - \ to an existing thread id\n chat_thread_client = chat_client.get_chat_thread_client(thread_id=thread_id)\n\ - \n # Scenario 1: Send message without specifying chat_message_type\n send_message_result\ - \ = chat_thread_client.send_message(\n \"Hello! My name is Fred Flinstone\"\ - ,\n sender_display_name=\"Fred Flinstone\")\n send_message_result_id =\ - \ send_message_result.id\n\n # Scenario 2: Send message specifying chat_message_type\n\ - \ send_message_result_w_type = chat_thread_client.send_message(\n \"Hello!\ - \ My name is Wilma Flinstone\",\n sender_display_name=\"Wilma Flinstone\"\ - ,\n chat_message_type=ChatMessageType.TEXT) # equivalent to setting chat_message_type='text'\n\ - \ send_message_result_w_type_id = send_message_result_w_type.id\n # Verify\ - \ message content\n print(\"First Message:\", chat_thread_client.get_message(send_message_result_id).content.message)\n\ - \ print(\"Second Message:\", chat_thread_client.get_message(send_message_result_w_type_id).content.message)\n\ - \n ````\n" - uid: azure.communication.chat.ChatThreadClient.send_read_receipt name: send_read_receipt summary: Posts a read receipt event to a chat thread, on behalf of a user. @@ -388,16 +240,6 @@ methods: - exceptions: - type: , - examples: - - "Sending read receipt of a chat message.\n\n\n\n````python\n\ - \n # set `thread_id` to an existing thread id\n chat_thread_client = chat_client.get_chat_thread_client(thread_id=thread_id)\n\ - \n # set `message_id` to an existing message id\n chat_thread_client.send_read_receipt(message_id)\n\ - \n ````\n" - uid: azure.communication.chat.ChatThreadClient.send_typing_notification name: send_typing_notification summary: Posts a typing event to a thread, on behalf of a user. @@ -415,15 +257,6 @@ methods: - exceptions: - type: , - examples: - - "Send typing notification.\n\n\n\n````python\n\ - \n # set `thread_id` to an existing thread id\n chat_thread_client = chat_client.get_chat_thread_client(thread_id=thread_id)\n\ - \n chat_thread_client.send_typing_notification()\n\n ````\n" - uid: azure.communication.chat.ChatThreadClient.update_message name: update_message summary: Updates a message. @@ -450,19 +283,6 @@ methods: - exceptions: - type: , - examples: - - "Updating an already sent message.\n\n\n\n````python\n\ - \n # set `thread_id` to an existing thread id\n chat_thread_client = chat_client.get_chat_thread_client(thread_id=thread_id)\n\ - \n # set `message_id` to an existing message id\n previous_content = chat_thread_client.get_message(message_id).content.message\n\ - \ content = \"updated content\"\n chat_thread_client.update_message(message_id,\ - \ content=content)\n\n current_content = chat_thread_client.get_message(message_id).content.message\n\ - \n print(\"Chat Message Updated: Previous value: \", previous_content, \", Current\ - \ value: \", current_content)\n\n ````\n" - uid: azure.communication.chat.ChatThreadClient.update_topic name: update_topic summary: Updates a thread's properties. @@ -482,19 +302,6 @@ methods: - exceptions: - type: , - examples: - - "Updating chat thread.\n\n\n\n````python\n\ - \n # set `thread_id` to an existing thread id\n chat_thread_client = chat_client.get_chat_thread_client(thread_id=thread_id)\n\ - \ chat_thread_properties = chat_thread_client.get_properties()\n previous_topic\ - \ = chat_thread_properties.topic\n\n topic = \"updated thread topic\"\n chat_thread_client.update_topic(topic=topic)\n\ - \n chat_thread_properties = chat_thread_client.get_properties()\n updated_topic\ - \ = chat_thread_properties.topic\n print(\"Chat Thread Topic Update: Previous\ - \ value: \", previous_topic, \", Current value: \", updated_topic)\n\n ````\n" attributes: - uid: azure.communication.chat.ChatThreadClient.thread_id name: thread_id diff --git a/docs-ref-autogen/azure-communication-chat/azure.communication.chat.aio.ChatClient.yml b/docs-ref-autogen/azure-communication-chat/azure.communication.chat.aio.ChatClient.yml index 4fdaf4fc9e01..89ba19fec5d6 100644 --- a/docs-ref-autogen/azure-communication-chat/azure.communication.chat.aio.ChatClient.yml +++ b/docs-ref-autogen/azure-communication-chat/azure.communication.chat.aio.ChatClient.yml @@ -25,16 +25,6 @@ constructor: isRequired: true types: - -examples: -- "Creating the ChatClient from a URL and token.\n\n\n\n````python\n\n from azure.communication.chat.aio\ - \ import ChatClient, CommunicationTokenCredential\n\n # set `endpoint` to an existing\ - \ ACS endpoint\n chat_client = ChatClient(endpoint, CommunicationTokenCredential(token))\n\ - \n ````\n" methods: - uid: azure.communication.chat.aio.ChatClient.close name: close @@ -76,25 +66,6 @@ methods: - exceptions: - type: , - examples: - - "Creating a new chat thread.\n\n\n\n````python\n\ - \n datetime import datetime\n azure.communication.chat.aio import ChatClient,\ - \ CommunicationTokenCredential\n azure.communication.chat import ChatParticipant\n\ - \n t `endpoint` to an existing ACS endpoint\n _client = ChatClient(endpoint,\ - \ CommunicationTokenCredential(token))\n c with chat_client:\n\n topic = \"\ - test topic\"\n participants = [ChatParticipant(\n identifier=self.user,\n\ - \ display_name='name',\n share_history_time=datetime.utcnow()\n \ - \ )]\n # creates a new chat_thread everytime\n create_chat_thread_result =\ - \ await chat_client.create_chat_thread(topic, thread_participants=participants)\n\ - \n # creates a new chat_thread if not exists\n idempotency_token = 'b66d6031-fdcc-41df-8306-e524c9f226b8'\ - \ # unique identifier\n create_chat_thread_result_w_repeatability_id = await\ - \ chat_client.create_chat_thread(\n topic,\n thread_participants=participants,\n\ - \ idempotency_token=idempotency_token)\n\n ````\n" - uid: azure.communication.chat.aio.ChatClient.delete_chat_thread name: delete_chat_thread summary: Deletes a chat thread. @@ -111,18 +82,6 @@ methods: - exceptions: - type: , - examples: - - "Deleting a chat thread.\n\n\n\n````python\n\ - \n azure.communication.chat.aio import ChatClient, CommunicationTokenCredential\n\ - \n t `endpoint` to an existing ACS endpoint\n _client = ChatClient(endpoint,\ - \ CommunicationTokenCredential(token))\n c with chat_client:\n # set `thread_id`\ - \ to an existing chat thread id\n await chat_client.delete_chat_thread(thread_id)\n\ - \n ````\n" - uid: azure.communication.chat.aio.ChatClient.get_chat_thread_client name: get_chat_thread_client summary: Get ChatThreadClient by providing a thread_id. @@ -139,18 +98,6 @@ methods: - exceptions: - type: , - examples: - - "Retrieving the ChatThreadClient from an existing chat thread id.\n\n\n\n````python\n\n from azure.communication.chat.aio import\ - \ ChatClient, CommunicationTokenCredential\n\n # set `endpoint` to an existing\ - \ ACS endpoint\n chat_client = ChatClient(endpoint, CommunicationTokenCredential(token))\n\ - \n # set `thread_id` to an existing chat thread id\n chat_thread_client =\ - \ chat_client.get_chat_thread_client(thread_id)\n\n ````\n" - uid: azure.communication.chat.aio.ChatClient.list_chat_threads name: list_chat_threads summary: Gets the list of chat threads of a user. @@ -170,19 +117,3 @@ methods: - [] exceptions: - type: , - examples: - - "Listing chat threads.\n\n\n\n````python\n\ - \n azure.communication.chat.aio import ChatClient, CommunicationTokenCredential\n\ - \n t `endpoint` to an existing ACS endpoint\n _client = ChatClient(endpoint,\ - \ CommunicationTokenCredential(token))\n c with chat_client:\n\n from datetime\ - \ import datetime, timedelta\n start_time = datetime.utcnow() - timedelta(days=2)\n\ - \ chat_threads = chat_client.list_chat_threads(results_per_page=5, start_time=start_time)\n\ - \ print(\"list_threads succeeded with results_per_page is 5, and were created\ - \ since 2 days ago.\")\n async for chat_thread_item_page in chat_threads.by_page():\n\ - \ async for chat_thread_item in chat_thread_item_page:\n print(\"\ - thread id: \", chat_thread_item.id)\n\n ````\n" diff --git a/docs-ref-autogen/azure-communication-chat/azure.communication.chat.aio.ChatThreadClient.yml b/docs-ref-autogen/azure-communication-chat/azure.communication.chat.aio.ChatThreadClient.yml index 8059bd9c77a7..39ecd60eb48a 100644 --- a/docs-ref-autogen/azure-communication-chat/azure.communication.chat.aio.ChatThreadClient.yml +++ b/docs-ref-autogen/azure-communication-chat/azure.communication.chat.aio.ChatThreadClient.yml @@ -43,22 +43,6 @@ variables: name: thread_id types: - -examples: -- "Creating the ChatThreadClient.\n\n\n\n````python\n\n from datetime\ - \ import datetime\n from azure.communication.chat.aio import ChatClient, CommunicationTokenCredential\n\ - \ from azure.communication.chat import ChatParticipant, CommunicationUserIdentifier\n\ - \ # set `endpoint` to an existing ACS endpoint\n chat_client = ChatClient(endpoint,\ - \ CommunicationTokenCredential(token))\n\n async with chat_client:\n topic\ - \ = \"test topic\"\n participants = [ChatParticipant(\n identifier=user,\n\ - \ display_name='name',\n share_history_time=datetime.utcnow()\n\ - \ )]\n create_chat_thread_result = await chat_client.create_chat_thread(topic,\ - \ thread_participants=participants)\n chat_thread_client = chat_client.get_chat_thread_client(create_chat_thread_result.chat_thread.id)\n\ - \n ````\n" methods: - uid: azure.communication.chat.aio.ChatThreadClient.add_participants name: add_participants @@ -85,24 +69,6 @@ methods: - [[, ]] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Adding participants to chat thread.\n\n\n\n````python\n\ - \n decide_to_retry(error):\n \"\"\"\n Custom logic to decide whether to\ - \ retry to add or not\n \"\"\"\n return True\n\n c with chat_client:\n \ - \ # set `thread_id` to an existing thread id\n chat_thread_client = chat_client.get_chat_thread_client(thread_id=thread_id)\n\ - \ async with chat_thread_client:\n from azure.communication.chat import\ - \ ChatParticipant\n from datetime import datetime\n new_participant\ - \ = ChatParticipant(\n identifier=self.new_user,\n \ - \ display_name='name',\n share_history_time=datetime.utcnow())\n\ - \ thread_participants = [new_participant]\n result = await chat_thread_client.add_participants(thread_participants)\n\ - \n # list of participants which were unsuccessful to be added to chat thread\n\ - \ retry = [p for p, e in result if decide_to_retry(e)]\n if retry:\n\ - \ await chat_thread_client.add_participants(retry)\n\n\n ````\n" - uid: azure.communication.chat.aio.ChatThreadClient.close name: close signature: async close() -> None @@ -122,17 +88,6 @@ methods: - exceptions: - type: , - examples: - - "Deleting a message.\n\n\n\n````python\n\ - \n c with chat_client:\n # set `thread_id` to an existing thread id\n chat_thread_client\ - \ = chat_client.get_chat_thread_client(thread_id=thread_id)\n async with chat_thread_client:\n\ - \ # set `message_id` to an existing message id\n await chat_thread_client.delete_message(message_id)\n\ - \n ````\n" - uid: azure.communication.chat.aio.ChatThreadClient.get_message name: get_message summary: Gets a message by id. @@ -149,19 +104,6 @@ methods: - exceptions: - type: , - examples: - - "Retrieving a message by message id.\n\n\n\n````python\n\ - \n c with chat_client:\n # set `thread_id` to an existing thread id\n chat_thread_client\ - \ = chat_client.get_chat_thread_client(thread_id=thread_id)\n async with chat_thread_client:\n\ - \ # set `message_id` to an existing message id\n chat_message = await\ - \ chat_thread_client.get_message(message_id)\n\n print(\"Message received:\ - \ ChatMessage: content=\", chat_message.content.message, \", id=\", chat_message.id)\n\ - \n ````\n" - uid: azure.communication.chat.aio.ChatThreadClient.get_properties name: get_properties summary: Gets the properties of the chat thread. @@ -172,20 +114,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Retrieving chat thread properties by chat thread id.\n\n\n\n````python\n\n azure.communication.chat.aio\ - \ import ChatClient, CommunicationTokenCredential\n\n t `endpoint` to an existing\ - \ ACS endpoint\n _client = ChatClient(endpoint, CommunicationTokenCredential(token))\n\ - \ c with chat_client:\n chat_thread_client = chat_client.get_chat_thread_client(thread_id)\n\ - \n async with chat_thread_client:\n chat_thread_properties = chat_thread_client.get_properties()\n\ - \ print('Expected Thread Id: ', thread_id, ' Actual Value: ', chat_thread_properties.id)\n\ - \n ````\n" - uid: azure.communication.chat.aio.ChatThreadClient.list_messages name: list_messages summary: Gets a list of messages from a thread. @@ -205,21 +133,6 @@ methods: - [] exceptions: - type: , - examples: - - "Listing messages of a chat thread.\n\n\n\n````python\n\ - \n datetime import datetime, timedelta\n c with chat_client:\n # set `thread_id`\ - \ to an existing thread id\n chat_thread_client = chat_client.get_chat_thread_client(thread_id=thread_id)\n\ - \ async with chat_thread_client:\n start_time = datetime.utcnow() - timedelta(days=1)\n\ - \ chat_messages = chat_thread_client.list_messages(results_per_page=1, start_time=start_time)\n\ - \ print(\"list_messages succeeded with results_per_page is 1, and start\ - \ time is yesterday UTC\")\n async for chat_message_page in chat_messages.by_page():\n\ - \ async for chat_message in chat_message_page:\n print(\"\ - ChatMessage: message=\", chat_message.content.message)\n\n ````\n" - uid: azure.communication.chat.aio.ChatThreadClient.list_participants name: list_participants summary: Gets the participants of a thread. @@ -239,20 +152,6 @@ methods: - [] exceptions: - type: , - examples: - - "Listing participants of chat thread.\n\n\n\n````python\n\ - \n c with chat_client:\n # set `thread_id` to an existing thread id\n chat_thread_client\ - \ = chat_client.get_chat_thread_client(thread_id=thread_id)\n async with chat_thread_client:\n\ - \ chat_thread_participants = chat_thread_client.list_participants()\n \ - \ print(\"list_participants succeeded, participants:\")\n async for\ - \ chat_thread_participant_page in chat_thread_participants.by_page():\n \ - \ async for chat_thread_participant in chat_thread_participant_page:\n \ - \ print(\"ChatParticipant: \", chat_thread_participant)\n\n ````\n" - uid: azure.communication.chat.aio.ChatThreadClient.list_read_receipts name: list_read_receipts summary: Gets read receipts for a thread. @@ -273,19 +172,6 @@ methods: - [] exceptions: - type: , - examples: - - "Listing read receipts.\n\n\n\n````python\n\ - \n c with chat_client:\n # set `thread_id` to an existing thread id\n chat_thread_client\ - \ = chat_client.get_chat_thread_client(thread_id=thread_id)\n async with chat_thread_client:\n\ - \ read_receipts = chat_thread_client.list_read_receipts()\n print(\"\ - list_read_receipts succeeded, receipts:\")\n async for read_receipt_page\ - \ in read_receipts.by_page():\n async for read_receipt in read_receipt_page:\n\ - \ print(read_receipt)\n\n ````\n" - uid: azure.communication.chat.aio.ChatThreadClient.remove_participant name: remove_participant summary: Remove a participant from a thread. @@ -304,25 +190,6 @@ methods: - exceptions: - type: , - examples: - - "Removing participant from chat thread.\n\n\n\n````python\n\ - \n # Option 1 : Iterate through all participants, find and delete Fred Flinstone\n\ - \ chat_thread_participants = chat_thread_client.list_participants()\n\n\ - \ async for chat_thread_participant_page in chat_thread_participants.by_page():\n\ - \ async for chat_thread_participant in chat_thread_participant_page:\n\ - \ print(\"ChatParticipant: \", chat_thread_participant)\n \ - \ if chat_thread_participant.identifier.properties['id'] == user1.properties['id']:\n\ - \ print(\"Found Fred!\")\n await chat_thread_client.remove_participant(chat_thread_participant.identifier)\n\ - \ print(\"Fred has been removed from the thread...\")\n \ - \ break\n\n # Option 2: Directly remove Wilma Flinstone\n\ - \ unique_identifier = user2.properties['id'] # in real scenario the identifier\ - \ would need to be retrieved from elsewhere\n await chat_thread_client.remove_participant(CommunicationUserIdentifier(unique_identifier))\n\ - \ print(\"Wilma has been removed from the thread...\")\n\n ````\n" - uid: azure.communication.chat.aio.ChatThreadClient.send_message name: send_message summary: Sends a message to a thread. @@ -355,29 +222,6 @@ methods: - exceptions: - type: , - examples: - - "Sending a message.\n\n\n\n````python\n\ - \n azure.communication.chat import ChatMessageType\n c with chat_client:\n\ - \ chat_thread_client = chat_client.get_chat_thread_client(thread_id=thread_id)\n\ - \ async with chat_thread_client:\n # Scenario 1: Send message without\ - \ specifying chat_message_type\n send_message_result = await chat_thread_client.send_message(\n\ - \ \"Hello! My name is Fred Flinstone\",\n sender_display_name=\"\ - Fred Flinstone\",\n metadata={\"tags\": \"tags\"})\n send_message_result_id\ - \ = send_message_result.id\n\n # Scenario 2: Send message specifying chat_message_type\n\ - \ send_message_result_w_type = await chat_thread_client.send_message(\n\ - \ \"Hello! My name is Wilma Flinstone\",\n sender_display_name=\"\ - Wilma Flinstone\",\n chat_message_type=ChatMessageType.TEXT) # equivalent\ - \ to setting chat_message_type='text'\n send_message_result_w_type_id =\ - \ send_message_result_w_type.id\n\n # Verify message content\n chat_message_1\ - \ = await chat_thread_client.get_message(send_message_result_id)\n print(\"\ - First Message:\", chat_message_1.content.message, chat_message_1.metadata)\n \ - \ print(\"Second Message:\", (await chat_thread_client.get_message(send_message_result_w_type_id)).content.message)\n\ - \n ````\n" - uid: azure.communication.chat.aio.ChatThreadClient.send_read_receipt name: send_read_receipt summary: Posts a read receipt event to a chat thread, on behalf of a user. @@ -394,17 +238,6 @@ methods: - exceptions: - type: , - examples: - - "Sending read receipt of a chat message.\n\n\n\n````python\n\ - \n c with chat_client:\n # set `thread_id` to an existing thread id\n chat_thread_client\ - \ = chat_client.get_chat_thread_client(thread_id=thread_id)\n async with chat_thread_client:\n\ - \ # set `message_id` to an existing message id\n await chat_thread_client.send_read_receipt(message_id)\n\ - \n ````\n" - uid: azure.communication.chat.aio.ChatThreadClient.send_typing_notification name: send_typing_notification summary: Posts a typing event to a thread, on behalf of a user. @@ -423,16 +256,6 @@ methods: - exceptions: - type: , - examples: - - "Send typing notification.\n\n\n\n````python\n\ - \n c with chat_client:\n # set `thread_id` to an existing thread id\n chat_thread_client\ - \ = chat_client.get_chat_thread_client(thread_id=thread_id)\n async with chat_thread_client:\n\ - \ await chat_thread_client.send_typing_notification()\n\n ````\n" - uid: azure.communication.chat.aio.ChatThreadClient.update_message name: update_message summary: Updates a message. @@ -456,21 +279,6 @@ methods: - exceptions: - type: , - examples: - - "Updating an already sent message.\n\n\n\n````python\n\ - \n c with chat_client:\n # set `thread_id` to an existing thread id\n chat_thread_client\ - \ = chat_client.get_chat_thread_client(thread_id=thread_id)\n async with chat_thread_client:\n\ - \ # set `message_id` to an existing message id\n previous_content\ - \ = (await chat_thread_client.get_message(message_id)).content.message\n\n \ - \ content = \"updated message content\"\n await chat_thread_client.update_message(self._message_id,\ - \ content=content)\n\n current_content = (await chat_thread_client.get_message(message_id)).content.message\n\ - \n print(\"Chat Message Updated: Previous value: \", previous_content, \"\ - , Current value: \", current_content)\n\n ````\n" - uid: azure.communication.chat.aio.ChatThreadClient.update_topic name: update_topic summary: Updates a thread's properties. @@ -490,22 +298,6 @@ methods: - exceptions: - type: , - examples: - - "Updating chat thread.\n\n\n\n````python\n\ - \n t `thread_id` to an existing thread id\n c with chat_client:\n chat_thread_client\ - \ = chat_client.get_chat_thread_client(thread_id=thread_id)\n\n async with chat_thread_client:\n\ - \ chat_thread_properties = await chat_thread_client.get_properties()\n \ - \ previous_topic = chat_thread_properties.topic\n\n topic = \"updated\ - \ thread topic\"\n await chat_thread_client.update_topic(topic=topic)\n\n\ - \ chat_thread_properties = await chat_thread_client.get_properties()\n \ - \ updated_topic = chat_thread_properties.topic\n\n print(\"Chat Thread\ - \ Topic Update: Previous value: \", previous_topic, \", Current value: \", updated_topic)\n\ - \n ````\n" attributes: - uid: azure.communication.chat.aio.ChatThreadClient.thread_id name: thread_id diff --git a/docs-ref-autogen/azure-communication-identity/azure.communication.identity.CommunicationIdentityClient.yml b/docs-ref-autogen/azure-communication-identity/azure.communication.identity.CommunicationIdentityClient.yml index 3b66ba27a0df..870f5c14c087 100644 --- a/docs-ref-autogen/azure-communication-identity/azure.communication.identity.CommunicationIdentityClient.yml +++ b/docs-ref-autogen/azure-communication-identity/azure.communication.identity.CommunicationIdentityClient.yml @@ -27,117 +27,6 @@ constructor: in unsupported behavior.' types: - -examples: -- "\n\n\n\n````python\n\n : utf-8\n\n -------------------------------------------------------------------\n\ - \ ght (c) Microsoft Corporation. All rights reserved.\n ed under the MIT License.\ - \ See License.txt in the project root for\n e information.\n --------------------------------------------------------------------\n\ - \n\n entity_sample.py\n ION:\n e samples demonstrate creating a user, issuing\ - \ a token, revoking a token and deleting a user.\n\n\n on identity_samples.py\n\ - \ the environment variables with your own values before running the sample:\n\ - \ OMMUNICATION_SAMPLES_CONNECTION_STRING - the connection string in your Communication\ - \ Services resource\n ZURE_CLIENT_ID - the client ID of your active directory\ - \ application\n ZURE_CLIENT_SECRET - the secret of your active directory application\n\ - \ ZURE_TENANT_ID - the tenant ID of your active directory application\n OMMUNICATION_M365_APP_ID\ - \ - the application id of Microsoft 365\n OMMUNICATION_M365_AAD_AUTHORITY - the\ - \ Azure AD authority of Microsoft 365 \n OMMUNICATION_M365_AAD_TENANT - the tenant\ - \ ID of Microsoft 365 application\n OMMUNICATION_MSAL_USERNAME - the username\ - \ for authenticating via MSAL library\n OMMUNICATION_MSAL_PASSWORD - the password\ - \ for authenticating via MSAL library\n\n etime import timedelta\n s\n re.communication.identity._shared.utils\ - \ import parse_connection_str\n l import PublicClientApplication\n mmunicationIdentityClientSamples(object):\n\ - \n __init__(self):\n self.connection_string = os.getenv('COMMUNICATION_SAMPLES_CONNECTION_STRING')\n\ - \ self.client_id = os.getenv('AZURE_CLIENT_ID')\n self.client_secret = os.getenv('AZURE_CLIENT_SECRET')\n\ - \ self.tenant_id = os.getenv('AZURE_TENANT_ID')\n self.m365_client_id = os.getenv('COMMUNICATION_M365_APP_ID')\ - \ \n self.m365_aad_authority = os.getenv('COMMUNICATION_M365_AAD_AUTHORITY') \n\ - \ self.m365_aad_tenant = os.getenv('COMMUNICATION_M365_AAD_TENANT')\n self.msal_username\ - \ = os.getenv('COMMUNICATION_MSAL_USERNAME') \n self.msal_password = os.getenv('COMMUNICATION_MSAL_PASSWORD')\n\ - \n get_token(self):\n from azure.communication.identity import (\n CommunicationIdentityClient,\n\ - \ CommunicationTokenScope\n )\n\n if self.client_id is not None and self.client_secret\ - \ is not None and self.tenant_id is not None:\n from azure.identity import\ - \ DefaultAzureCredential\n endpoint, _ = parse_connection_str(self.connection_string)\n\ - \ identity_client = CommunicationIdentityClient(endpoint, DefaultAzureCredential())\n\ - \ else:\n identity_client = CommunicationIdentityClient.from_connection_string(self.connection_string)\n\ - \ user = identity_client.create_user()\n print(\"Getting token for: \" + user.properties.get('id'))\n\ - \ tokenresponse = identity_client.get_token(user, scopes=[CommunicationTokenScope.CHAT])\n\ - \ print(\"Token issued with value: \" + tokenresponse.token)\n\n get_token_with_custom_expiration(self):\n\ - \ from azure.communication.identity import (\n CommunicationIdentityClient,\n\ - \ CommunicationTokenScope\n )\n\n if self.client_id is not None and self.client_secret\ - \ is not None and self.tenant_id is not None:\n from azure.identity import\ - \ DefaultAzureCredential\n endpoint, _ = parse_connection_str(self.connection_string)\n\ - \ identity_client = CommunicationIdentityClient(endpoint, DefaultAzureCredential())\n\ - \ else:\n identity_client = CommunicationIdentityClient.from_connection_string(self.connection_string)\n\ - \ user = identity_client.create_user()\n print(\"Getting token for: \" + user.properties.get('id'))\n\ - \ token_expires_in = timedelta(hours=1)\n tokenresponse = identity_client.get_token(user,\ - \ scopes=[CommunicationTokenScope.CHAT], token_expires_in=token_expires_in)\n \ - \ print(\"Issued token with custom expiration\" + tokenresponse.token)\n\n revoke_tokens(self):\n\ - \ from azure.communication.identity import (\n CommunicationIdentityClient,\n\ - \ CommunicationTokenScope\n )\n\n if self.client_id is not None and self.client_secret\ - \ is not None and self.tenant_id is not None:\n from azure.identity import\ - \ DefaultAzureCredential\n endpoint, _ = parse_connection_str(self.connection_string)\n\ - \ identity_client = CommunicationIdentityClient(endpoint, DefaultAzureCredential())\n\ - \ else:\n identity_client = CommunicationIdentityClient.from_connection_string(self.connection_string)\n\ - \ user = identity_client.create_user()\n tokenresponse = identity_client.get_token(user,\ - \ scopes=[CommunicationTokenScope.CHAT])\n print(\"Revoking token: \" + tokenresponse.token)\n\ - \ identity_client.revoke_tokens(user)\n print(tokenresponse.token + \" revoked\ - \ successfully\")\n\n create_user(self):\n from azure.communication.identity\ - \ import CommunicationIdentityClient\n\n if self.client_id is not None and self.client_secret\ - \ is not None and self.tenant_id is not None:\n from azure.identity import\ - \ DefaultAzureCredential\n endpoint, _ = parse_connection_str(self.connection_string)\n\ - \ identity_client = CommunicationIdentityClient(endpoint, DefaultAzureCredential())\n\ - \ else:\n identity_client = CommunicationIdentityClient.from_connection_string(self.connection_string)\n\ - \ print(\"Creating new user\")\n user = identity_client.create_user()\n print(\"\ - User created with id:\" + user.properties.get('id'))\n\n create_user_and_token(self):\n\ - \ from azure.communication.identity import (\n CommunicationIdentityClient,\n\ - \ CommunicationTokenScope\n )\n if self.client_id is not None and self.client_secret\ - \ is not None and self.tenant_id is not None:\n from azure.identity import\ - \ DefaultAzureCredential\n endpoint, _ = parse_connection_str(self.connection_string)\n\ - \ identity_client = CommunicationIdentityClient(endpoint, DefaultAzureCredential())\n\ - \ else:\n identity_client = CommunicationIdentityClient.from_connection_string(self.connection_string)\n\ - \ print(\"Creating new user with token\")\n user, tokenresponse = identity_client.create_user_and_token(scopes=[CommunicationTokenScope.CHAT])\n\ - \ print(\"User created with id:\" + user.properties.get('id'))\n print(\"Token\ - \ issued with value: \" + tokenresponse.token)\n\n create_user_and_token_with_custom_expiration(self):\n\ - \ from azure.communication.identity import (\n CommunicationIdentityClient,\n\ - \ CommunicationTokenScope\n )\n if self.client_id is not None and self.client_secret\ - \ is not None and self.tenant_id is not None:\n from azure.identity import\ - \ DefaultAzureCredential\n endpoint, _ = parse_connection_str(self.connection_string)\n\ - \ identity_client = CommunicationIdentityClient(endpoint, DefaultAzureCredential())\n\ - \ else:\n identity_client = CommunicationIdentityClient.from_connection_string(self.connection_string)\n\ - \ print(\"Creating new user with token\")\n token_expires_in = timedelta(hours=1)\n\ - \ user, tokenresponse = identity_client.create_user_and_token(scopes=[CommunicationTokenScope.CHAT],\ - \ token_expires_in=token_expires_in)\n print(\"User created with id:\" + user.properties.get('id'))\n\ - \ print(\"Issued token with custom expiration: \" + tokenresponse.token)\n\n \ - \ delete_user(self):\n from azure.communication.identity import CommunicationIdentityClient\n\ - \n if self.client_id is not None and self.client_secret is not None and self.tenant_id\ - \ is not None:\n from azure.identity import DefaultAzureCredential\n \ - \ endpoint, _ = parse_connection_str(self.connection_string)\n identity_client\ - \ = CommunicationIdentityClient(endpoint, DefaultAzureCredential())\n else:\n\ - \ identity_client = CommunicationIdentityClient.from_connection_string(self.connection_string)\n\ - \ user = identity_client.create_user()\n print(\"Deleting user: \" + user.properties.get('id'))\n\ - \ identity_client.delete_user(user)\n print(user.properties.get('id') + \" deleted\"\ - )\n\n get_token_for_teams_user(self):\n if (os.getenv(\"SKIP_INT_IDENTITY_EXCHANGE_TOKEN_TEST\"\ - ) == \"true\"):\n print(\"Skipping the Get Access Token for Teams User sample\"\ - )\n return\n from azure.communication.identity import CommunicationIdentityClient\n\ - \n if self.client_id is not None and self.client_secret is not None and self.tenant_id\ - \ is not None:\n from azure.identity import DefaultAzureCredential\n \ - \ endpoint, _ = parse_connection_str(self.connection_string)\n identity_client\ - \ = CommunicationIdentityClient(endpoint, DefaultAzureCredential())\n else:\n\ - \ identity_client = CommunicationIdentityClient.from_connection_string(self.connection_string)\n\ - \n msal_app = PublicClientApplication(client_id=self.m365_client_id, authority=\"\ - {}/{}\".format(self.m365_aad_authority, self.m365_aad_tenant))\n scopes = [ \n\ - \ \"https://auth.msft.communication.azure.com/Teams.ManageCalls\",\n \ - \ \"https://auth.msft.communication.azure.com/Teams.ManageChats\"\n ]\n result\ - \ = msal_app.acquire_token_by_username_password(\n username=self.msal_username,\n\ - \ password=self.msal_password,\n scopes=scopes)\n aad_token = result[\"\ - access_token\"]\n teams_user_oid = result[\"id_token_claims\"][\"oid\"] \n print(\"\ - AAD access token of a Teams User: \" + aad_token)\n\n tokenresponse = identity_client.get_token_for_teams_user(aad_token,\ - \ self.m365_client_id, teams_user_oid)\n print(\"Token issued with value: \" +\ - \ tokenresponse.token)\n\n\n e__ == '__main__':\n le = CommunicationIdentityClientSamples()\n\ - \ le.create_user()\n le.create_user_and_token()\n le.get_token()\n le.revoke_tokens()\n\ - \ le.delete_user() \n le.get_token_for_teams_user()\n\n ````\n" methods: - uid: azure.communication.identity.CommunicationIdentityClient.create_user name: create_user diff --git a/docs-ref-autogen/azure-communication-networktraversal/azure.communication.networktraversal.aio.CommunicationRelayClient.yml b/docs-ref-autogen/azure-communication-networktraversal/azure.communication.networktraversal.aio.CommunicationRelayClient.yml index e97701e4a454..1e49c44e820f 100644 --- a/docs-ref-autogen/azure-communication-networktraversal/azure.communication.networktraversal.aio.CommunicationRelayClient.yml +++ b/docs-ref-autogen/azure-communication-networktraversal/azure.communication.networktraversal.aio.CommunicationRelayClient.yml @@ -20,43 +20,6 @@ constructor: isRequired: true types: - -examples: -- "\n\n\n\n````python\n\n : utf-8\n\n -------------------------------------------------------------------\n\ - \ ght (c) Microsoft Corporation. All rights reserved.\n ed under the MIT License.\ - \ See License.txt in the project root for\n e information.\n --------------------------------------------------------------------\n\ - \n\n twork_traversal_samples_async.py\n ION:\n e samples demonstrate creating\ - \ a user, issuing a token, revoking a token and deleting a user.\n\n\n on network_traversal_samples.py\n\ - \ the environment variables with your own values before running the sample:\n\ - \ OMMUNICATION_SAMPLES_CONNECTION_STRING - the connection string in your ACS resource\n\ - \ ZURE_CLIENT_ID - the client ID of your active directory application\n ZURE_CLIENT_SECRET\ - \ - the secret of your active directory application\n ZURE_TENANT_ID - the tenant\ - \ ID of your active directory application\n\n s\n syncio\n re.communication.networktraversal._shared.utils\ - \ import parse_connection_str\n\n mmunicationRelayClientSamples(object):\n\n \ - \ __init__(self):\n self.connection_string = os.getenv('COMMUNICATION_SAMPLES_CONNECTION_STRING')\n\ - \ self.client_id = os.getenv('AZURE_CLIENT_ID')\n self.client_secret = os.getenv('AZURE_CLIENT_SECRET')\n\ - \ self.tenant_id = os.getenv('AZURE_TENANT_ID')\n\n c def get_relay_config(self):\n\ - \ from azure.communication.networktraversal.aio import CommunicationRelayClient\n\ - \ from azure.communication.identity.aio import CommunicationIdentityClient\n\n\ - \ if self.client_id is not None and self.client_secret is not None and self.tenant_id\ - \ is not None:\n from azure.identity.aio import DefaultAzureCredential\n \ - \ endpoint, _ = parse_connection_str(self.connection_string)\n identity_client\ - \ = CommunicationIdentityClient(endpoint, DefaultAzureCredential())\n relay_client\ - \ = CommunicationRelayClient(endpoint, DefaultAzureCredential())\n else:\n \ - \ identity_client = CommunicationIdentityClient.from_connection_string(self.connection_string)\n\ - \ relay_client = CommunicationRelayClient.from_connection_string(self.connection_string)\n\ - \n async with identity_client:\n print(\"Creating new user\")\n user\ - \ = await identity_client.create_user()\n print(\"User created with id:\"\ - \ + user.properties.get('id'))\n\n async with relay_client:\n print(\"Getting\ - \ relay configuration\")\n relay_configuration = await relay_client.get_relay_configuration(user=user)\n\ - \n for iceServer in relay_configuration.ice_servers:\n print(\"Icer server:\"\ - )\n print(iceServer)\n\n f main():\n le = CommunicationRelayClientSamples()\n\ - \ t sample.get_relay_config()\n\n e__ == '__main__':\n = asyncio.get_event_loop()\n\ - \ .run_until_complete(main())\n\n ````\n" methods: - uid: azure.communication.networktraversal.aio.CommunicationRelayClient.close name: close diff --git a/docs-ref-autogen/azure-containerregistry/azure.containerregistry.ContainerRegistryClient.yml b/docs-ref-autogen/azure-containerregistry/azure.containerregistry.ContainerRegistryClient.yml index c8df0578056a..6a242ef2f3de 100644 --- a/docs-ref-autogen/azure-containerregistry/azure.containerregistry.ContainerRegistryClient.yml +++ b/docs-ref-autogen/azure-containerregistry/azure.containerregistry.ContainerRegistryClient.yml @@ -41,14 +41,6 @@ constructor: The default value is "[https://containerregistry.azure.net](https://containerregistry.azure.net)".' types: - -examples: -- "Instantiate an instance of *ContainerRegistryClient*\n\n\n\n````python\n\n with ContainerRegistryClient(self.endpoint,\ - \ self.credential) as client:\n\n ````\n" methods: - uid: azure.containerregistry.ContainerRegistryClient.delete_blob name: delete_blob @@ -121,15 +113,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Delete a repository from the *ContainerRegistryClient*\n\n\n\ - \n````python\n\n client.delete_repository(repository_name)\n\n \ - \ ````\n" - uid: azure.containerregistry.ContainerRegistryClient.delete_tag name: delete_tag summary: "Delete a tag from a repository. If the tag cannot be found or a response\ @@ -333,17 +316,6 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "List repositories in a container registry account\n\n\n\ - \n````python\n\n with ContainerRegistryClient(self.endpoint, self.credential)\ - \ as client:\n # Iterate through all the repositories\n for repository_name\ - \ in client.list_repository_names():\n print(repository_name)\n\n \ - \ ````\n" - uid: azure.containerregistry.ContainerRegistryClient.list_tag_properties name: list_tag_properties summary: "List the tags for a repository\n\nExample\n\n\n\n\n\n````python\n\n from azure.core import\ - \ AsyncPipelineClient\n from azure.core.pipeline.policies import AsyncRedirectPolicy,\ - \ UserAgentPolicy\n from azure.core.pipeline.transport import HttpRequest\n\n\ - \ # example policies\n request = HttpRequest(\"GET\", url)\n policies: Iterable[Union[AsyncHTTPPolicy,\ - \ SansIOHTTPPolicy]] = [\n UserAgentPolicy(\"myuseragent\"),\n AsyncRedirectPolicy(),\n\ - \ ]\n\n async with AsyncPipelineClient(base_url=url, policies=policies) as client:\n\ - \ response = await client._pipeline.run(request)\n\n ````\n" methods: - uid: azure.core.AsyncPipelineClient.close name: close diff --git a/docs-ref-autogen/azure-core/azure.core.PipelineClient.yml b/docs-ref-autogen/azure-core/azure.core.PipelineClient.yml index 91dc864aa9f0..1af3df65dee1 100644 --- a/docs-ref-autogen/azure-core/azure.core.PipelineClient.yml +++ b/docs-ref-autogen/azure-core/azure.core.PipelineClient.yml @@ -48,20 +48,6 @@ constructor: description: If omitted, RequestsTransport is used for synchronous transport. types: - -examples: -- "Builds the pipeline client.\n\ - \n\n\n````python\n\n from azure.core import\ - \ PipelineClient\n from azure.core.rest import HttpRequest\n from azure.core.pipeline.policies\ - \ import RedirectPolicy, UserAgentPolicy\n\n # example configuration with some\ - \ policies\n policies: Iterable[Union[HTTPPolicy, SansIOHTTPPolicy]] = [UserAgentPolicy(\"\ - myuseragent\"), RedirectPolicy()]\n\n client: PipelineClient[HttpRequest, HttpResponse]\ - \ = PipelineClient(base_url=url, policies=policies)\n request = HttpRequest(\"\ - GET\", \"https://bing.com\")\n\n pipeline_response = client._pipeline.run(request)\n\ - \n ````\n" methods: - uid: azure.core.PipelineClient.close name: close diff --git a/docs-ref-autogen/azure-core/azure.core.pipeline.AsyncPipeline.yml b/docs-ref-autogen/azure-core/azure.core.pipeline.AsyncPipeline.yml index 676ad7d2a770..2300e07fc237 100644 --- a/docs-ref-autogen/azure-core/azure.core.pipeline.AsyncPipeline.yml +++ b/docs-ref-autogen/azure-core/azure.core.pipeline.AsyncPipeline.yml @@ -24,21 +24,6 @@ constructor: defaultValue: None types: - -examples: -- "Builds the async pipeline for asynchronous transport.\n\n\n\n````python\n\n from azure.core.pipeline\ - \ import AsyncPipeline\n from azure.core.pipeline.policies import AsyncRedirectPolicy,\ - \ UserAgentPolicy\n from azure.core.pipeline.transport import AioHttpTransport,\ - \ HttpRequest\n\n # example: create request and policies\n request = HttpRequest(\"\ - GET\", \"https://bing.com\")\n policies: Iterable[Union[AsyncHTTPPolicy, SansIOHTTPPolicy]]\ - \ = [\n UserAgentPolicy(\"myuseragent\"),\n AsyncRedirectPolicy(),\n\ - \ ]\n\n # run the pipeline\n async with AsyncPipeline(transport=AioHttpTransport(),\ - \ policies=policies) as pipeline:\n response = await pipeline.run(request)\n\ - \n ````\n" methods: - uid: azure.core.pipeline.AsyncPipeline.run name: run diff --git a/docs-ref-autogen/azure-core/azure.core.pipeline.Pipeline.yml b/docs-ref-autogen/azure-core/azure.core.pipeline.Pipeline.yml index c71933a38b8e..312cd4ef31a0 100644 --- a/docs-ref-autogen/azure-core/azure.core.pipeline.Pipeline.yml +++ b/docs-ref-autogen/azure-core/azure.core.pipeline.Pipeline.yml @@ -24,20 +24,6 @@ constructor: defaultValue: None types: - -examples: -- "Builds the pipeline for synchronous transport.\n\n\n\n````python\n\n from azure.core.pipeline\ - \ import Pipeline\n from azure.core.pipeline.policies import RedirectPolicy, UserAgentPolicy\n\ - \ from azure.core.rest import HttpRequest\n from azure.core.pipeline.transport\ - \ import RequestsTransport\n\n # example: create request and policies\n request\ - \ = HttpRequest(\"GET\", \"https://bing.com\")\n policies: Iterable[Union[HTTPPolicy,\ - \ SansIOHTTPPolicy]] = [UserAgentPolicy(\"myuseragent\"), RedirectPolicy()]\n\n\ - \ # run the pipeline\n with Pipeline(transport=RequestsTransport(), policies=policies)\ - \ as pipeline:\n response = pipeline.run(request)\n\n ````\n" methods: - uid: azure.core.pipeline.Pipeline.run name: run diff --git a/docs-ref-autogen/azure-core/azure.core.pipeline.policies.AsyncRedirectPolicy.yml b/docs-ref-autogen/azure-core/azure.core.pipeline.policies.AsyncRedirectPolicy.yml index 6f8f90f6aa54..33a7c81fafe2 100644 --- a/docs-ref-autogen/azure-core/azure.core.pipeline.policies.AsyncRedirectPolicy.yml +++ b/docs-ref-autogen/azure-core/azure.core.pipeline.policies.AsyncRedirectPolicy.yml @@ -21,21 +21,6 @@ constructor: description: The maximum allowed redirects. Defaults to 30. types: - -examples: -- "Configuring an async redirect policy.\n\n\n\n````python\n\n from azure.core.pipeline.policies\ - \ import AsyncRedirectPolicy\n\n redirect_policy = AsyncRedirectPolicy()\n\n \ - \ # Client allows redirects. Defaults to True.\n redirect_policy.allow = True\n\ - \n # The maximum allowed redirects. The default value is 30\n redirect_policy.max_redirects\ - \ = 10\n\n # Alternatively you can disable redirects entirely\n redirect_policy\ - \ = AsyncRedirectPolicy.no_redirects()\n\n # It can also be overridden per operation.\n\ - \ async with AsyncPipelineClient(base_url=url, policies=[redirect_policy]) as\ - \ client:\n response = await client._pipeline.run(request, permit_redirects=True,\ - \ redirect_max=5)\n\n\n ````\n" methods: - uid: azure.core.pipeline.policies.AsyncRedirectPolicy.send name: send diff --git a/docs-ref-autogen/azure-core/azure.core.pipeline.policies.AsyncRetryPolicy.yml b/docs-ref-autogen/azure-core/azure.core.pipeline.policies.AsyncRetryPolicy.yml index 0e1919fa3a3b..0637c70a8516 100644 --- a/docs-ref-autogen/azure-core/azure.core.pipeline.policies.AsyncRetryPolicy.yml +++ b/docs-ref-autogen/azure-core/azure.core.pipeline.policies.AsyncRetryPolicy.yml @@ -58,37 +58,6 @@ constructor: description: The maximum back off time. Default value is 120 seconds (2 minutes). types: - -examples: -- "Configuring an async retry policy.\n\n\n\n````python\n\n from azure.core.pipeline.policies\ - \ import AsyncRetryPolicy\n\n retry_policy = AsyncRetryPolicy()\n\n # Total\ - \ number of retries to allow. Takes precedence over other counts.\n # Default\ - \ value is 10.\n retry_policy.total_retries = 5\n\n # How many connection-related\ - \ errors to retry on.\n # These are errors raised before the request is sent to\ - \ the remote server,\n # which we assume has not triggered the server to process\ - \ the request. Default value is 3\n retry_policy.connect_retries = 2\n\n # How\ - \ many times to retry on read errors.\n # These errors are raised after the request\ - \ was sent to the server, so the\n # request may have side-effects. Default value\ - \ is 3.\n retry_policy.read_retries = 4\n\n # How many times to retry on bad\ - \ status codes. Default value is 3.\n retry_policy.status_retries = 3\n\n #\ - \ A backoff factor to apply between attempts after the second try\n # (most errors\ - \ are resolved immediately by a second try without a delay).\n # Retry policy\ - \ will sleep for:\n # {backoff factor} * (2 ** ({number of total retries} -\ - \ 1))\n # seconds. If the backoff_factor is 0.1, then the retry will sleep\n \ - \ # for [0.0s, 0.2s, 0.4s, ...] between retries.\n # The default value is 0.8.\n\ - \ retry_policy.backoff_factor = 0.5\n\n # The maximum back off time. Default\ - \ value is 120 seconds (2 minutes).\n retry_policy.backoff_max = 120\n\n # Alternatively\ - \ you can disable redirects entirely\n retry_policy = AsyncRetryPolicy.no_retries()\n\ - \n # All of these settings can also be configured per operation.\n policies.append(retry_policy)\n\ - \ async with AsyncPipelineClient(base_url=url, policies=policies) as client:\n\ - \ response = await client._pipeline.run(\n request,\n \ - \ retry_total=10,\n retry_connect=1,\n retry_read=1,\n \ - \ retry_status=5,\n retry_backoff_factor=0.5,\n retry_backoff_max=60,\n\ - \ retry_on_methods=[\"GET\"],\n )\n\n ````\n" methods: - uid: azure.core.pipeline.policies.AsyncRetryPolicy.send name: send diff --git a/docs-ref-autogen/azure-core/azure.core.pipeline.policies.HeadersPolicy.yml b/docs-ref-autogen/azure-core/azure.core.pipeline.policies.HeadersPolicy.yml index 1a6628a04506..651854c98b3b 100644 --- a/docs-ref-autogen/azure-core/azure.core.pipeline.policies.HeadersPolicy.yml +++ b/docs-ref-autogen/azure-core/azure.core.pipeline.policies.HeadersPolicy.yml @@ -21,20 +21,6 @@ constructor: defaultValue: None types: - -examples: -- "Configuring a headers policy.\n\n\n\n````python\n\n from azure.core.pipeline.policies\ - \ import HeadersPolicy\n\n headers_policy = HeadersPolicy()\n headers_policy.add_header(\"\ - CustomValue\", \"Foo\")\n\n # Or headers can be added per operation. These headers\ - \ will supplement existing headers\n # or those defined in the config headers\ - \ policy. They will also overwrite existing\n # identical headers.\n policies.append(headers_policy)\n\ - \ client: PipelineClient[HttpRequest, HttpResponse] = PipelineClient(base_url=url,\ - \ policies=policies)\n request = HttpRequest(\"GET\", url)\n pipeline_response\ - \ = client._pipeline.run(request, headers={\"CustomValue\": \"Bar\"})\n\n ````\n" methods: - uid: azure.core.pipeline.policies.HeadersPolicy.add_header name: add_header diff --git a/docs-ref-autogen/azure-core/azure.core.pipeline.policies.NetworkTraceLoggingPolicy.yml b/docs-ref-autogen/azure-core/azure.core.pipeline.policies.NetworkTraceLoggingPolicy.yml index b57f4d2cec23..c93e890f187d 100644 --- a/docs-ref-autogen/azure-core/azure.core.pipeline.policies.NetworkTraceLoggingPolicy.yml +++ b/docs-ref-autogen/azure-core/azure.core.pipeline.policies.NetworkTraceLoggingPolicy.yml @@ -18,24 +18,6 @@ constructor: defaultValue: 'False' types: - -examples: -- "Configuring a network trace logging policy.\n\n\n\n````python\n\n from azure.core.pipeline.policies\ - \ import NetworkTraceLoggingPolicy\n import sys\n import logging\n\n # Create\ - \ a logger for the 'azure' SDK\n logger = logging.getLogger(\"azure\")\n logger.setLevel(logging.DEBUG)\n\ - \n # Configure a console output\n handler = logging.StreamHandler(stream=sys.stdout)\n\ - \ logger.addHandler(handler)\n\n # Configure a file output\n file_handler\ - \ = logging.FileHandler(filename)\n logger.addHandler(file_handler)\n\n # Enable\ - \ network trace logging. This will be logged at DEBUG level.\n # By default, logging\ - \ is disabled.\n logging_policy = NetworkTraceLoggingPolicy()\n logging_policy.enable_http_logger\ - \ = True\n\n # The logger can also be enabled per operation.\n policies.append(logging_policy)\n\ - \ client: PipelineClient[HttpRequest, HttpResponse] = PipelineClient(base_url=url,\ - \ policies=policies)\n request = HttpRequest(\"GET\", url)\n pipeline_response\ - \ = client._pipeline.run(request, logging_enable=True)\n\n\n ````\n" methods: - uid: azure.core.pipeline.policies.NetworkTraceLoggingPolicy.on_request name: on_request diff --git a/docs-ref-autogen/azure-core/azure.core.pipeline.policies.ProxyPolicy.yml b/docs-ref-autogen/azure-core/azure.core.pipeline.policies.ProxyPolicy.yml index fa0785bffe89..cf3642a41e62 100644 --- a/docs-ref-autogen/azure-core/azure.core.pipeline.policies.ProxyPolicy.yml +++ b/docs-ref-autogen/azure-core/azure.core.pipeline.policies.ProxyPolicy.yml @@ -21,18 +21,6 @@ constructor: defaultValue: None types: - -examples: -- "Configuring a proxy policy.\n\n\n\n````python\n\n from azure.core.pipeline.policies\ - \ import ProxyPolicy\n\n proxy_policy = ProxyPolicy()\n\n # Example\n proxy_policy.proxies\ - \ = {\"http\": \"http://10.10.1.10:3148\"}\n\n # Use basic auth\n proxy_policy.proxies\ - \ = {\"https\": \"http://user:password@10.10.1.10:1180/\"}\n\n # You can also\ - \ configure proxies by setting the environment variables\n # HTTP_PROXY and HTTPS_PROXY.\n\ - \n ````\n" methods: - uid: azure.core.pipeline.policies.ProxyPolicy.on_request name: on_request diff --git a/docs-ref-autogen/azure-core/azure.core.pipeline.policies.RedirectPolicy.yml b/docs-ref-autogen/azure-core/azure.core.pipeline.policies.RedirectPolicy.yml index 1f958ccc0d3b..8c365e3face7 100644 --- a/docs-ref-autogen/azure-core/azure.core.pipeline.policies.RedirectPolicy.yml +++ b/docs-ref-autogen/azure-core/azure.core.pipeline.policies.RedirectPolicy.yml @@ -21,22 +21,6 @@ constructor: description: The maximum allowed redirects. Defaults to 30. types: - -examples: -- "Configuring a redirect policy.\n\n\n\n````python\n\n from azure.core.rest\ - \ import HttpRequest\n from azure.core.pipeline.policies import RedirectPolicy\n\ - \n redirect_policy = RedirectPolicy()\n\n # Client allows redirects. Defaults\ - \ to True.\n redirect_policy.allow = True\n\n # The maximum allowed redirects.\ - \ The default value is 30\n redirect_policy.max_redirects = 10\n\n # Alternatively\ - \ you can disable redirects entirely\n redirect_policy = RedirectPolicy.no_redirects()\n\ - \n # It can also be overridden per operation.\n client: PipelineClient[HttpRequest,\ - \ HttpResponse] = PipelineClient(base_url=url, policies=[redirect_policy])\n request\ - \ = HttpRequest(\"GET\", url)\n pipeline_response = client._pipeline.run(request,\ - \ permit_redirects=True, redirect_max=5)\n\n ````\n" methods: - uid: azure.core.pipeline.policies.RedirectPolicy.send name: send diff --git a/docs-ref-autogen/azure-core/azure.core.pipeline.policies.RequestIdPolicy.yml b/docs-ref-autogen/azure-core/azure.core.pipeline.policies.RequestIdPolicy.yml index b25e7a050e9c..f1e6070baf0e 100644 --- a/docs-ref-autogen/azure-core/azure.core.pipeline.policies.RequestIdPolicy.yml +++ b/docs-ref-autogen/azure-core/azure.core.pipeline.policies.RequestIdPolicy.yml @@ -25,20 +25,6 @@ constructor: description: Auto generates a unique request ID per call if true which is by default. types: - -examples: -- "Configuring a request id policy.\n\n\n\n````python\n\n from azure.core.pipeline.policies\ - \ import HeadersPolicy\n\n request_id_policy = RequestIdPolicy()\n request_id_policy.set_request_id(\"\ - azconfig-test\")\n\n # Or headers can be added per operation. These headers will\ - \ supplement existing headers\n # or those defined in the config headers policy.\ - \ They will also overwrite existing\n # identical headers.\n policies.append(request_id_policy)\n\ - \ client: PipelineClient[HttpRequest, HttpResponse] = PipelineClient(base_url=url,\ - \ policies=policies)\n request = HttpRequest(\"GET\", url)\n pipeline_response\ - \ = client._pipeline.run(request, request_id=\"azconfig-test\")\n\n ````\n" methods: - uid: azure.core.pipeline.policies.RequestIdPolicy.on_request name: on_request diff --git a/docs-ref-autogen/azure-core/azure.core.pipeline.policies.RetryPolicy.yml b/docs-ref-autogen/azure-core/azure.core.pipeline.policies.RetryPolicy.yml index bdc98f98bf4a..302650eebbdb 100644 --- a/docs-ref-autogen/azure-core/azure.core.pipeline.policies.RetryPolicy.yml +++ b/docs-ref-autogen/azure-core/azure.core.pipeline.policies.RetryPolicy.yml @@ -69,37 +69,6 @@ constructor: (7 days). types: - -examples: -- "Configuring a retry policy.\n\ - \n\n\n````python\n\n from azure.core.pipeline.policies\ - \ import RetryPolicy\n\n retry_policy = RetryPolicy()\n\n # Total number of\ - \ retries to allow. Takes precedence over other counts.\n # Default value is 10.\n\ - \ retry_policy.total_retries = 5\n\n # How many connection-related errors to\ - \ retry on.\n # These are errors raised before the request is sent to the remote\ - \ server,\n # which we assume has not triggered the server to process the request.\ - \ Default value is 3\n retry_policy.connect_retries = 2\n\n # How many times\ - \ to retry on read errors.\n # These errors are raised after the request was sent\ - \ to the server, so the\n # request may have side-effects. Default value is 3.\n\ - \ retry_policy.read_retries = 4\n\n # How many times to retry on bad status\ - \ codes. Default value is 3.\n retry_policy.status_retries = 3\n\n # A backoff\ - \ factor to apply between attempts after the second try\n # (most errors are resolved\ - \ immediately by a second try without a delay).\n # Retry policy will sleep for:\n\ - \ # {backoff factor} * (2 ** ({number of total retries} - 1))\n # seconds.\ - \ If the backoff_factor is 0.1, then the retry will sleep\n # for [0.0s, 0.2s,\ - \ 0.4s, ...] between retries.\n # The default value is 0.8.\n retry_policy.backoff_factor\ - \ = 0.5\n\n # The maximum back off time. Default value is 120 seconds (2 minutes).\n\ - \ retry_policy.backoff_max = 120\n\n # Alternatively you can disable redirects\ - \ entirely\n retry_policy = RetryPolicy.no_retries()\n\n # All of these settings\ - \ can also be configured per operation.\n policies.append(retry_policy)\n client:\ - \ PipelineClient[HttpRequest, HttpResponse] = PipelineClient(base_url=url, policies=policies)\n\ - \ request = HttpRequest(\"GET\", url)\n pipeline_response = client._pipeline.run(\n\ - \ request,\n retry_total=10,\n retry_connect=1,\n retry_read=1,\n\ - \ retry_status=5,\n retry_backoff_factor=0.5,\n retry_backoff_max=120,\n\ - \ retry_on_methods=[\"GET\"],\n )\n\n ````\n" methods: - uid: azure.core.pipeline.policies.RetryPolicy.send name: send diff --git a/docs-ref-autogen/azure-core/azure.core.pipeline.policies.UserAgentPolicy.yml b/docs-ref-autogen/azure-core/azure.core.pipeline.policies.UserAgentPolicy.yml index 1b1ee8e90493..913f34510a07 100644 --- a/docs-ref-autogen/azure-core/azure.core.pipeline.policies.UserAgentPolicy.yml +++ b/docs-ref-autogen/azure-core/azure.core.pipeline.policies.UserAgentPolicy.yml @@ -32,22 +32,6 @@ constructor: azsdk-python-[sdk_moniker] Python/[python_version] ([platform_version])' types: - -examples: -- "Configuring a user agent policy.\n\n\n\n````python\n\n from azure.core.pipeline.policies\ - \ import UserAgentPolicy\n\n user_agent_policy = UserAgentPolicy()\n\n # The\ - \ user-agent policy allows you to append a custom value to the header.\n user_agent_policy.add_user_agent(\"\ - CustomValue\")\n\n # You can also pass in a custom value per operation to append\ - \ to the end of the user-agent.\n # This can be used together with the policy\ - \ configuration to append multiple values.\n policies = [\n redirect_policy,\n\ - \ user_agent_policy,\n ]\n client: PipelineClient[HttpRequest, HttpResponse]\ - \ = PipelineClient(base_url=url, policies=policies)\n request = HttpRequest(\"\ - GET\", url)\n pipeline_response = client._pipeline.run(request, user_agent=\"\ - AnotherValue\")\n\n ````\n" methods: - uid: azure.core.pipeline.policies.UserAgentPolicy.add_user_agent name: add_user_agent diff --git a/docs-ref-autogen/azure-core/azure.core.pipeline.transport.AioHttpTransport.yml b/docs-ref-autogen/azure-core/azure.core.pipeline.transport.AioHttpTransport.yml index 53c433365822..f1abadfb2268 100644 --- a/docs-ref-autogen/azure-core/azure.core.pipeline.transport.AioHttpTransport.yml +++ b/docs-ref-autogen/azure-core/azure.core.pipeline.transport.AioHttpTransport.yml @@ -25,15 +25,6 @@ constructor: description: Uses proxy settings from environment. Defaults to True. types: - -examples: -- "Asynchronous transport with aiohttp.\n\n\n\n````python\n\n from azure.core.pipeline.transport\ - \ import AioHttpTransport\n\n async with AsyncPipeline(AioHttpTransport(), policies=policies)\ - \ as pipeline:\n response = await pipeline.run(request)\n\n ````\n" methods: - uid: azure.core.pipeline.transport.AioHttpTransport.close name: close diff --git a/docs-ref-autogen/azure-core/azure.core.pipeline.transport.AsyncioRequestsTransport.yml b/docs-ref-autogen/azure-core/azure.core.pipeline.transport.AsyncioRequestsTransport.yml index 80fac4e7c893..c2e8e72c6722 100644 --- a/docs-ref-autogen/azure-core/azure.core.pipeline.transport.AsyncioRequestsTransport.yml +++ b/docs-ref-autogen/azure-core/azure.core.pipeline.transport.AsyncioRequestsTransport.yml @@ -11,16 +11,6 @@ summary: 'Identical implementation as the synchronous RequestsTransport wrapped asynchronous methods. Uses the built-in asyncio event loop.' constructor: syntax: AsyncioRequestsTransport(**kwargs) -examples: -- "Asynchronous transport with asyncio.\n\n\n\n````python\n\n from azure.core.pipeline.transport\ - \ import AsyncioRequestsTransport\n\n async with AsyncPipeline(AsyncioRequestsTransport(),\ - \ policies=policies) as pipeline:\n response = await pipeline.run(request)\n\ - \n ````\n" methods: - uid: azure.core.pipeline.transport.AsyncioRequestsTransport.send name: send diff --git a/docs-ref-autogen/azure-core/azure.core.pipeline.transport.RequestsTransport.yml b/docs-ref-autogen/azure-core/azure.core.pipeline.transport.RequestsTransport.yml index 7bc728d14492..d2bc9cf99920 100644 --- a/docs-ref-autogen/azure-core/azure.core.pipeline.transport.RequestsTransport.yml +++ b/docs-ref-autogen/azure-core/azure.core.pipeline.transport.RequestsTransport.yml @@ -36,15 +36,6 @@ constructor: description: Uses proxy settings from environment. Defaults to True. types: - -examples: -- "Synchronous transport with Requests.\n\n\n\n````python\n\n from azure.core.pipeline.transport\ - \ import RequestsTransport\n\n with Pipeline(transport=RequestsTransport(), policies=policies)\ - \ as pipeline:\n response = pipeline.run(request)\n\n ````\n" methods: - uid: azure.core.pipeline.transport.RequestsTransport.close name: close diff --git a/docs-ref-autogen/azure-cosmos/azure.cosmos.ContainerProxy.yml b/docs-ref-autogen/azure-cosmos/azure.cosmos.ContainerProxy.yml index c761938a81f5..714dd27679cc 100644 --- a/docs-ref-autogen/azure-cosmos/azure.cosmos.ContainerProxy.yml +++ b/docs-ref-autogen/azure-cosmos/azure.cosmos.ContainerProxy.yml @@ -344,26 +344,6 @@ methods: description: An Iterable of items (dicts). types: - [[, ]] - examples: - - "Get all products that have not been discontinued:\n\n\n\n````python\n\n import json\n\ - \n for item in container.query_items(\n query='SELECT * FROM products\ - \ p WHERE p.productModel <> \"DISCONTINUED\"',\n enable_cross_partition_query=True,\n\ - \ ):\n print(json.dumps(item, indent=True))\n\n ````\n\nParameterized\ - \ query to get all products that have been discontinued:\n\n\n\n````python\n\n discontinued_items\ - \ = container.query_items(\n query='SELECT * FROM products p WHERE p.productModel\ - \ = @model AND p.productName=\"Widget\"',\n parameters=[dict(name=\"@model\"\ - , value=\"DISCONTINUED\")],\n )\n for item in discontinued_items:\n \ - \ print(json.dumps(item, indent=True))\n\n ````\n" - uid: azure.cosmos.ContainerProxy.query_items_change_feed name: query_items_change_feed summary: Get a sorted list of items that were changed, in the order in which they @@ -517,15 +497,6 @@ methods: exceptions: - type: azure.cosmos.exceptions.CosmosHttpResponseError description: The given item couldn't be retrieved. - examples: - - "Get an item from the database and update one of its properties:\n\n\n\n````python\n\n item = container.read_item(\"\ - item2\", partition_key=\"Widget\")\n item[\"productModel\"] = \"DISCONTINUED\"\ - \n updated_item = container.upsert_item(item)\n\n ````\n" - uid: azure.cosmos.ContainerProxy.read_offer name: read_offer summary: "Get the ThroughputProperties object for this container.\nIf no ThroughputProperties\ diff --git a/docs-ref-autogen/azure-cosmos/azure.cosmos.CosmosClient.yml b/docs-ref-autogen/azure-cosmos/azure.cosmos.CosmosClient.yml index aea5deeaad0e..1d51a24994da 100644 --- a/docs-ref-autogen/azure-cosmos/azure.cosmos.CosmosClient.yml +++ b/docs-ref-autogen/azure-cosmos/azure.cosmos.CosmosClient.yml @@ -119,16 +119,6 @@ constructor: at INFO level.' types: - -examples: -- "Create a new instance of the Cosmos DB client:\n\n\n\n````python\n\n from azure.cosmos import exceptions,\ - \ CosmosClient, PartitionKey\n\n import os\n\n url = os.environ[\"ACCOUNT_URI\"\ - ]\n key = os.environ[\"ACCOUNT_KEY\"]\n client = CosmosClient(url, key)\n\n\ - \ ````\n" methods: - uid: azure.cosmos.CosmosClient.create_database name: create_database @@ -174,16 +164,6 @@ methods: exceptions: - type: azure.cosmos.exceptions.CosmosResourceExistsError description: Database with the given ID already exists. - examples: - - "Create a database in the Cosmos DB account:\n\n\n\n````python\n\n database_name\ - \ = \"testDatabase\"\n try:\n database = client.create_database(id=database_name)\n\ - \ except exceptions.CosmosResourceExistsError:\n database = client.get_database_client(database=database_name)\n\ - \n ````\n" - uid: azure.cosmos.CosmosClient.create_database_if_not_exists name: create_database_if_not_exists summary: "Create the database if it does not exist already.\n\nIf the database already\ diff --git a/docs-ref-autogen/azure-cosmos/azure.cosmos.DatabaseProxy.yml b/docs-ref-autogen/azure-cosmos/azure.cosmos.DatabaseProxy.yml index c74a1c8bd29c..b7dfccb569be 100644 --- a/docs-ref-autogen/azure-cosmos/azure.cosmos.DatabaseProxy.yml +++ b/docs-ref-autogen/azure-cosmos/azure.cosmos.DatabaseProxy.yml @@ -117,28 +117,6 @@ methods: exceptions: - type: azure.cosmos.exceptions.CosmosHttpResponseError description: The container creation failed. - examples: - - "Create a container with default settings:\n\n\n\n````python\n\n container_name\ - \ = \"products\"\n try:\n container = database.create_container(\n \ - \ id=container_name, partition_key=PartitionKey(path=\"/productName\")\n\ - \ )\n except exceptions.CosmosResourceExistsError:\n container =\ - \ database.get_container_client(container_name)\n\n ````\n\nCreate a container\ - \ with specific settings; in this case, a custom partition key:\n\n\n\n````python\n\n customer_container_name\ - \ = \"customers\"\n try:\n customer_container = database.create_container(\n\ - \ id=customer_container_name,\n partition_key=PartitionKey(path=\"\ - /city\"),\n default_ttl=200,\n )\n except exceptions.CosmosResourceExistsError:\n\ - \ customer_container = database.get_container_client(customer_container_name)\n\ - \n ````\n" - uid: azure.cosmos.DatabaseProxy.create_container_if_not_exists name: create_container_if_not_exists summary: 'Create a container if it does not exist already. @@ -249,17 +227,6 @@ methods: exceptions: - type: azure.cosmos.exceptions.CosmosHttpResponseError description: If the given user couldn't be created. - examples: - - "Create a database user:\n\n\n\n````python\n\n try:\n database.create_user(dict(id=\"\ - Walter Harp\"))\n except exceptions.CosmosResourceExistsError:\n print(\"\ - A user with that ID already exists.\")\n except exceptions.CosmosHttpResponseError\ - \ as failure:\n print(\"Failed to create user. Status code:{}\".format(failure.status_code))\n\ - \n ````\n" - uid: azure.cosmos.DatabaseProxy.delete_container name: delete_container summary: Delete a container. @@ -343,15 +310,6 @@ methods: description: A *ContainerProxy* instance representing the retrieved database. types: - - examples: - - "Get an existing container, handling a failure if encountered:\n\n\n\n````python\n\n database =\ - \ client.get_database_client(database_name)\n container = database.get_container_client(container_name)\n\ - \n ````\n" - uid: azure.cosmos.DatabaseProxy.get_throughput name: get_throughput summary: "Get the ThroughputProperties object for this database.\nIf no ThroughputProperties\ @@ -403,15 +361,6 @@ methods: description: An Iterable of container properties (dicts). types: - [[, ]] - examples: - - "List all containers in the database:\n\n\n\n````python\n\n database =\ - \ client.get_database_client(database_name)\n for container in database.list_containers():\n\ - \ print(\"Container ID: {}\".format(container['id']))\n\n ````\n" - uid: azure.cosmos.DatabaseProxy.list_users name: list_users summary: List all the users in the container. @@ -601,18 +550,6 @@ methods: description: 'Raised if the container couldn''t be replaced. This includes if the container with given id does not exist.' - examples: - - "Reset the TTL property on a container, and display the updated properties:\n\n\n\n````python\n\n # Set the\ - \ TTL on the container to 3600 seconds (one hour)\n database.replace_container(container,\ - \ partition_key=PartitionKey(path='/productName'), default_ttl=3600)\n\n # Display\ - \ the new TTL setting for the container\n container_props = database.get_container_client(container_name).read()\n\ - \ print(\"New container TTL: {}\".format(json.dumps(container_props['defaultTtl'])))\n\ - \n ````\n" - uid: azure.cosmos.DatabaseProxy.replace_throughput name: replace_throughput summary: Replace the database-level throughput. diff --git a/docs-ref-autogen/azure-cosmos/azure.cosmos.aio.ContainerProxy.yml b/docs-ref-autogen/azure-cosmos/azure.cosmos.aio.ContainerProxy.yml index 3ed4853135ab..4748a2d25e8b 100644 --- a/docs-ref-autogen/azure-cosmos/azure.cosmos.aio.ContainerProxy.yml +++ b/docs-ref-autogen/azure-cosmos/azure.cosmos.aio.ContainerProxy.yml @@ -377,28 +377,6 @@ methods: description: An AsyncItemPaged of items (dicts). types: - [[, ]] - examples: - - "Get all products that have not been discontinued:\n\n\n\n````python\n\ - \n import json\n\n async for item in container.query_items(\n\ - \ query='SELECT * FROM products p WHERE p.productModel <> \"\ - DISCONTINUED\"',\n enable_cross_partition_query=True,\n \ - \ ):\n print(json.dumps(item, indent=True))\n\n ````\n\n\ - Parameterized query to get all products that have been discontinued:\n\n\n\n````python\n\ - \n discontinued_items = container.query_items(\n query='SELECT\ - \ * FROM products p WHERE p.productModel = @model AND p.productName=\"Widget\"\ - ',\n parameters=[dict(name=\"@model\", value=\"DISCONTINUED\")],\n\ - \ )\n async for item in discontinued_items:\n \ - \ print(json.dumps(item, indent=True))\n\n ````\n" - uid: azure.cosmos.aio.ContainerProxy.query_items_change_feed name: query_items_change_feed summary: Get a sorted list of items that were changed, in the order in which they @@ -562,16 +540,6 @@ methods: exceptions: - type: azure.cosmos.exceptions.CosmosHttpResponseError description: The given item couldn't be retrieved. - examples: - - "Get an item from the database and update one of its properties:\n\n\n\n````python\n\ - \n item = await container.read_item(\"item2\", partition_key=\"Widget\"\ - )\n item[\"productModel\"] = \"DISCONTINUED\"\n updated_item\ - \ = await container.upsert_item(item)\n\n ````\n" - uid: azure.cosmos.aio.ContainerProxy.replace_item name: replace_item summary: 'Replaces the specified item if it exists in the container. diff --git a/docs-ref-autogen/azure-cosmos/azure.cosmos.aio.CosmosClient.yml b/docs-ref-autogen/azure-cosmos/azure.cosmos.aio.CosmosClient.yml index b758f6f3e8b8..e5beada70f87 100644 --- a/docs-ref-autogen/azure-cosmos/azure.cosmos.aio.CosmosClient.yml +++ b/docs-ref-autogen/azure-cosmos/azure.cosmos.aio.CosmosClient.yml @@ -118,14 +118,6 @@ constructor: at INFO level.' types: - -examples: -- "Create a new instance of the Cosmos DB client:\n\n\n\n````python\n\n async with CosmosClient(url,\ - \ key) as client:\n\n ````\n" methods: - uid: azure.cosmos.aio.CosmosClient.close name: close @@ -177,16 +169,6 @@ methods: exceptions: - type: azure.cosmos.exceptions.CosmosResourceExistsError description: Database with the given ID already exists. - examples: - - "Create a database in the Cosmos DB account:\n\n\n\n````python\n\n database_name\ - \ = \"testDatabase\"\n try:\n database = await client.create_database(id=database_name)\n\ - \ except exceptions.CosmosResourceExistsError:\n database\ - \ = client.get_database_client(database=database_name)\n\n ````\n" - uid: azure.cosmos.aio.CosmosClient.create_database_if_not_exists name: create_database_if_not_exists summary: "Create the database if it does not exist already.\n\nIf the database already\ diff --git a/docs-ref-autogen/azure-cosmos/azure.cosmos.aio.DatabaseProxy.yml b/docs-ref-autogen/azure-cosmos/azure.cosmos.aio.DatabaseProxy.yml index 24f442b43c69..3225ddacb47a 100644 --- a/docs-ref-autogen/azure-cosmos/azure.cosmos.aio.DatabaseProxy.yml +++ b/docs-ref-autogen/azure-cosmos/azure.cosmos.aio.DatabaseProxy.yml @@ -123,29 +123,6 @@ methods: exceptions: - type: azure.cosmos.exceptions.CosmosHttpResponseError description: The container creation failed. - examples: - - "Create a container with default settings:\n\n\n\n````python\n\n container_name\ - \ = \"products\"\n try:\n container = await database.create_container(\n\ - \ id=container_name, partition_key=PartitionKey(path=\"/productName\"\ - )\n )\n except exceptions.CosmosResourceExistsError:\n\ - \ container = database.get_container_client(container_name)\n\n\ - \ ````\n\nCreate a container with specific settings; in this case, a custom\ - \ partition key:\n\n\n\n````python\n\n customer_container_name = \"customers\"\ - \n try:\n customer_container = await database.create_container(\n\ - \ id=customer_container_name,\n partition_key=PartitionKey(path=\"\ - /city\"),\n default_ttl=200,\n )\n except\ - \ exceptions.CosmosResourceExistsError:\n customer_container = database.get_container_client(customer_container_name)\n\ - \n ````\n" - uid: azure.cosmos.aio.DatabaseProxy.create_container_if_not_exists name: create_container_if_not_exists summary: 'Create a container if it does not exist already. @@ -264,18 +241,6 @@ methods: exceptions: - type: azure.cosmos.exceptions.CosmosHttpResponseError description: If the given user couldn't be created. - examples: - - "Create a database user:\n\ - \n\n\n````python\n\n try:\n\ - \ await database.create_user(dict(id=\"Walter Harp\"))\n \ - \ print(\"Created user Walter Harp.\")\n except exceptions.CosmosResourceExistsError:\n\ - \ print(\"A user with that ID already exists.\")\n except\ - \ exceptions.CosmosHttpResponseError as failure:\n print(\"Failed\ - \ to create user. Status code:{}\".format(failure.status_code))\n\n ````\n" - uid: azure.cosmos.aio.DatabaseProxy.delete_container name: delete_container summary: Delete a container. @@ -366,15 +331,6 @@ methods: description: A *ContainerProxy* instance representing the container. types: - - examples: - - "Get an existing container, handling a failure if encountered:\n\n\n\n````python\n\ - \n database = client.get_database_client(database_name)\n \ - \ container = database.get_container_client(container_name)\n\n ````\n" - uid: azure.cosmos.aio.DatabaseProxy.get_throughput name: get_throughput summary: 'Get the ThroughputProperties object for this database. @@ -439,16 +395,6 @@ methods: description: An AsyncItemPaged of container properties (dicts). types: - [[, ]] - examples: - - "List all containers in the database:\n\n\n\n````python\n\n database\ - \ = client.get_database_client(database_name)\n async for container\ - \ in database.list_containers():\n print(\"Container ID: {}\".format(container['id']))\n\ - \n ````\n" - uid: azure.cosmos.aio.DatabaseProxy.list_users name: list_users summary: List all the users in the container. @@ -642,19 +588,6 @@ methods: description: 'Raised if the container couldn''t be replaced. This includes if the container with given id does not exist.' - examples: - - "Reset the TTL property on a container, and display the updated properties:\n\n\n\n````python\n\ - \n # Set the TTL on the container to 3600 seconds (one hour)\n \ - \ await database.replace_container(container, partition_key=PartitionKey(path='/productName'),\ - \ default_ttl=3600)\n\n # Display the new TTL setting for the container\n\ - \ container_props = await database.get_container_client(container_name).read()\n\ - \ print(\"New container TTL: {}\".format(json.dumps(container_props['defaultTtl'])))\n\ - \n ````\n" - uid: azure.cosmos.aio.DatabaseProxy.replace_throughput name: replace_throughput summary: 'Replace the database-level throughput. diff --git a/docs-ref-autogen/azure-cosmos/azure.cosmos.container.ContainerProxy.yml b/docs-ref-autogen/azure-cosmos/azure.cosmos.container.ContainerProxy.yml index 3aa5c7309e71..94b39981b6be 100644 --- a/docs-ref-autogen/azure-cosmos/azure.cosmos.container.ContainerProxy.yml +++ b/docs-ref-autogen/azure-cosmos/azure.cosmos.container.ContainerProxy.yml @@ -344,26 +344,6 @@ methods: description: An Iterable of items (dicts). types: - [[, ]] - examples: - - "Get all products that have not been discontinued:\n\n\n\n````python\n\n import json\n\ - \n for item in container.query_items(\n query='SELECT * FROM products\ - \ p WHERE p.productModel <> \"DISCONTINUED\"',\n enable_cross_partition_query=True,\n\ - \ ):\n print(json.dumps(item, indent=True))\n\n ````\n\nParameterized\ - \ query to get all products that have been discontinued:\n\n\n\n````python\n\n discontinued_items\ - \ = container.query_items(\n query='SELECT * FROM products p WHERE p.productModel\ - \ = @model AND p.productName=\"Widget\"',\n parameters=[dict(name=\"@model\"\ - , value=\"DISCONTINUED\")],\n )\n for item in discontinued_items:\n \ - \ print(json.dumps(item, indent=True))\n\n ````\n" - uid: azure.cosmos.container.ContainerProxy.query_items_change_feed name: query_items_change_feed summary: Get a sorted list of items that were changed, in the order in which they @@ -517,15 +497,6 @@ methods: exceptions: - type: azure.cosmos.exceptions.CosmosHttpResponseError description: The given item couldn't be retrieved. - examples: - - "Get an item from the database and update one of its properties:\n\n\n\n````python\n\n item = container.read_item(\"\ - item2\", partition_key=\"Widget\")\n item[\"productModel\"] = \"DISCONTINUED\"\ - \n updated_item = container.upsert_item(item)\n\n ````\n" - uid: azure.cosmos.container.ContainerProxy.read_offer name: read_offer summary: "Get the ThroughputProperties object for this container.\nIf no ThroughputProperties\ diff --git a/docs-ref-autogen/azure-cosmos/azure.cosmos.cosmos_client.CosmosClient.yml b/docs-ref-autogen/azure-cosmos/azure.cosmos.cosmos_client.CosmosClient.yml index 93f03f99c3ce..7aa8c82fd091 100644 --- a/docs-ref-autogen/azure-cosmos/azure.cosmos.cosmos_client.CosmosClient.yml +++ b/docs-ref-autogen/azure-cosmos/azure.cosmos.cosmos_client.CosmosClient.yml @@ -119,16 +119,6 @@ constructor: at INFO level.' types: - -examples: -- "Create a new instance of the Cosmos DB client:\n\n\n\n````python\n\n from azure.cosmos import exceptions,\ - \ CosmosClient, PartitionKey\n\n import os\n\n url = os.environ[\"ACCOUNT_URI\"\ - ]\n key = os.environ[\"ACCOUNT_KEY\"]\n client = CosmosClient(url, key)\n\n\ - \ ````\n" methods: - uid: azure.cosmos.cosmos_client.CosmosClient.create_database name: create_database @@ -174,16 +164,6 @@ methods: exceptions: - type: azure.cosmos.exceptions.CosmosResourceExistsError description: Database with the given ID already exists. - examples: - - "Create a database in the Cosmos DB account:\n\n\n\n````python\n\n database_name\ - \ = \"testDatabase\"\n try:\n database = client.create_database(id=database_name)\n\ - \ except exceptions.CosmosResourceExistsError:\n database = client.get_database_client(database=database_name)\n\ - \n ````\n" - uid: azure.cosmos.cosmos_client.CosmosClient.create_database_if_not_exists name: create_database_if_not_exists summary: "Create the database if it does not exist already.\n\nIf the database already\ diff --git a/docs-ref-autogen/azure-cosmos/azure.cosmos.database.DatabaseProxy.yml b/docs-ref-autogen/azure-cosmos/azure.cosmos.database.DatabaseProxy.yml index e3d70ab7d6e6..6b6d7cdce56f 100644 --- a/docs-ref-autogen/azure-cosmos/azure.cosmos.database.DatabaseProxy.yml +++ b/docs-ref-autogen/azure-cosmos/azure.cosmos.database.DatabaseProxy.yml @@ -117,28 +117,6 @@ methods: exceptions: - type: azure.cosmos.exceptions.CosmosHttpResponseError description: The container creation failed. - examples: - - "Create a container with default settings:\n\n\n\n````python\n\n container_name\ - \ = \"products\"\n try:\n container = database.create_container(\n \ - \ id=container_name, partition_key=PartitionKey(path=\"/productName\")\n\ - \ )\n except exceptions.CosmosResourceExistsError:\n container =\ - \ database.get_container_client(container_name)\n\n ````\n\nCreate a container\ - \ with specific settings; in this case, a custom partition key:\n\n\n\n````python\n\n customer_container_name\ - \ = \"customers\"\n try:\n customer_container = database.create_container(\n\ - \ id=customer_container_name,\n partition_key=PartitionKey(path=\"\ - /city\"),\n default_ttl=200,\n )\n except exceptions.CosmosResourceExistsError:\n\ - \ customer_container = database.get_container_client(customer_container_name)\n\ - \n ````\n" - uid: azure.cosmos.database.DatabaseProxy.create_container_if_not_exists name: create_container_if_not_exists summary: 'Create a container if it does not exist already. @@ -249,17 +227,6 @@ methods: exceptions: - type: azure.cosmos.exceptions.CosmosHttpResponseError description: If the given user couldn't be created. - examples: - - "Create a database user:\n\n\n\n````python\n\n try:\n database.create_user(dict(id=\"\ - Walter Harp\"))\n except exceptions.CosmosResourceExistsError:\n print(\"\ - A user with that ID already exists.\")\n except exceptions.CosmosHttpResponseError\ - \ as failure:\n print(\"Failed to create user. Status code:{}\".format(failure.status_code))\n\ - \n ````\n" - uid: azure.cosmos.database.DatabaseProxy.delete_container name: delete_container summary: Delete a container. @@ -343,15 +310,6 @@ methods: description: A *ContainerProxy* instance representing the retrieved database. types: - - examples: - - "Get an existing container, handling a failure if encountered:\n\n\n\n````python\n\n database =\ - \ client.get_database_client(database_name)\n container = database.get_container_client(container_name)\n\ - \n ````\n" - uid: azure.cosmos.database.DatabaseProxy.get_throughput name: get_throughput summary: "Get the ThroughputProperties object for this database.\nIf no ThroughputProperties\ @@ -403,15 +361,6 @@ methods: description: An Iterable of container properties (dicts). types: - [[, ]] - examples: - - "List all containers in the database:\n\n\n\n````python\n\n database =\ - \ client.get_database_client(database_name)\n for container in database.list_containers():\n\ - \ print(\"Container ID: {}\".format(container['id']))\n\n ````\n" - uid: azure.cosmos.database.DatabaseProxy.list_users name: list_users summary: List all the users in the container. @@ -602,18 +551,6 @@ methods: description: 'Raised if the container couldn''t be replaced. This includes if the container with given id does not exist.' - examples: - - "Reset the TTL property on a container, and display the updated properties:\n\n\n\n````python\n\n # Set the\ - \ TTL on the container to 3600 seconds (one hour)\n database.replace_container(container,\ - \ partition_key=PartitionKey(path='/productName'), default_ttl=3600)\n\n # Display\ - \ the new TTL setting for the container\n container_props = database.get_container_client(container_name).read()\n\ - \ print(\"New container TTL: {}\".format(json.dumps(container_props['defaultTtl'])))\n\ - \n ````\n" - uid: azure.cosmos.database.DatabaseProxy.replace_throughput name: replace_throughput summary: Replace the database-level throughput. diff --git a/docs-ref-autogen/azure-data-tables/azure.data.tables.TableClient.yml b/docs-ref-autogen/azure-data-tables/azure.data.tables.TableClient.yml index 95517f516b52..fd62f2bd6b53 100644 --- a/docs-ref-autogen/azure-data-tables/azure.data.tables.TableClient.yml +++ b/docs-ref-autogen/azure-data-tables/azure.data.tables.TableClient.yml @@ -74,16 +74,6 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Creating and adding an entity to a Table\n\n\n\n````python\n\ - \n try:\n resp = table_client.create_entity(entity=self.entity)\n \ - \ print(resp)\n except ResourceExistsError:\n print(\"Entity already\ - \ exists\")\n\n ````\n" - uid: azure.data.tables.TableClient.create_table name: create_table summary: Creates a new table under the current account. @@ -95,18 +85,6 @@ methods: exceptions: - type: azure.core.exceptions.ResourceExistsError description: If the entity already exists - examples: - - "Creating a table from the TableClient object\n\n\n\n````python\n\ - \n with TableClient.from_connection_string(\n conn_str=self.connection_string,\ - \ table_name=self.table_name\n ) as table_client:\n try:\n table_item\ - \ = table_client.create_table()\n print(\"Created table {}!\".format(table_item.name))\n\ - \ except ResourceExistsError:\n print(\"Table already exists\"\ - )\n\n ````\n" - uid: azure.data.tables.TableClient.delete_entity name: delete_entity summary: 'Deletes the specified entity in a table. No error will be raised if @@ -148,15 +126,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Deleting an entity of a Table\n\n\n\n````python\n\ - \n table_client.delete_entity(row_key=self.entity[\"RowKey\"], partition_key=self.entity[\"\ - PartitionKey\"])\n print(\"Successfully deleted!\")\n\n ````\n" - uid: azure.data.tables.TableClient.delete_table name: delete_table summary: 'Deletes the table under the current account. No error will be raised @@ -169,16 +138,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Deleting a table from the TableClient object\n\n\n\n````python\n\ - \n with TableClient.from_connection_string(\n conn_str=self.connection_string,\ - \ table_name=self.table_name\n ) as table_client:\n table_client.delete_table()\n\ - \ print(\"Deleted table {}!\".format(table_client.table_name))\n\n ````\n" - uid: azure.data.tables.TableClient.from_connection_string name: from_connection_string summary: Create TableClient from a Connection String. @@ -199,17 +158,6 @@ methods: description: A table client. types: - - examples: - - "Authenticating a TableServiceClient from a connection_string\n\n\n\n````python\n\n from azure.data.tables import TableClient\n\n\ - \ with TableClient.from_connection_string(\n conn_str=self.connection_string,\ - \ table_name=\"tableName\"\n ) as table_client:\n print(\"Table name:\ - \ {}\".format(table_client.table_name))\n\n ````\n" - uid: azure.data.tables.TableClient.from_table_url name: from_table_url summary: A client to interact with a specific Table. @@ -260,16 +208,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Get a single entity from a table\n\n\n\n````python\n\ - \n # Get Entity by partition and row key\n got_entity = table.get_entity(partition_key=my_entity[\"\ - PartitionKey\"], row_key=my_entity[\"RowKey\"])\n print(\"Received entity: {}\"\ - .format(got_entity))\n\n ````\n" - uid: azure.data.tables.TableClient.get_table_access_policy name: get_table_access_policy summary: 'Retrieves details about any stored access policies specified on the table @@ -304,16 +242,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "List all entities held within a table\n\n\n\n````python\n\ - \n # Query the entities in the table\n entities = list(table.list_entities())\n\ - \ for i, entity in enumerate(entities):\n print(\"Entity #{}: {}\".format(entity,\ - \ i))\n\n ````\n" - uid: azure.data.tables.TableClient.query_entities name: query_entities summary: Lists entities in a table. @@ -345,41 +273,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Query entities held within a table\n\n\n\n````python\n\ - \n with TableClient.from_connection_string(self.connection_string, self.table_name)\ - \ as table_client:\n try:\n print(\"Basic sample:\")\n \ - \ print(\"Entities with name: marker\")\n parameters = {\"name\"\ - : \"marker\"}\n name_filter = \"Name eq @name\"\n queried_entities\ - \ = table_client.query_entities(\n query_filter=name_filter, select=[\"\ - Brand\", \"Color\"], parameters=parameters\n )\n\n for entity_chosen\ - \ in queried_entities:\n print(entity_chosen)\n\n print(\"\ - Sample for querying entities withtout metadata:\")\n print(\"Entities\ - \ with name: marker\")\n parameters = {\"name\": \"marker\"}\n \ - \ name_filter = \"Name eq @name\"\n headers = {\"Accept\" : \"\ - application/json;odata=nometadata\"}\n queried_entities = table_client.query_entities(\n\ - \ query_filter=name_filter, select=[\"Brand\", \"Color\"], parameters=parameters,\ - \ headers=headers\n )\n for entity_chosen in queried_entities:\n\ - \ print(entity_chosen)\n \n print(\"Sample for\ - \ querying entities with multiple params:\")\n print(\"Entities with\ - \ name: marker and brand: Crayola\")\n parameters = {\"name\": \"marker\"\ - , \"brand\": \"Crayola\"}\n name_filter = \"Name eq @name and Brand\ - \ eq @brand\"\n queried_entities = table_client.query_entities(\n \ - \ query_filter=name_filter, select=[\"Brand\", \"Color\"], parameters=parameters\n\ - \ )\n for entity_chosen in queried_entities:\n \ - \ print(entity_chosen)\n\n print(\"Sample for querying entities'\ - \ values:\")\n print(\"Entities with 25 < Value < 50\")\n \ - \ parameters = {\"lower\": 25, \"upper\": 50} # type: ignore\n name_filter\ - \ = \"Value gt @lower and Value lt @upper\"\n queried_entities = table_client.query_entities(\n\ - \ query_filter=name_filter, select=[\"Value\"], parameters=parameters\n\ - \ )\n for entity_chosen in queried_entities:\n \ - \ print(entity_chosen)\n except HttpResponseError as e:\n raise\n\ - \n ````\n" - uid: azure.data.tables.TableClient.set_table_access_policy name: set_table_access_policy summary: Sets stored access policies for the table that may be used with Shared @@ -429,25 +322,6 @@ methods: - [[, ]] exceptions: - type: azure.data.tables.TableTransactionError - examples: - - "Using transactions to send multiple requests at once\n\n\n\ - \n````python\n\n from azure.data.tables import TableClient, TableTransactionError\n\ - \ from azure.core.exceptions import ResourceExistsError\n\n self.table_client\ - \ = TableClient.from_connection_string(\n conn_str=self.connection_string,\ - \ table_name=self.table_name\n )\n\n try:\n self.table_client.create_table()\n\ - \ print(\"Created table\")\n except ResourceExistsError:\n print(\"\ - Table already exists\")\n\n self.table_client.upsert_entity(entity2)\n self.table_client.upsert_entity(entity3)\n\ - \ self.table_client.upsert_entity(entity4)\n\n operations = [\n (\"\ - upsert\", entity1),\n (\"delete\", entity2),\n (\"upsert\", entity3),\n\ - \ (\"update\", entity4, {\"mode\": \"replace\"}),\n ]\n try:\n \ - \ self.table_client.submit_transaction(operations) # type: ignore[arg-type]\n\ - \ except TableTransactionError as e:\n print(\"There was an error with\ - \ the transaction operation\")\n print(e)\n\n ````\n" - uid: azure.data.tables.TableClient.update_entity name: update_entity summary: Update entity in a table. @@ -483,21 +357,6 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Updating an already exiting entity in a Table\n\n\n\n````python\n\ - \n # Update the entity\n created[\"text\"] = \"NewMarker\"\n table.update_entity(mode=UpdateMode.REPLACE,\ - \ entity=created)\n\n # Get the replaced entity\n replaced = table.get_entity(partition_key=created[\"\ - PartitionKey\"], row_key=created[\"RowKey\"])\n print(\"Replaced entity: {}\"\ - .format(replaced))\n\n # Merge the entity\n replaced[\"color\"] = \"Blue\"\ - \n table.update_entity(mode=UpdateMode.MERGE, entity=replaced)\n\n # Get the\ - \ merged entity\n merged = table.get_entity(partition_key=replaced[\"PartitionKey\"\ - ], row_key=replaced[\"RowKey\"])\n print(\"Merged entity: {}\".format(merged))\n\ - \n ````\n" - uid: azure.data.tables.TableClient.upsert_entity name: upsert_entity summary: Update/Merge or Insert entity into table. @@ -521,15 +380,3 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Update/merge or insert an entity into a table\n\n\n\n````python\n\ - \n # Try Replace and insert on fail\n insert_entity = table.upsert_entity(mode=UpdateMode.REPLACE,\ - \ entity=entity1)\n print(\"Inserted entity: {}\".format(insert_entity))\n\n\ - \ created[\"text\"] = \"NewMarker\"\n merged_entity = table.upsert_entity(mode=UpdateMode.MERGE,\ - \ entity=entity)\n print(\"Merged entity: {}\".format(merged_entity))\n\n \ - \ ````\n" diff --git a/docs-ref-autogen/azure-data-tables/azure.data.tables.TableServiceClient.yml b/docs-ref-autogen/azure-data-tables/azure.data.tables.TableServiceClient.yml index d0d6597e99ad..a042d6038ed1 100644 --- a/docs-ref-autogen/azure-data-tables/azure.data.tables.TableServiceClient.yml +++ b/docs-ref-autogen/azure-data-tables/azure.data.tables.TableServiceClient.yml @@ -41,38 +41,14 @@ constructor: - - - name: api_version - description: "The Storage API version to use for requests. Default value is '2019-02-02'.\n\ - Setting to an older version may result in reduced feature compatibility.\n\n\ - \n\n## Example:Authenticating a TableServiceClient from a Shared Access Key\n\n\n\n````python\n\n from azure.data.tables import TableServiceClient\n\ - \ from azure.core.credentials import AzureNamedKeyCredential, AzureSasCredential\n\ - \n # Create a SAS token to use for authentication of a client\n from azure.data.tables\ - \ import generate_account_sas, ResourceTypes, AccountSasPermissions\n\n print(\"\ - Account name: {}\".format(self.account_name))\n credential = AzureNamedKeyCredential(self.account_name,\ - \ self.access_key) # type: ignore[arg-type]\n sas_token = generate_account_sas(\n\ - \ credential,\n resource_types=ResourceTypes(service=True),\n \ - \ permission=AccountSasPermissions(read=True),\n expiry=datetime.utcnow()\ - \ + timedelta(hours=1),\n )\n\n with TableServiceClient(endpoint=self.endpoint,\ - \ credential=AzureSasCredential(sas_token)) as token_auth_table_service:\n \ - \ properties = token_auth_table_service.get_service_properties()\n \ - \ print(\"Shared Access Signature: {}\".format(properties))\n\n ````\n\n\ - Authenticating a TableServiceClient from a Shared Account Key\n\n\n\n````python\n\n from azure.data.tables import TableServiceClient\n\ - \ from azure.core.credentials import AzureNamedKeyCredential\n\n credential\ - \ = AzureNamedKeyCredential(self.account_name, self.access_key) # type: ignore[arg-type]\n\ - \ with TableServiceClient(endpoint=self.endpoint, credential=credential) as\ - \ table_service:\n properties = table_service.get_service_properties()\n\ - \ print(\"Shared Key: {}\".format(properties))\n\n ````" + description: 'The Storage API version to use for requests. Default value is ''2019-02-02''. + + Setting to an older version may result in reduced feature compatibility. + + + + + ## Example:' types: - variables: @@ -101,18 +77,6 @@ methods: - exceptions: - type: azure.core.exceptions.ResourceExistsError - examples: - - "Creating a table from the TableServiceClient object\n\n\n\n````python\n\n with TableServiceClient.from_connection_string(self.connection_string)\ - \ as table_service_client:\n try:\n table_client = table_service_client.create_table(table_name=self.table_name)\n\ - \ print(\"Created table {}!\".format(table_client.table_name))\n \ - \ except ResourceExistsError:\n print(\"Table already exists\")\n\ - \n ````\n" - uid: azure.data.tables.TableServiceClient.create_table_if_not_exists name: create_table_if_not_exists summary: 'Creates a new table if it does not currently exist. @@ -133,16 +97,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Creating a table if it doesn't exist, from the TableServiceClient object\n\n\n\n````python\n\n with TableServiceClient.from_connection_string(self.connection_string)\ - \ as table_service_client:\n table_client = table_service_client.create_table_if_not_exists(table_name=self.table_name)\n\ - \ print(\"Table name: {}\".format(table_client.table_name))\n\n ````\n" - uid: azure.data.tables.TableServiceClient.delete_table name: delete_table summary: 'Deletes the table under the current account. No error will be raised @@ -161,16 +115,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Deleting a table from the TableServiceClient object\n\n\n\n````python\n\n with TableServiceClient.from_connection_string(self.connection_string)\ - \ as table_service_client:\n table_service_client.delete_table(table_name=self.table_name)\n\ - \ print(\"Deleted table {}!\".format(self.table_name))\n\n ````\n" - uid: azure.data.tables.TableServiceClient.from_connection_string name: from_connection_string summary: Create TableServiceClient from a connection string. @@ -185,17 +129,6 @@ methods: description: A Table service client. types: - - examples: - - "Authenticating a TableServiceClient from a connection_string\n\n\n\n````python\n\n from azure.data.tables import TableServiceClient\n\ - \n with TableServiceClient.from_connection_string(conn_str=self.connection_string)\ - \ as table_service:\n properties = table_service.get_service_properties()\n\ - \ print(\"Connection String: {}\".format(properties))\n\n ````\n" - uid: azure.data.tables.TableServiceClient.get_service_properties name: get_service_properties summary: 'Gets the properties of an account''s Table service, @@ -254,16 +187,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Listing all tables in a storage account\n\n\n\n````python\n\ - \n # List all the tables in the service\n list_tables = table_service.list_tables()\n\ - \ print(\"Listing tables:\")\n for table in list_tables:\n print(\"\\\ - t{}\".format(table.name))\n\n ````\n" - uid: azure.data.tables.TableServiceClient.query_tables name: query_tables summary: Queries tables under the given account. @@ -288,17 +211,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Querying tables in a storage account\n\n\n\n````python\n\ - \n table_name = \"mytable1\"\n name_filter = \"TableName eq '{}'\".format(table_name)\n\ - \ queried_tables = table_service.query_tables(name_filter)\n\n print(\"Queried_tables\"\ - )\n for table in queried_tables:\n print(\"\\t{}\".format(table.name))\n\ - \n ````\n" - uid: azure.data.tables.TableServiceClient.set_service_properties name: set_service_properties summary: "Sets properties for an account's Table service endpoint,\n including\ diff --git a/docs-ref-autogen/azure-data-tables/azure.data.tables.aio.TableClient.yml b/docs-ref-autogen/azure-data-tables/azure.data.tables.aio.TableClient.yml index 2b914903b2f1..1470b4c2f2ed 100644 --- a/docs-ref-autogen/azure-data-tables/azure.data.tables.aio.TableClient.yml +++ b/docs-ref-autogen/azure-data-tables/azure.data.tables.aio.TableClient.yml @@ -76,18 +76,6 @@ methods: exceptions: - type: azure.core.exceptions.ResourceExistsError description: If the entity already exists - examples: - - "Adding an entity to a Table\n\n\n\n````python\n\ - \n async with table_client:\n try:\n await table_client.create_table()\n\ - \ except HttpResponseError:\n print(\"Table already exists\")\n\ - \n try:\n resp = await table_client.create_entity(entity=self.entity)\n\ - \ print(resp)\n except ResourceExistsError:\n print(\"\ - Entity already exists\")\n\n ````\n" - uid: azure.data.tables.aio.TableClient.create_table name: create_table summary: Creates a new table under the given account. @@ -141,18 +129,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Adding an entity to a Table\n\n\n\n````python\n\ - \n async with table_client:\n try:\n resp = await table_client.create_entity(entity=self.entity)\n\ - \ except ResourceExistsError:\n print(\"Entity already exists!\"\ - )\n\n await table_client.delete_entity(row_key=self.entity[\"RowKey\"],\ - \ partition_key=self.entity[\"PartitionKey\"]) # type: ignore[call-overload]\n\ - \ print(\"Successfully deleted!\")\n\n ````\n" - uid: azure.data.tables.aio.TableClient.delete_table name: delete_table summary: 'Deletes the table under the current account. No error will be raised if @@ -165,17 +141,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Deleting a table from the TableClient object.\n\n\n\n````python\n\n async with\ - \ TableClient.from_connection_string(\n conn_str=self.connection_string,\ - \ table_name=self.table_name\n ) as table_client:\n await table_client.delete_table()\n\ - \ print(\"Deleted table {}!\".format(table_client.table_name))\n\n ````\n" - uid: azure.data.tables.aio.TableClient.from_connection_string name: from_connection_string summary: Create TableClient from a Connection string. @@ -196,17 +161,6 @@ methods: description: A table client. types: - - examples: - - "Creating the TableClient from a connection string.\n\n\n\n````python\n\n from azure.data.tables.aio\ - \ import TableClient\n\n async with TableClient.from_connection_string(\n \ - \ conn_str=self.connection_string, table_name=\"tableName\"\n ) as table_client:\n\ - \ print(\"Table name: {}\".format(table_client.table_name))\n\n ````\n" - uid: azure.data.tables.aio.TableClient.from_table_url name: from_table_url summary: A client to interact with a specific Table. @@ -257,18 +211,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Getting an entity from PartitionKey and RowKey\n\n\n\n````python\n\ - \n # Get Entity by partition and row key\n got_entity = await table.get_entity(\n\ - \ partition_key=my_entity[\"PartitionKey\"], row_key=my_entity[\"RowKey\"\ - ] # type: ignore[arg-type]\n )\n print(\"Received entity: {}\".format(got_entity))\n\ - \n ````\n" - uid: azure.data.tables.aio.TableClient.get_table_access_policy name: get_table_access_policy summary: 'Retrieves details about any stored access policies specified on the table @@ -303,16 +245,6 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Querying entities from a TableClient\n\n\n\n````python\n\ - \n # Query the entities in the table\n i = 0\n async for entity in table.list_entities():\n\ - \ print(\"Entity #{}: {}\".format(i, entity))\n i += 1\n\n ````\n" - uid: azure.data.tables.aio.TableClient.query_entities name: query_entities summary: Lists entities in a table. @@ -344,42 +276,6 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Querying entities from a TableClient\n\n\n\n````python\n\n async with TableClient.from_connection_string(self.connection_string,\ - \ self.table_name) as table_client:\n try:\n print(\"Basic sample:\"\ - )\n print(\"Entities with name: marker\")\n parameters = {u\"\ - name\": u\"marker\"}\n name_filter = u\"Name eq @name\"\n \ - \ queried_entities = table_client.query_entities(\n query_filter=name_filter,\ - \ select=[u\"Brand\", u\"Color\"], parameters=parameters\n )\n \ - \ async for entity_chosen in queried_entities:\n print(entity_chosen)\n\ - \n print(\"Sample for querying entities withtout metadata:\")\n \ - \ print(\"Entities with name: marker\")\n parameters = {u\"name\"\ - : u\"marker\"}\n name_filter = u\"Name eq @name\"\n headers\ - \ = {\"Accept\" : \"application/json;odata=nometadata\"}\n queried_entities\ - \ = table_client.query_entities(\n query_filter=name_filter, select=[u\"\ - Brand\", u\"Color\"], parameters=parameters, headers=headers\n )\n \ - \ async for entity_chosen in queried_entities:\n print(entity_chosen)\n\ - \n print(\"Sample for querying entities with multiple params:\")\n \ - \ print(\"Entities with name: marker and brand: Crayola\")\n \ - \ parameters = {u\"name\": u\"marker\", u\"brand\": u\"Crayola\"}\n \ - \ name_filter = u\"Name eq @name and Brand eq @brand\"\n queried_entities\ - \ = table_client.query_entities(\n query_filter=name_filter, select=[u\"\ - Brand\", u\"Color\"], parameters=parameters\n )\n async for\ - \ entity_chosen in queried_entities:\n print(entity_chosen)\n\n\ - \ print(\"Sample for querying entities' values:\")\n print(\"\ - Entities with 25 < Value < 50\")\n parameters = {u\"lower\": 25, u\"\ - upper\": 50} # type: ignore\n name_filter = u\"Value gt @lower and Value\ - \ lt @upper\"\n queried_entities = table_client.query_entities(\n \ - \ query_filter=name_filter, select=[u\"Value\"], parameters=parameters\n\ - \ )\n async for entity_chosen in queried_entities:\n \ - \ print(entity_chosen)\n except HttpResponseError as e:\n \ - \ raise\n\n ````\n" - uid: azure.data.tables.aio.TableClient.set_table_access_policy name: set_table_access_policy summary: Sets stored access policies for the table that may be used with Shared @@ -431,25 +327,6 @@ methods: - [[, ]] exceptions: - type: azure.data.tables.TableTransactionError - examples: - - "Using transactions to send multiple requests at once\n\n\n\n````python\n\n from azure.data.tables.aio import\ - \ TableClient\n from azure.data.tables import TableTransactionError\n from\ - \ azure.core.exceptions import ResourceExistsError\n\n self.table_client = TableClient.from_connection_string(\n\ - \ conn_str=self.connection_string, table_name=self.table_name\n )\n\n\ - \ try:\n await self.table_client.create_table()\n print(\"Created\ - \ table\")\n except ResourceExistsError:\n print(\"Table already exists\"\ - )\n\n await self._create_entities()\n\n operations = [\n (\"create\"\ - , self.entity1),\n (\"delete\", self.entity2),\n (\"upsert\", self.entity3),\n\ - \ (\"update\", self.entity4, {\"mode\": \"replace\"}),\n ]\n try:\n\ - \ await self.table_client.submit_transaction(operations) # type: ignore[arg-type]\n\ - \ except TableTransactionError as e:\n print(\"There was an error with\ - \ the transaction operation\")\n print(\"Error: {}\".format(e))\n\n ````\n" - uid: azure.data.tables.aio.TableClient.update_entity name: update_entity summary: Update entity in a table. @@ -485,22 +362,6 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Querying entities from a TableClient\n\n\n\n````python\n\ - \n # Update the entity\n created[\"text\"] = \"NewMarker\"\n await table.update_entity(mode=UpdateMode.REPLACE,\ - \ entity=created)\n\n # Get the replaced entity\n replaced = await table.get_entity(partition_key=created[\"\ - PartitionKey\"], row_key=created[\"RowKey\"])\n print(\"Replaced entity: {}\"\ - .format(replaced))\n\n # Merge the entity\n replaced[\"color\"] = \"Blue\"\ - \n await table.update_entity(mode=UpdateMode.MERGE, entity=replaced)\n\n #\ - \ Get the merged entity\n merged = await table.get_entity(partition_key=replaced[\"\ - PartitionKey\"], row_key=replaced[\"RowKey\"])\n print(\"Merged entity: {}\"\ - .format(merged))\n\n ````\n" - uid: azure.data.tables.aio.TableClient.upsert_entity name: upsert_entity summary: Update/Merge or Insert entity into table. @@ -524,16 +385,3 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Update/Merge or Insert an entity into a table\n\n\n\n````python\n\ - \n # Try Replace and insert on fail\n insert_entity = await table.upsert_entity(mode=UpdateMode.REPLACE,\ - \ entity=entity1)\n print(\"Inserted entity: {}\".format(insert_entity))\n\n\ - \ created[\"text\"] = \"NewMarker\"\n merged_entity = await table.upsert_entity(mode=UpdateMode.MERGE,\ - \ entity=entity)\n print(\"Merged entity: {}\".format(merged_entity))\n\n \ - \ ````\n" diff --git a/docs-ref-autogen/azure-data-tables/azure.data.tables.aio.TableServiceClient.yml b/docs-ref-autogen/azure-data-tables/azure.data.tables.aio.TableServiceClient.yml index de0a7abaff75..1eb0fca0cc3a 100644 --- a/docs-ref-autogen/azure-data-tables/azure.data.tables.aio.TableServiceClient.yml +++ b/docs-ref-autogen/azure-data-tables/azure.data.tables.aio.TableServiceClient.yml @@ -56,35 +56,6 @@ variables: name: url types: - -examples: -- "Creating the tableServiceClient with an account url and credential.\n\n\n\n````python\n\n from azure.data.tables.aio\ - \ import TableServiceClient\n\n async with TableServiceClient.from_connection_string(conn_str=self.connection_string)\ - \ as table_service:\n properties = await table_service.get_service_properties()\n\ - \ print(\"Shared Key: {}\".format(properties))\n\n ````\n\nCreating the\ - \ tableServiceClient with Shared Access Signature.\n\n\n\n````python\n\n from azure.data.tables.aio\ - \ import TableServiceClient\n from azure.core.credentials import AzureNamedKeyCredential,\ - \ AzureSasCredential\n\n # Create a SAS token to use for authentication of a client\n\ - \ from azure.data.tables import generate_account_sas, ResourceTypes, AccountSasPermissions\n\ - \n print(\"Account name: {}\".format(self.account_name))\n credential = AzureNamedKeyCredential(self.account_name,\ - \ self.access_key) # type: ignore[arg-type]\n sas_token = generate_account_sas(\n\ - \ credential,\n resource_types=ResourceTypes(service=True),\n \ - \ permission=AccountSasPermissions(read=True),\n expiry=datetime.utcnow()\ - \ + timedelta(hours=1),\n )\n\n async with TableServiceClient(endpoint=self.endpoint,\ - \ credential=AzureSasCredential(sas_token)) as token_auth_table_service:\n \ - \ properties = await token_auth_table_service.get_service_properties()\n \ - \ print(\"Shared Access Signature: {}\".format(properties))\n\n ````\n" methods: - uid: azure.data.tables.aio.TableServiceClient.create_table name: create_table @@ -104,19 +75,6 @@ methods: - exceptions: - type: azure.core.exceptions.ResourceExistsError - examples: - - "Creating a table from TableServiceClient.\n\n\n\n````python\n\n async with\ - \ TableServiceClient.from_connection_string(self.connection_string) as table_service_client:\n\ - \ try:\n table_client = await table_service_client.create_table(table_name=self.table_name)\n\ - \ print(\"Created table {}!\".format(table_client.table_name))\n \ - \ except ResourceExistsError:\n print(\"Table already exists\")\n\ - \n ````\n" - uid: azure.data.tables.aio.TableServiceClient.create_table_if_not_exists name: create_table_if_not_exists summary: 'Creates a new table if it does not currently exist. @@ -135,17 +93,6 @@ methods: description: TableClient types: - - examples: - - "Creating a table if it does not already exist\n\n\n\n````python\n\n async with\ - \ TableServiceClient.from_connection_string(self.connection_string) as table_service_client:\n\ - \ table_client = await table_service_client.create_table_if_not_exists(table_name=self.table_name)\n\ - \ print(\"Table name: {}\".format(table_client.table_name))\n\n ````\n" - uid: azure.data.tables.aio.TableServiceClient.delete_table name: delete_table summary: 'Deletes a table under the current account. No error will be raised if @@ -164,16 +111,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Deleting a table\n\n\n\n````python\n\ - \n async with TableServiceClient.from_connection_string(self.connection_string)\ - \ as table_service_client:\n await table_service_client.delete_table(table_name=self.table_name)\n\ - \ print(\"Deleted table {}!\".format(self.table_name))\n\n ````\n" - uid: azure.data.tables.aio.TableServiceClient.from_connection_string name: from_connection_string summary: Create TableServiceClient from a Connection String. @@ -188,17 +125,6 @@ methods: description: A Table service client. types: - - examples: - - "Creating the tableServiceClient from a connection string\n\n\n\n````python\n\n from azure.data.tables.aio\ - \ import TableServiceClient\n\n async with TableServiceClient.from_connection_string(conn_str=self.connection_string)\ - \ as table_service:\n properties = await table_service.get_service_properties()\n\ - \ print(\"Connection String: {}\".format(properties))\n\n ````\n" - uid: azure.data.tables.aio.TableServiceClient.get_service_properties name: get_service_properties summary: 'Gets the properties of an account''s Table service, @@ -262,16 +188,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Listing all tables in an account\n\n\n\n````python\n\n # List all the tables in the\ - \ service\n print(\"Listing tables:\")\n async for table in table_service.list_tables():\n\ - \ print(\"\\t{}\".format(table.name))\n\n ````\n" - uid: azure.data.tables.aio.TableServiceClient.query_tables name: query_tables summary: Queries tables under the given account. @@ -296,18 +212,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Querying tables in an account given specific parameters\n\n\n\n````python\n\n # Query for \"\ - table1\" in the tables created\n table_name = \"mytableasync1\"\n name_filter\ - \ = \"TableName eq '{}'\".format(table_name)\n print(\"Queried_tables\")\n \ - \ async for table in table_service.query_tables(name_filter):\n print(\"\ - \\t{}\".format(table.name))\n\n ````\n" - uid: azure.data.tables.aio.TableServiceClient.set_service_properties name: set_service_properties summary: "Sets properties for an account's Table service endpoint,\n including\ diff --git a/docs-ref-autogen/azure-datalake-store/azure.datalake.store.lib.DatalakeRESTInterface.yml b/docs-ref-autogen/azure-datalake-store/azure.datalake.store.lib.DatalakeRESTInterface.yml index 212602888143..cb2d01abdd8e 100644 --- a/docs-ref-autogen/azure-datalake-store/azure.datalake.store.lib.DatalakeRESTInterface.yml +++ b/docs-ref-autogen/azure-datalake-store/azure.datalake.store.lib.DatalakeRESTInterface.yml @@ -125,18 +125,18 @@ attributes: name: session - uid: azure.datalake.store.lib.DatalakeRESTInterface.ends name: ends - signature: 'ends = {''APPEND'': (''post'', set(), {''syncFlag'', ''leaseid'', ''offset'', - ''append'', ''filesessionid''}), ''CHECKACCESS'': (''get'', set(), {''fsaction''}), + signature: 'ends = {''APPEND'': (''post'', set(), {''offset'', ''filesessionid'', + ''append'', ''syncFlag'', ''leaseid''}), ''CHECKACCESS'': (''get'', set(), {''fsaction''}), ''CONCAT'': (''post'', {''sources''}, {''sources''}), ''CREATE'': (''put'', set(), - {''syncFlag'', ''leaseid'', ''write'', ''overwrite'', ''filesessionid''}), ''DELETE'': + {''filesessionid'', ''syncFlag'', ''overwrite'', ''leaseid'', ''write''}), ''DELETE'': (''delete'', set(), {''recursive''}), ''GETCONTENTSUMMARY'': (''get'', set(), set()), ''GETFILESTATUS'': (''get'', set(), set()), ''LISTSTATUS'': (''get'', set(), {''listAfter'', ''listSize''}), ''MKDIRS'': (''put'', set(), set()), ''MODIFYACLENTRIES'': (''put'', {''aclSpec''}, {''aclSpec''}), ''MSCONCAT'': (''post'', set(), {''deleteSourceDirectory''}), - ''MSGETACLSTATUS'': (''get'', set(), set()), ''OPEN'': (''get'', set(), {''length'', - ''read'', ''offset'', ''filesessionid''}), ''REMOVEACL'': (''put'', set(), set()), + ''MSGETACLSTATUS'': (''get'', set(), set()), ''OPEN'': (''get'', set(), {''offset'', + ''length'', ''filesessionid'', ''read''}), ''REMOVEACL'': (''put'', set(), set()), ''REMOVEACLENTRIES'': (''put'', {''aclSpec''}, {''aclSpec''}), ''REMOVEDEFAULTACL'': (''put'', set(), set()), ''RENAME'': (''put'', {''destination''}, {''destination''}), ''SETACL'': (''put'', {''aclSpec''}, {''aclSpec''}), ''SETEXPIRY'': (''put'', {''expiryOption''}, {''expiryOption'', ''expireTime''}), ''SETOWNER'': (''put'', - set(), {''group'', ''owner''}), ''SETPERMISSION'': (''put'', set(), {''permission''})}' + set(), {''owner'', ''group''}), ''SETPERMISSION'': (''put'', set(), {''permission''})}' diff --git a/docs-ref-autogen/azure-eventhub/azure.eventhub.EventData.yml b/docs-ref-autogen/azure-eventhub/azure.eventhub.EventData.yml index 73bb156b46ec..ce94c0277797 100644 --- a/docs-ref-autogen/azure-eventhub/azure.eventhub.EventData.yml +++ b/docs-ref-autogen/azure-eventhub/azure.eventhub.EventData.yml @@ -16,15 +16,6 @@ constructor: types: - - -examples: -- "Create instances of EventData\n\n\n\n````python\n\n from azure.eventhub\ - \ import EventData\n\n event_data = EventData(\"String data\")\n event_data\ - \ = EventData(b\"Bytes data\")\n\n\n ````\n" methods: - uid: azure.eventhub.EventData.body_as_json name: body_as_json diff --git a/docs-ref-autogen/azure-eventhub/azure.eventhub.EventHubConsumerClient.yml b/docs-ref-autogen/azure-eventhub/azure.eventhub.EventHubConsumerClient.yml index 3945a51cecb0..3994275c3a0f 100644 --- a/docs-ref-autogen/azure-eventhub/azure.eventhub.EventHubConsumerClient.yml +++ b/docs-ref-autogen/azure-eventhub/azure.eventhub.EventHubConsumerClient.yml @@ -265,21 +265,6 @@ constructor: False and the Pure Python AMQP library will be used as the underlying transport.' types: - -examples: -- "Create a new instance of the EventHubConsumerClient.\n\n\n\n````python\n\n import os\n from azure.eventhub\ - \ import EventHubConsumerClient, EventHubSharedKeyCredential\n\n fully_qualified_namespace\ - \ = os.environ['EVENT_HUB_HOSTNAME']\n eventhub_name = os.environ['EVENT_HUB_NAME']\n\ - \ shared_access_policy = os.environ['EVENT_HUB_SAS_POLICY']\n shared_access_key\ - \ = os.environ['EVENT_HUB_SAS_KEY']\n\n credential = EventHubSharedKeyCredential(shared_access_policy,\ - \ shared_access_key)\n consumer = EventHubConsumerClient(\n fully_qualified_namespace=fully_qualified_namespace,\n\ - \ eventhub_name=eventhub_name,\n consumer_group='$Default',\n \ - \ credential=credential)\n\n ````\n" methods: - uid: azure.eventhub.EventHubConsumerClient.close name: close @@ -289,30 +274,6 @@ methods: return: types: - - examples: - - "Close down the client.\n\n\n\n````python\n\ - \n import os\n import threading\n\n event_hub_connection_str = os.environ['EVENT_HUB_CONN_STR']\n\ - \ eventhub_name = os.environ['EVENT_HUB_NAME']\n\n from azure.eventhub import\ - \ EventHubConsumerClient\n consumer = EventHubConsumerClient.from_connection_string(\n\ - \ conn_str=event_hub_connection_str,\n consumer_group=\"$Default\"\ - ,\n eventhub_name=eventhub_name # EventHub name should be specified if\ - \ it doesn't show up in connection string.\n )\n\n logger = logging.getLogger(\"\ - azure.eventhub\")\n\n def on_event(partition_context, event):\n # Put\ - \ your code here.\n # If the operation is i/o intensive, multi-thread will\ - \ have better performance.\n logger.info(\"Received event from partition:\ - \ {}\".format(partition_context.partition_id))\n\n # The 'receive' method is\ - \ a blocking call, it can be executed in a thread for\n # non-blocking behavior,\ - \ and combined with the 'close' method.\n\n worker = threading.Thread(\n \ - \ target=consumer.receive,\n kwargs={\n \"on_event\": on_event,\n\ - \ \"starting_position\": \"-1\", # \"-1\" is from the beginning of\ - \ the partition.\n }\n )\n worker.start()\n time.sleep(10) # Keep\ - \ receiving for 10s then close.\n # Close down the consumer handler explicitly.\n\ - \ consumer.close()\n\n ````\n" - uid: azure.eventhub.EventHubConsumerClient.from_connection_string name: from_connection_string summary: Create an EventHubConsumerClient from a connection string. @@ -526,19 +487,6 @@ methods: return: types: - - examples: - - "Create a new instance of the EventHubConsumerClient from connection string.\n\n\n\n````python\n\n import os\n from azure.eventhub\ - \ import EventHubConsumerClient\n event_hub_connection_str = os.environ['EVENT_HUB_CONN_STR']\n\ - \ eventhub_name = os.environ['EVENT_HUB_NAME']\n consumer = EventHubConsumerClient.from_connection_string(\n\ - \ conn_str=event_hub_connection_str,\n consumer_group='$Default',\n\ - \ eventhub_name=eventhub_name # EventHub name should be specified if it\ - \ doesn't show up in connection string.\n )\n\n ````\n" - uid: azure.eventhub.EventHubConsumerClient.get_eventhub_properties name: get_eventhub_properties summary: "Get properties of the Event Hub.\n\nKeys in the returned dictionary include:\n\ @@ -744,19 +692,6 @@ methods: return: types: - - examples: - - "Receive events from the EventHub.\n\n\n\n````python\n\n logger = logging.getLogger(\"azure.eventhub\"\ - )\n\n def on_event(partition_context, event):\n # Put your code\ - \ here.\n # If the operation is i/o intensive, multi-thread will have\ - \ better performance.\n logger.info(\"Received event from partition:\ - \ {}\".format(partition_context.partition_id))\n\n with consumer:\n \ - \ consumer.receive(on_event=on_event)\n\n ````\n" - uid: azure.eventhub.EventHubConsumerClient.receive_batch name: receive_batch summary: Receive events from partition(s), with optional load-balancing and checkpointing. @@ -937,16 +872,3 @@ methods: return: types: - - examples: - - "Receive events in batches from the EventHub.\n\n\n\n````python\n\n logger = logging.getLogger(\"azure.eventhub\"\ - )\n\n def on_event_batch(partition_context, event_batch):\n #\ - \ Put your code here.\n # If the operation is i/o intensive, multi-thread\ - \ will have better performance.\n logger.info(\"Received events from\ - \ partition: {}\".format(partition_context.partition_id))\n\n with consumer:\n\ - \ consumer.receive_batch(on_event_batch=on_event_batch)\n\n ````\n" diff --git a/docs-ref-autogen/azure-eventhub/azure.eventhub.EventHubProducerClient.yml b/docs-ref-autogen/azure-eventhub/azure.eventhub.EventHubProducerClient.yml index 3f02b6807f52..5bb8bf70969f 100644 --- a/docs-ref-autogen/azure-eventhub/azure.eventhub.EventHubProducerClient.yml +++ b/docs-ref-autogen/azure-eventhub/azure.eventhub.EventHubProducerClient.yml @@ -216,22 +216,6 @@ constructor: False and the Pure Python AMQP library will be used as the underlying transport.' types: - -examples: -- "Create a new instance of the EventHubProducerClient.\n\n\n\n````python\n\n import os\n from azure.eventhub\ - \ import EventHubProducerClient, EventHubSharedKeyCredential\n\n fully_qualified_namespace\ - \ = os.environ['EVENT_HUB_HOSTNAME']\n eventhub_name = os.environ['EVENT_HUB_NAME']\n\ - \ shared_access_policy = os.environ['EVENT_HUB_SAS_POLICY']\n shared_access_key\ - \ = os.environ['EVENT_HUB_SAS_KEY']\n\n credential = EventHubSharedKeyCredential(shared_access_policy,\ - \ shared_access_key)\n producer = EventHubProducerClient(\n fully_qualified_namespace=fully_qualified_namespace,\n\ - \ eventhub_name=eventhub_name, # EventHub name should be specified if it\ - \ doesn't show up in connection string.\n credential=credential\n )\n\n\ - \ ````\n" methods: - uid: azure.eventhub.EventHubProducerClient.close name: close @@ -260,25 +244,6 @@ methods: to True or closing the underlying AMQP connections in buffered mode.' - examples: - - "Close down the client.\n\n\n\n````python\n\ - \n import os\n from azure.eventhub import EventHubProducerClient, EventData\n\ - \n event_hub_connection_str = os.environ['EVENT_HUB_CONN_STR']\n eventhub_name\ - \ = os.environ['EVENT_HUB_NAME']\n\n producer = EventHubProducerClient.from_connection_string(\n\ - \ conn_str=event_hub_connection_str,\n eventhub_name=eventhub_name\ - \ # EventHub name should be specified if it doesn't show up in connection string.\n\ - \ )\n try:\n event_data_batch = producer.create_batch()\n\n while\ - \ True:\n try:\n event_data_batch.add(EventData('Message\ - \ inside EventBatchData'))\n except ValueError:\n # EventDataBatch\ - \ object reaches max_size.\n # New EventDataBatch object can be\ - \ created here to send more data\n break\n\n producer.send_batch(event_data_batch)\n\ - \ finally:\n # Close down the producer handler.\n producer.close()\n\ - \n ````\n" - uid: azure.eventhub.EventHubProducerClient.create_batch name: create_batch summary: 'Create an EventDataBatch object with the max size of all content being @@ -327,19 +292,6 @@ methods: return: types: - - examples: - - "Create EventDataBatch object within limited size\n\n\n\n````python\n\n event_data_batch = producer.create_batch()\n\ - \ while True:\n try:\n event_data_batch.add(EventData('Message\ - \ inside EventBatchData'))\n except ValueError:\n # The\ - \ EventDataBatch object reaches its max_size.\n # You can send the\ - \ full EventDataBatch object and create a new one here.\n break\n\ - \n ````\n" - uid: azure.eventhub.EventHubProducerClient.flush name: flush summary: 'Buffered mode only. @@ -563,19 +515,6 @@ methods: return: types: - - examples: - - "Create a new instance of the EventHubProducerClient from connection string.\n\n\n\n````python\n\n import os\n from azure.eventhub\ - \ import EventHubProducerClient\n event_hub_connection_str = os.environ['EVENT_HUB_CONN_STR']\n\ - \ eventhub_name = os.environ['EVENT_HUB_NAME']\n producer = EventHubProducerClient.from_connection_string(\n\ - \ conn_str=event_hub_connection_str,\n eventhub_name=eventhub_name\ - \ # EventHub name should be specified if it doesn't show up in connection string.\n\ - \ )\n\n ````\n" - uid: azure.eventhub.EventHubProducerClient.get_buffered_event_count name: get_buffered_event_count summary: "The number of events that are buffered and waiting to be published for\ @@ -738,19 +677,6 @@ methods: sent in non-buffered mode or the events can not be enqueued into the buffered in buffered mode.' - examples: - - "Sends event data\n\n\n\n````python\n\ - \n with producer:\n event_data_batch = producer.create_batch()\n\ - \n while True:\n try:\n event_data_batch.add(EventData('Message\ - \ inside EventBatchData'))\n except ValueError:\n \ - \ # EventDataBatch object reaches max_size.\n # New EventDataBatch\ - \ object can be created here to send more data\n break\n\n \ - \ producer.send_batch(event_data_batch)\n\n ````\n" - uid: azure.eventhub.EventHubProducerClient.send_event name: send_event summary: "Sends an event data.\nBy default, the method will block until acknowledgement\ diff --git a/docs-ref-autogen/azure-eventhub/azure.eventhub.aio.EventHubConsumerClient.yml b/docs-ref-autogen/azure-eventhub/azure.eventhub.aio.EventHubConsumerClient.yml index 1762e79cbb09..8a015931f361 100644 --- a/docs-ref-autogen/azure-eventhub/azure.eventhub.aio.EventHubConsumerClient.yml +++ b/docs-ref-autogen/azure-eventhub/azure.eventhub.aio.EventHubConsumerClient.yml @@ -265,22 +265,6 @@ constructor: False and the Pure Python AMQP library will be used as the underlying transport.' types: - -examples: -- "Create a new instance of the EventHubConsumerClient.\n\n\n\n````python\n\n import os\n from azure.eventhub.aio\ - \ import EventHubConsumerClient, EventHubSharedKeyCredential\n\n fully_qualified_namespace\ - \ = os.environ['EVENT_HUB_HOSTNAME']\n eventhub_name = os.environ['EVENT_HUB_NAME']\n\ - \ shared_access_policy = os.environ['EVENT_HUB_SAS_POLICY']\n shared_access_key\ - \ = os.environ['EVENT_HUB_SAS_KEY']\n\n consumer = EventHubConsumerClient(fully_qualified_namespace=fully_qualified_namespace,\n\ - \ consumer_group='$Default',\n \ - \ eventhub_name=eventhub_name,\n \ - \ credential=EventHubSharedKeyCredential(shared_access_policy, shared_access_key))\n\ - \n ````\n" methods: - uid: azure.eventhub.aio.EventHubConsumerClient.close name: close @@ -290,29 +274,6 @@ methods: return: types: - - examples: - - "Close down the client.\n\n\n\n````python\n\ - \n import os\n\n event_hub_connection_str = os.environ['EVENT_HUB_CONN_STR']\n\ - \ eventhub_name = os.environ['EVENT_HUB_NAME']\n\n from azure.eventhub.aio\ - \ import EventHubConsumerClient\n consumer = EventHubConsumerClient.from_connection_string(\n\ - \ conn_str=event_hub_connection_str,\n consumer_group='$Default',\n\ - \ eventhub_name=eventhub_name # EventHub name should be specified if it\ - \ doesn't show up in connection string.\n )\n\n logger = logging.getLogger(\"\ - azure.eventhub\")\n\n async def on_event(partition_context, event):\n \ - \ # Put your code here.\n # If the operation is i/o intensive, async will\ - \ have better performance.\n logger.info(\"Received event from partition:\ - \ {}\".format(partition_context.partition_id))\n\n # The receive method is a\ - \ coroutine which will be blocking when awaited.\n # It can be executed in an\ - \ async task for non-blocking behavior, and combined with the 'close' method.\n\ - \n recv_task = asyncio.ensure_future(consumer.receive(on_event=on_event))\n\ - \ await asyncio.sleep(3) # keep receiving for 3 seconds\n recv_task.cancel()\ - \ # stop receiving\n\n # Close down the consumer handler explicitly.\n await\ - \ consumer.close()\n\n ````\n" - uid: azure.eventhub.aio.EventHubConsumerClient.from_connection_string name: from_connection_string summary: Create an EventHubConsumerClient from a connection string. @@ -530,20 +491,6 @@ methods: return: types: - - examples: - - "Create a new instance of the EventHubConsumerClient from connection string.\n\n\n\n````python\n\n import os\n from\ - \ azure.eventhub.aio import EventHubConsumerClient\n event_hub_connection_str\ - \ = os.environ['EVENT_HUB_CONN_STR']\n eventhub_name = os.environ['EVENT_HUB_NAME']\n\ - \ consumer = EventHubConsumerClient.from_connection_string(\n conn_str=event_hub_connection_str,\n\ - \ consumer_group='$Default',\n eventhub_name=eventhub_name # EventHub\ - \ name should be specified if it doesn't show up in connection string.\n )\n\ - \n ````\n" - uid: azure.eventhub.aio.EventHubConsumerClient.get_eventhub_properties name: get_eventhub_properties summary: "Get properties of the Event Hub.\n\nKeys in the returned dictionary include:\n\ @@ -754,21 +701,6 @@ methods: return: types: - - examples: - - "Receive events from the EventHub.\n\n\n\n````python\n\n logger = logging.getLogger(\"\ - azure.eventhub\")\n\n async def on_event(partition_context, event):\n \ - \ # Put your code here.\n # If the operation is i/o intensive,\ - \ async will have better performance.\n logger.info(\"Received event\ - \ from partition: {}\".format(partition_context.partition_id))\n\n async\ - \ with consumer:\n await consumer.receive(\n on_event=on_event,\n\ - \ starting_position=\"-1\", # \"-1\" is from the beginning of the\ - \ partition.\n )\n\n ````\n" - uid: azure.eventhub.aio.EventHubConsumerClient.receive_batch name: receive_batch summary: Receive events from partition(s) in batches, with optional load-balancing @@ -958,18 +890,3 @@ methods: return: types: - - examples: - - "Receive events in batches from the EventHub.\n\n\n\n````python\n\n logger = logging.getLogger(\"\ - azure.eventhub\")\n\n async def on_event_batch(partition_context, event_batch):\n\ - \ # Put your code here.\n # If the operation is i/o intensive,\ - \ async will have better performance.\n logger.info(\n \ - \ \"{} events received from partition: {}\".format(len(event_batch), partition_context.partition_id)\n\ - \ )\n\n async with consumer:\n await consumer.receive_batch(\n\ - \ on_event_batch=on_event_batch,\n starting_position=\"\ - -1\", # \"-1\" is from the beginning of the partition.\n )\n\n ````\n" diff --git a/docs-ref-autogen/azure-eventhub/azure.eventhub.aio.EventHubProducerClient.yml b/docs-ref-autogen/azure-eventhub/azure.eventhub.aio.EventHubProducerClient.yml index 90b94676a8e2..5cc536c5a7db 100644 --- a/docs-ref-autogen/azure-eventhub/azure.eventhub.aio.EventHubProducerClient.yml +++ b/docs-ref-autogen/azure-eventhub/azure.eventhub.aio.EventHubProducerClient.yml @@ -208,21 +208,6 @@ constructor: False and the Pure Python AMQP library will be used as the underlying transport.' types: - -examples: -- "Create a new instance of the EventHubProducerClient.\n\n\n\n````python\n\n import os\n from azure.eventhub.aio\ - \ import EventHubProducerClient, EventHubSharedKeyCredential\n\n fully_qualified_namespace\ - \ = os.environ['EVENT_HUB_HOSTNAME']\n eventhub_name = os.environ['EVENT_HUB_NAME']\n\ - \ shared_access_policy = os.environ['EVENT_HUB_SAS_POLICY']\n shared_access_key\ - \ = os.environ['EVENT_HUB_SAS_KEY']\n\n producer = EventHubProducerClient(fully_qualified_namespace=fully_qualified_namespace,\n\ - \ eventhub_name=eventhub_name,\n \ - \ credential=EventHubSharedKeyCredential(shared_access_policy,\ - \ shared_access_key))\n\n ````\n" methods: - uid: azure.eventhub.aio.EventHubProducerClient.close name: close @@ -251,25 +236,6 @@ methods: to True or closing the underlying AMQP connections in buffered mode.' - examples: - - "Close down the handler.\n\n\n\n````python\n\ - \n import os\n from azure.eventhub.aio import EventHubProducerClient\n from\ - \ azure.eventhub import EventData\n\n event_hub_connection_str = os.environ['EVENT_HUB_CONN_STR']\n\ - \ eventhub_name = os.environ['EVENT_HUB_NAME']\n\n producer = EventHubProducerClient.from_connection_string(\n\ - \ conn_str=event_hub_connection_str,\n eventhub_name=eventhub_name\ - \ # EventHub name should be specified if it doesn't show up in connection string.\n\ - \ )\n try:\n event_data_batch = await producer.create_batch()\n \ - \ while True:\n try:\n event_data_batch.add(EventData('Message\ - \ inside EventBatchData'))\n except ValueError:\n # The\ - \ EventDataBatch object reaches its max_size.\n # You can send the\ - \ full EventDataBatch object and create a new one here.\n break\n\ - \ await producer.send_batch(event_data_batch)\n finally:\n # Close\ - \ down the producer handler.\n await producer.close()\n\n ````\n" - uid: azure.eventhub.aio.EventHubProducerClient.create_batch name: create_batch summary: 'Create an EventDataBatch object with the max size of all content being @@ -322,20 +288,6 @@ methods: return: types: - - examples: - - "Create EventDataBatch object within limited size\n\n\n\n````python\n\n from azure.eventhub\ - \ import EventData\n event_data_batch = await producer.create_batch()\n\ - \ while True:\n try:\n event_data_batch.add(EventData('Message\ - \ inside EventBatchData'))\n except ValueError:\n # The\ - \ EventDataBatch object reaches its max_size.\n # You can send the\ - \ full EventDataBatch object and create a new one here.\n break\n\ - \n ````\n" - uid: azure.eventhub.aio.EventHubProducerClient.flush name: flush summary: 'Buffered mode only. @@ -546,19 +498,6 @@ methods: return: types: - - examples: - - "Create a new instance of the EventHubProducerClient from connection string.\n\n\n\n````python\n\n import os\n from\ - \ azure.eventhub.aio import EventHubProducerClient\n event_hub_connection_str\ - \ = os.environ['EVENT_HUB_CONN_STR']\n eventhub_name = os.environ['EVENT_HUB_NAME']\n\ - \ producer = EventHubProducerClient.from_connection_string(\n conn_str=event_hub_connection_str,\n\ - \ eventhub_name=eventhub_name # EventHub name should be specified if it\ - \ doesn't show up in connection string.\n )\n\n ````\n" - uid: azure.eventhub.aio.EventHubProducerClient.get_buffered_event_count name: get_buffered_event_count summary: "The number of events that are buffered and waiting to be published for\ @@ -720,20 +659,6 @@ methods: sent in non-buffered mode or the events can be enqueued into the buffered in buffered mode.' - examples: - - "Asynchronously sends event data\n\n\n\n````python\n\ - \n async with producer:\n event_data_batch = await producer.create_batch()\n\ - \ while True:\n try:\n event_data_batch.add(EventData('Message\ - \ inside EventBatchData'))\n except ValueError:\n \ - \ # The EventDataBatch object reaches its max_size.\n #\ - \ You can send the full EventDataBatch object and create a new one here.\n \ - \ break\n await producer.send_batch(event_data_batch)\n\ - \n ````\n" - uid: azure.eventhub.aio.EventHubProducerClient.send_event name: send_event summary: "Sends an event data.\nBy default, the method will block until acknowledgement\ diff --git a/docs-ref-autogen/azure-identity/azure.identity.AuthorizationCodeCredential.yml b/docs-ref-autogen/azure-identity/azure.identity.AuthorizationCodeCredential.yml index e1151789ae77..dfb1496fac3b 100644 --- a/docs-ref-autogen/azure-identity/azure.identity.AuthorizationCodeCredential.yml +++ b/docs-ref-autogen/azure-identity/azure.identity.AuthorizationCodeCredential.yml @@ -61,16 +61,6 @@ constructor: acquire tokens for any tenant the application can access.' types: - [] -examples: -- "Create an AuthorizationCodeCredential.\n\n\n\n````python\n\n from azure.identity\ - \ import AuthorizationCodeCredential\n\n credential = AuthorizationCodeCredential(\n\ - \ tenant_id=\"\",\n client_id=\"\",\n authorization_code=\"\ - \",\n redirect_uri=\"\",\n )\n\n ````\n" methods: - uid: azure.identity.AuthorizationCodeCredential.close name: close diff --git a/docs-ref-autogen/azure-identity/azure.identity.AzureCliCredential.yml b/docs-ref-autogen/azure-identity/azure.identity.AzureCliCredential.yml index a124a70ce2ef..aba13071cc18 100644 --- a/docs-ref-autogen/azure-identity/azure.identity.AzureCliCredential.yml +++ b/docs-ref-autogen/azure-identity/azure.identity.AzureCliCredential.yml @@ -32,14 +32,6 @@ constructor: 10 seconds. types: - -examples: -- "Create an AzureCliCredential.\n\n\n\n````python\n\n from azure.identity\ - \ import AzureCliCredential\n\n credential = AzureCliCredential()\n\n ````\n" methods: - uid: azure.identity.AzureCliCredential.close name: close diff --git a/docs-ref-autogen/azure-identity/azure.identity.AzureDeveloperCliCredential.yml b/docs-ref-autogen/azure-identity/azure.identity.AzureDeveloperCliCredential.yml index 16816db23954..ce86700fbf73 100644 --- a/docs-ref-autogen/azure-identity/azure.identity.AzureDeveloperCliCredential.yml +++ b/docs-ref-autogen/azure-identity/azure.identity.AzureDeveloperCliCredential.yml @@ -48,15 +48,6 @@ constructor: to 10 seconds.' types: - -examples: -- "Create an AzureDeveloperCliCredential.\n\n\n\n````python\n\n from azure.identity\ - \ import AzureDeveloperCliCredential\n\n credential = AzureDeveloperCliCredential()\n\ - \n ````\n" methods: - uid: azure.identity.AzureDeveloperCliCredential.close name: close diff --git a/docs-ref-autogen/azure-identity/azure.identity.AzurePowerShellCredential.yml b/docs-ref-autogen/azure-identity/azure.identity.AzurePowerShellCredential.yml index d4adebe78085..3aa75db89406 100644 --- a/docs-ref-autogen/azure-identity/azure.identity.AzurePowerShellCredential.yml +++ b/docs-ref-autogen/azure-identity/azure.identity.AzurePowerShellCredential.yml @@ -32,15 +32,6 @@ constructor: to 10 seconds. types: - -examples: -- "Create an AzurePowerShellCredential.\n\n\n\n````python\n\n from azure.identity\ - \ import AzurePowerShellCredential\n\n credential = AzurePowerShellCredential()\n\ - \n ````\n" methods: - uid: azure.identity.AzurePowerShellCredential.close name: close diff --git a/docs-ref-autogen/azure-identity/azure.identity.CertificateCredential.yml b/docs-ref-autogen/azure-identity/azure.identity.CertificateCredential.yml index 9e82e98c9fcd..82fc8d6b08b9 100644 --- a/docs-ref-autogen/azure-identity/azure.identity.CertificateCredential.yml +++ b/docs-ref-autogen/azure-identity/azure.identity.CertificateCredential.yml @@ -105,17 +105,3 @@ constructor: acquire tokens for any tenant the application can access.' types: - [] -examples: -- "Create a CertificateCredential.\n\n\n\n````python\n\n from azure.identity\ - \ import CertificateCredential\n\n credential = CertificateCredential(\n \ - \ tenant_id=\"\",\n client_id=\"\",\n certificate_path=\"\ - \",\n password=\"\",\n )\n\n # Certificate/private key byte data can also be passed\ - \ directly\n credential = CertificateCredential(\n tenant_id=\"\"\ - ,\n client_id=\"\",\n certificate_data=b\"\",\n\ - \ )\n\n ````\n" diff --git a/docs-ref-autogen/azure-identity/azure.identity.ChainedTokenCredential.yml b/docs-ref-autogen/azure-identity/azure.identity.ChainedTokenCredential.yml index d516fa3458ec..9f2d2102ae93 100644 --- a/docs-ref-autogen/azure-identity/azure.identity.ChainedTokenCredential.yml +++ b/docs-ref-autogen/azure-identity/azure.identity.ChainedTokenCredential.yml @@ -20,17 +20,6 @@ constructor: isRequired: true types: - -examples: -- "Create a ChainedTokenCredential.\n\n\n\n````python\n\n from azure.identity\ - \ import ChainedTokenCredential, EnvironmentCredential, AzureCliCredential\n\n \ - \ credential_chain = (\n # Try EnvironmentCredential first\n EnvironmentCredential(),\n\ - \ # Fallback to Azure CLI if EnvironmentCredential fails\n AzureCliCredential(),\n\ - \ )\n credential = ChainedTokenCredential(*credential_chain)\n\n ````\n" methods: - uid: azure.identity.ChainedTokenCredential.close name: close diff --git a/docs-ref-autogen/azure-identity/azure.identity.ClientAssertionCredential.yml b/docs-ref-autogen/azure-identity/azure.identity.ClientAssertionCredential.yml index e02922cda2f9..1bbd2e693117 100644 --- a/docs-ref-autogen/azure-identity/azure.identity.ClientAssertionCredential.yml +++ b/docs-ref-autogen/azure-identity/azure.identity.ClientAssertionCredential.yml @@ -51,17 +51,6 @@ constructor: acquire tokens for any tenant the application can access.' types: - [] -examples: -- "Create a ClientAssertionCredential.\n\n\n\n````python\n\n from azure.identity\ - \ import ClientAssertionCredential\n\n def get_assertion():\n return \"\ - \"\n\n credential = ClientAssertionCredential(\n tenant_id=\"\ - \",\n client_id=\"\",\n func=get_assertion,\n\ - \ )\n\n ````\n" methods: - uid: azure.identity.ClientAssertionCredential.close name: close diff --git a/docs-ref-autogen/azure-identity/azure.identity.ClientSecretCredential.yml b/docs-ref-autogen/azure-identity/azure.identity.ClientSecretCredential.yml index 6b97b940b963..8ffd8b04b107 100644 --- a/docs-ref-autogen/azure-identity/azure.identity.ClientSecretCredential.yml +++ b/docs-ref-autogen/azure-identity/azure.identity.ClientSecretCredential.yml @@ -71,13 +71,3 @@ constructor: acquire tokens for any tenant the application can access.' types: - [] -examples: -- "Create a ClientSecretCredential.\n\n\n\n````python\n\n from azure.identity\ - \ import ClientSecretCredential\n\n credential = ClientSecretCredential(\n \ - \ tenant_id=\"\",\n client_id=\"\",\n client_secret=\"\ - \",\n )\n\n ````\n" diff --git a/docs-ref-autogen/azure-identity/azure.identity.DefaultAzureCredential.yml b/docs-ref-autogen/azure-identity/azure.identity.DefaultAzureCredential.yml index 59742dcf9938..44db399c9e31 100644 --- a/docs-ref-autogen/azure-identity/azure.identity.DefaultAzureCredential.yml +++ b/docs-ref-autogen/azure-identity/azure.identity.DefaultAzureCredential.yml @@ -145,15 +145,6 @@ constructor: to **10** seconds.' types: - -examples: -- "Create a DefaultAzureCredential.\n\n\n\n````python\n\n from azure.identity\ - \ import DefaultAzureCredential\n\n credential = DefaultAzureCredential()\n\n\ - \ ````\n" methods: - uid: azure.identity.DefaultAzureCredential.get_token name: get_token diff --git a/docs-ref-autogen/azure-identity/azure.identity.DeviceCodeCredential.yml b/docs-ref-autogen/azure-identity/azure.identity.DeviceCodeCredential.yml index 435b70c7019f..c868aadf30cd 100644 --- a/docs-ref-autogen/azure-identity/azure.identity.DeviceCodeCredential.yml +++ b/docs-ref-autogen/azure-identity/azure.identity.DeviceCodeCredential.yml @@ -108,11 +108,3 @@ constructor: trustworthy.' types: - -examples: -- "Create a DeviceCodeCredential.\n\n\n\n````python\n\n from azure.identity\ - \ import DeviceCodeCredential\n\n credential = DeviceCodeCredential()\n\n ````\n" diff --git a/docs-ref-autogen/azure-identity/azure.identity.EnvironmentCredential.yml b/docs-ref-autogen/azure-identity/azure.identity.EnvironmentCredential.yml index c5ea150f1cb8..f149c5e9495f 100644 --- a/docs-ref-autogen/azure-identity/azure.identity.EnvironmentCredential.yml +++ b/docs-ref-autogen/azure-identity/azure.identity.EnvironmentCredential.yml @@ -32,15 +32,6 @@ summary: "A credential configured by environment variables.\n\nThis credential i \ for Azure Public Cloud, which is the default when no value is given." constructor: syntax: 'EnvironmentCredential(**kwargs: Any)' -examples: -- "Create an EnvironmentCredential.\n\n\n\n````python\n\n from azure.identity\ - \ import EnvironmentCredential\n\n credential = EnvironmentCredential()\n\n \ - \ ````\n" methods: - uid: azure.identity.EnvironmentCredential.close name: close diff --git a/docs-ref-autogen/azure-identity/azure.identity.InteractiveBrowserCredential.yml b/docs-ref-autogen/azure-identity/azure.identity.InteractiveBrowserCredential.yml index 7214eb357de7..12c7a2e8a529 100644 --- a/docs-ref-autogen/azure-identity/azure.identity.InteractiveBrowserCredential.yml +++ b/docs-ref-autogen/azure-identity/azure.identity.InteractiveBrowserCredential.yml @@ -102,12 +102,3 @@ constructor: trustworthy.' types: - -examples: -- "Create an InteractiveBrowserCredential.\n\n\n\n````python\n\n from azure.identity\ - \ import InteractiveBrowserCredential\n\n credential = InteractiveBrowserCredential(\n\ - \ client_id=\"\",\n )\n\n ````\n" diff --git a/docs-ref-autogen/azure-identity/azure.identity.ManagedIdentityCredential.yml b/docs-ref-autogen/azure-identity/azure.identity.ManagedIdentityCredential.yml index 077528e65aab..6c52fde2a80a 100644 --- a/docs-ref-autogen/azure-identity/azure.identity.ManagedIdentityCredential.yml +++ b/docs-ref-autogen/azure-identity/azure.identity.ManagedIdentityCredential.yml @@ -36,16 +36,6 @@ constructor: learn what values it expects.' types: - [, ] -examples: -- "Create a ManagedIdentityCredential.\n\n\n\n````python\n\n from azure.identity\ - \ import ManagedIdentityCredential\n\n credential = ManagedIdentityCredential()\n\ - \n # Can also specify a client ID of a user-assigned managed identity\n credential\ - \ = ManagedIdentityCredential(\n client_id=\"\",\n )\n\n ````\n" methods: - uid: azure.identity.ManagedIdentityCredential.close name: close diff --git a/docs-ref-autogen/azure-identity/azure.identity.OnBehalfOfCredential.yml b/docs-ref-autogen/azure-identity/azure.identity.OnBehalfOfCredential.yml index a0bd11c94544..56cda98fd2f2 100644 --- a/docs-ref-autogen/azure-identity/azure.identity.OnBehalfOfCredential.yml +++ b/docs-ref-autogen/azure-identity/azure.identity.OnBehalfOfCredential.yml @@ -105,13 +105,3 @@ constructor: acquire tokens for any tenant the application can access.' types: - [] -examples: -- "Create an OnBehalfOfCredential.\n\n\n\n````python\n\n from azure.identity\ - \ import OnBehalfOfCredential\n\n credential = OnBehalfOfCredential(\n tenant_id=\"\ - \",\n client_id=\"\",\n client_secret=\"\"\ - ,\n user_assertion=\"\",\n )\n\n ````\n" diff --git a/docs-ref-autogen/azure-identity/azure.identity.TokenCachePersistenceOptions.yml b/docs-ref-autogen/azure-identity/azure.identity.TokenCachePersistenceOptions.yml index dd64143f927b..f024823a33b9 100644 --- a/docs-ref-autogen/azure-identity/azure.identity.TokenCachePersistenceOptions.yml +++ b/docs-ref-autogen/azure-identity/azure.identity.TokenCachePersistenceOptions.yml @@ -60,15 +60,3 @@ constructor: always try to encrypt its data.' types: - -examples: -- "Configuring a credential for persistent caching\n\n\n\n````python\n\n cache_options\ - \ = TokenCachePersistenceOptions()\n credential = InteractiveBrowserCredential(cache_persistence_options=cache_options)\n\ - \n # specify a cache name to isolate the cache from other applications\n TokenCachePersistenceOptions(name=\"\ - my_application\")\n\n # configure the cache to fall back to unencrypted storage\ - \ when encryption isn't available\n TokenCachePersistenceOptions(allow_unencrypted_storage=True)\n\ - \n ````\n" diff --git a/docs-ref-autogen/azure-identity/azure.identity.UsernamePasswordCredential.yml b/docs-ref-autogen/azure-identity/azure.identity.UsernamePasswordCredential.yml index 1699d76d91c3..17d1a3d9d194 100644 --- a/docs-ref-autogen/azure-identity/azure.identity.UsernamePasswordCredential.yml +++ b/docs-ref-autogen/azure-identity/azure.identity.UsernamePasswordCredential.yml @@ -102,13 +102,3 @@ constructor: acquire tokens for any tenant the application can access.' types: - [] -examples: -- "Create a UsernamePasswordCredential.\n\n\n\n````python\n\n from azure.identity\ - \ import UsernamePasswordCredential\n\n credential = UsernamePasswordCredential(\n\ - \ client_id=\"\",\n username=\"\",\n password=\"\ - \",\n )\n\n ````\n" diff --git a/docs-ref-autogen/azure-identity/azure.identity.WorkloadIdentityCredential.yml b/docs-ref-autogen/azure-identity/azure.identity.WorkloadIdentityCredential.yml index ee3e619e3eab..052f338758c1 100644 --- a/docs-ref-autogen/azure-identity/azure.identity.WorkloadIdentityCredential.yml +++ b/docs-ref-autogen/azure-identity/azure.identity.WorkloadIdentityCredential.yml @@ -63,16 +63,3 @@ constructor: the identity.' types: - -examples: -- "Create a WorkloadIdentityCredential.\n\n\n\n````python\n\n from azure.identity\ - \ import WorkloadIdentityCredential\n\n credential = WorkloadIdentityCredential(\n\ - \ tenant_id=\"\",\n client_id=\"\",\n token_file_path=\"\ - \",\n )\n\n # Parameters can be omitted if the following environment\ - \ variables are set:\n # - AZURE_TENANT_ID\n # - AZURE_CLIENT_ID\n # \ - \ - AZURE_FEDERATED_TOKEN_FILE\n credential = WorkloadIdentityCredential()\n\n\ - \ ````\n" diff --git a/docs-ref-autogen/azure-identity/azure.identity.aio.AuthorizationCodeCredential.yml b/docs-ref-autogen/azure-identity/azure.identity.aio.AuthorizationCodeCredential.yml index ad4a06934326..d32c95e6ee5f 100644 --- a/docs-ref-autogen/azure-identity/azure.identity.aio.AuthorizationCodeCredential.yml +++ b/docs-ref-autogen/azure-identity/azure.identity.aio.AuthorizationCodeCredential.yml @@ -62,16 +62,6 @@ constructor: acquire tokens for any tenant the application can access.' types: - [] -examples: -- "Create an AuthorizationCodeCredential.\n\n\n\n````python\n\n from azure.identity.aio\ - \ import AuthorizationCodeCredential\n\n credential = AuthorizationCodeCredential(\n\ - \ tenant_id=\"\",\n client_id=\"\",\n authorization_code=\"\ - \",\n redirect_uri=\"\",\n )\n\n ````\n" methods: - uid: azure.identity.aio.AuthorizationCodeCredential.close name: close diff --git a/docs-ref-autogen/azure-identity/azure.identity.aio.AzureCliCredential.yml b/docs-ref-autogen/azure-identity/azure.identity.aio.AzureCliCredential.yml index 5dd314ab467d..9c7c19daf7fb 100644 --- a/docs-ref-autogen/azure-identity/azure.identity.aio.AzureCliCredential.yml +++ b/docs-ref-autogen/azure-identity/azure.identity.aio.AzureCliCredential.yml @@ -32,14 +32,6 @@ constructor: 10 seconds. types: - -examples: -- "Create an AzureCliCredential.\n\n\n\n````python\n\n from azure.identity.aio\ - \ import AzureCliCredential\n\n credential = AzureCliCredential()\n\n ````\n" methods: - uid: azure.identity.aio.AzureCliCredential.close name: close diff --git a/docs-ref-autogen/azure-identity/azure.identity.aio.AzureDeveloperCliCredential.yml b/docs-ref-autogen/azure-identity/azure.identity.aio.AzureDeveloperCliCredential.yml index e6bcebbbc5b1..66dbd2fd45f4 100644 --- a/docs-ref-autogen/azure-identity/azure.identity.aio.AzureDeveloperCliCredential.yml +++ b/docs-ref-autogen/azure-identity/azure.identity.aio.AzureDeveloperCliCredential.yml @@ -48,15 +48,6 @@ constructor: to 10 seconds.' types: - -examples: -- "Create an AzureDeveloperCliCredential.\n\n\n\n````python\n\n from azure.identity.aio\ - \ import AzureDeveloperCliCredential\n\n credential = AzureDeveloperCliCredential()\n\ - \n ````\n" methods: - uid: azure.identity.aio.AzureDeveloperCliCredential.close name: close diff --git a/docs-ref-autogen/azure-identity/azure.identity.aio.AzurePowerShellCredential.yml b/docs-ref-autogen/azure-identity/azure.identity.aio.AzurePowerShellCredential.yml index 0b6c416ef7c6..66ecf6ecf5ea 100644 --- a/docs-ref-autogen/azure-identity/azure.identity.aio.AzurePowerShellCredential.yml +++ b/docs-ref-autogen/azure-identity/azure.identity.aio.AzurePowerShellCredential.yml @@ -32,15 +32,6 @@ constructor: to 10 seconds. types: - -examples: -- "Create an AzurePowerShellCredential.\n\n\n\n````python\n\n from azure.identity.aio\ - \ import AzurePowerShellCredential\n\n credential = AzurePowerShellCredential()\n\ - \n ````\n" methods: - uid: azure.identity.aio.AzurePowerShellCredential.close name: close diff --git a/docs-ref-autogen/azure-identity/azure.identity.aio.CertificateCredential.yml b/docs-ref-autogen/azure-identity/azure.identity.aio.CertificateCredential.yml index 043b1a67b916..0ca90c70a4d6 100644 --- a/docs-ref-autogen/azure-identity/azure.identity.aio.CertificateCredential.yml +++ b/docs-ref-autogen/azure-identity/azure.identity.aio.CertificateCredential.yml @@ -74,20 +74,6 @@ constructor: acquire tokens for any tenant the application can access.' types: - [] -examples: -- "Create a CertificateCredential.\n\n\n\n````python\n\n from azure.identity.aio\ - \ import CertificateCredential\n\n credential = CertificateCredential(\n \ - \ tenant_id=\"\",\n client_id=\"\",\n certificate_path=\"\ - \",\n password=\"\",\n )\n\n # Certificate/private key byte data can also be passed\ - \ directly\n credential = CertificateCredential(\n tenant_id=\"\"\ - ,\n client_id=\"\",\n certificate_data=b\"\",\n\ - \ )\n\n ````\n" methods: - uid: azure.identity.aio.CertificateCredential.close name: close diff --git a/docs-ref-autogen/azure-identity/azure.identity.aio.ChainedTokenCredential.yml b/docs-ref-autogen/azure-identity/azure.identity.aio.ChainedTokenCredential.yml index ea28aaf04448..15f5f4b57af2 100644 --- a/docs-ref-autogen/azure-identity/azure.identity.aio.ChainedTokenCredential.yml +++ b/docs-ref-autogen/azure-identity/azure.identity.aio.ChainedTokenCredential.yml @@ -20,17 +20,6 @@ constructor: isRequired: true types: - -examples: -- "Create a ChainedTokenCredential.\n\n\n\n````python\n\n from azure.identity.aio\ - \ import ChainedTokenCredential, EnvironmentCredential, AzureCliCredential\n\n \ - \ credential_chain = (\n # Try EnvironmentCredential first\n EnvironmentCredential(),\n\ - \ # Fallback to Azure CLI if EnvironmentCredential fails\n AzureCliCredential(),\n\ - \ )\n credential = ChainedTokenCredential(*credential_chain)\n\n ````\n" methods: - uid: azure.identity.aio.ChainedTokenCredential.close name: close diff --git a/docs-ref-autogen/azure-identity/azure.identity.aio.ClientAssertionCredential.yml b/docs-ref-autogen/azure-identity/azure.identity.aio.ClientAssertionCredential.yml index 2870d92f0727..b8aa522c5fcb 100644 --- a/docs-ref-autogen/azure-identity/azure.identity.aio.ClientAssertionCredential.yml +++ b/docs-ref-autogen/azure-identity/azure.identity.aio.ClientAssertionCredential.yml @@ -52,17 +52,6 @@ constructor: acquire tokens for any tenant the application can access.' types: - [] -examples: -- "Create a ClientAssertionCredential.\n\n\n\n````python\n\n from azure.identity.aio\ - \ import ClientAssertionCredential\n\n def get_assertion():\n return \"\ - \"\n\n credential = ClientAssertionCredential(\n tenant_id=\"\ - \",\n client_id=\"\",\n func=get_assertion,\n\ - \ )\n\n ````\n" methods: - uid: azure.identity.aio.ClientAssertionCredential.close name: close diff --git a/docs-ref-autogen/azure-identity/azure.identity.aio.ClientSecretCredential.yml b/docs-ref-autogen/azure-identity/azure.identity.aio.ClientSecretCredential.yml index 1ca8cd249436..39825e1273c4 100644 --- a/docs-ref-autogen/azure-identity/azure.identity.aio.ClientSecretCredential.yml +++ b/docs-ref-autogen/azure-identity/azure.identity.aio.ClientSecretCredential.yml @@ -51,16 +51,6 @@ constructor: acquire tokens for any tenant the application can access.' types: - [] -examples: -- "Create a ClientSecretCredential.\n\n\n\n````python\n\n from azure.identity.aio\ - \ import ClientSecretCredential\n\n credential = ClientSecretCredential(\n \ - \ tenant_id=\"\",\n client_id=\"\",\n client_secret=\"\ - \",\n )\n\n ````\n" methods: - uid: azure.identity.aio.ClientSecretCredential.close name: close diff --git a/docs-ref-autogen/azure-identity/azure.identity.aio.DefaultAzureCredential.yml b/docs-ref-autogen/azure-identity/azure.identity.aio.DefaultAzureCredential.yml index bed07f5118e4..471ad23bbd6e 100644 --- a/docs-ref-autogen/azure-identity/azure.identity.aio.DefaultAzureCredential.yml +++ b/docs-ref-autogen/azure-identity/azure.identity.aio.DefaultAzureCredential.yml @@ -124,15 +124,6 @@ constructor: to **10** seconds.' types: - -examples: -- "Create a DefaultAzureCredential.\n\n\n\n````python\n\n from azure.identity.aio\ - \ import DefaultAzureCredential\n\n credential = DefaultAzureCredential()\n\n\ - \ ````\n" methods: - uid: azure.identity.aio.DefaultAzureCredential.get_token name: get_token diff --git a/docs-ref-autogen/azure-identity/azure.identity.aio.EnvironmentCredential.yml b/docs-ref-autogen/azure-identity/azure.identity.aio.EnvironmentCredential.yml index fc98b6c38ae7..fd4ca105fcdb 100644 --- a/docs-ref-autogen/azure-identity/azure.identity.aio.EnvironmentCredential.yml +++ b/docs-ref-autogen/azure-identity/azure.identity.aio.EnvironmentCredential.yml @@ -24,15 +24,6 @@ summary: "A credential configured by environment variables.\n\nThis credential i , the authority for Azure Public Cloud, which is the default when no value is given." constructor: syntax: 'EnvironmentCredential(**kwargs: Any)' -examples: -- "Create an EnvironmentCredential.\n\n\n\n````python\n\n from azure.identity.aio\ - \ import EnvironmentCredential\n\n credential = EnvironmentCredential()\n\n \ - \ ````\n" methods: - uid: azure.identity.aio.EnvironmentCredential.close name: close diff --git a/docs-ref-autogen/azure-identity/azure.identity.aio.ManagedIdentityCredential.yml b/docs-ref-autogen/azure-identity/azure.identity.aio.ManagedIdentityCredential.yml index 9130c67771ba..5c9e228be6f8 100644 --- a/docs-ref-autogen/azure-identity/azure.identity.aio.ManagedIdentityCredential.yml +++ b/docs-ref-autogen/azure-identity/azure.identity.aio.ManagedIdentityCredential.yml @@ -36,16 +36,6 @@ constructor: learn what values it expects.' types: - [, ] -examples: -- "Create a ManagedIdentityCredential.\n\n\n\n````python\n\n from azure.identity.aio\ - \ import ManagedIdentityCredential\n\n credential = ManagedIdentityCredential()\n\ - \n # Can also specify a client ID of a user-assigned managed identity\n credential\ - \ = ManagedIdentityCredential(\n client_id=\"\",\n )\n\n ````\n" methods: - uid: azure.identity.aio.ManagedIdentityCredential.close name: close diff --git a/docs-ref-autogen/azure-identity/azure.identity.aio.OnBehalfOfCredential.yml b/docs-ref-autogen/azure-identity/azure.identity.aio.OnBehalfOfCredential.yml index 205c0107371b..b907eaf7c71e 100644 --- a/docs-ref-autogen/azure-identity/azure.identity.aio.OnBehalfOfCredential.yml +++ b/docs-ref-autogen/azure-identity/azure.identity.aio.OnBehalfOfCredential.yml @@ -86,16 +86,6 @@ constructor: acquire tokens for any tenant the application can access.' types: - [] -examples: -- "Create an OnBehalfOfCredential.\n\n\n\n````python\n\n from azure.identity.aio\ - \ import OnBehalfOfCredential\n\n credential = OnBehalfOfCredential(\n tenant_id=\"\ - \",\n client_id=\"\",\n client_secret=\"\"\ - ,\n user_assertion=\"\",\n )\n\n ````\n" methods: - uid: azure.identity.aio.OnBehalfOfCredential.close name: close diff --git a/docs-ref-autogen/azure-identity/azure.identity.aio.WorkloadIdentityCredential.yml b/docs-ref-autogen/azure-identity/azure.identity.aio.WorkloadIdentityCredential.yml index 08c5d681fa74..59ac2d603a57 100644 --- a/docs-ref-autogen/azure-identity/azure.identity.aio.WorkloadIdentityCredential.yml +++ b/docs-ref-autogen/azure-identity/azure.identity.aio.WorkloadIdentityCredential.yml @@ -63,16 +63,3 @@ constructor: the identity.' types: - -examples: -- "Create a WorkloadIdentityCredential.\n\n\n\n````python\n\n from azure.identity.aio\ - \ import WorkloadIdentityCredential\n\n credential = WorkloadIdentityCredential(\n\ - \ tenant_id=\"\",\n client_id=\"\",\n token_file_path=\"\ - \",\n )\n\n # Parameters can be omitted if the following environment\ - \ variables are set:\n # - AZURE_TENANT_ID\n # - AZURE_CLIENT_ID\n # \ - \ - AZURE_FEDERATED_TOKEN_FILE\n credential = WorkloadIdentityCredential()\n\n\ - \ ````\n" diff --git a/docs-ref-autogen/azure-keyvault-administration/azure.keyvault.administration.KeyVaultBackupClient.yml b/docs-ref-autogen/azure-keyvault-administration/azure.keyvault.administration.KeyVaultBackupClient.yml index d1587fb30a81..e2b6a39081e2 100644 --- a/docs-ref-autogen/azure-keyvault-administration/azure.keyvault.administration.KeyVaultBackupClient.yml +++ b/docs-ref-autogen/azure-keyvault-administration/azure.keyvault.administration.KeyVaultBackupClient.yml @@ -71,17 +71,6 @@ methods: operation to complete and get a .' types: - [] - examples: - - "Create a vault backup\n\n\n\n````python\n\ - \n # begin a vault backup\n backup_poller = backup_client.begin_backup(container_uri,\ - \ sas_token)\n\n # check if the backup completed\n done = backup_poller.done()\n\ - \n # block until the backup completes\n # result() returns an object with\ - \ a URL of the backup\n backup_operation = backup_poller.result()\n\n ````\n" - uid: azure.keyvault.administration.KeyVaultBackupClient.begin_restore name: begin_restore summary: 'Restore a Key Vault backup. @@ -120,23 +109,3 @@ methods: return: types: - - examples: - - "Restore a vault backup\n\n\n\n````python\n\ - \n # begin a full vault restore\n restore_poller = backup_client.begin_restore(folder_url,\ - \ sas_token)\n\n # check if the restore completed\n done = restore_poller.done()\n\ - \n # wait for the restore to complete\n restore_poller.wait()\n\n ````\n\ - \nRestore a single key\n\n\n\n````python\n\ - \n # begin a restore of a single key from a backed up vault\n restore_poller\ - \ = backup_client.begin_restore(folder_url, sas_token, key_name=key_name)\n\n\ - \ # check if the restore completed\n done = restore_poller.done()\n\n #\ - \ wait for the restore to complete\n restore_poller.wait()\n\n ````\n" diff --git a/docs-ref-autogen/azure-keyvault-administration/azure.keyvault.administration.aio.KeyVaultBackupClient.yml b/docs-ref-autogen/azure-keyvault-administration/azure.keyvault.administration.aio.KeyVaultBackupClient.yml index 4a73e300f942..0d83f76ba258 100644 --- a/docs-ref-autogen/azure-keyvault-administration/azure.keyvault.administration.aio.KeyVaultBackupClient.yml +++ b/docs-ref-autogen/azure-keyvault-administration/azure.keyvault.administration.aio.KeyVaultBackupClient.yml @@ -70,18 +70,6 @@ methods: description: An AsyncLROPoller. Call *result()* on this object to get a . types: - [] - examples: - - "Create a vault backup\n\n\n\n````python\n\ - \n # begin a vault backup\n backup_poller = await backup_client.begin_backup(container_uri,\ - \ sas_token)\n\n # check if the backup completed\n done = backup_poller.done()\n\ - \n # yield until the backup completes\n # result() returns an object with\ - \ a URL of the backup\n backup_operation = await backup_poller.result()\n\n\ - \ ````\n" - uid: azure.keyvault.administration.aio.KeyVaultBackupClient.begin_restore name: begin_restore summary: 'Restore a Key Vault backup. @@ -123,23 +111,3 @@ methods: return: types: - - examples: - - "Restore a vault backup\n\n\n\n````python\n\ - \n # begin a full vault restore\n restore_poller = await backup_client.begin_restore(folder_url,\ - \ sas_token)\n\n # check if the restore completed\n done = restore_poller.done()\n\ - \n # wait for the restore to complete\n await restore_poller.wait()\n\n \ - \ ````\n\nRestore a single key\n\n\n\n````python\n\ - \n # begin a restore of a single key from a backed up vault\n restore_poller\ - \ = await backup_client.begin_restore(folder_url, sas_token, key_name=key_name)\n\ - \n # check if the restore completed\n done = restore_poller.done()\n\n #\ - \ wait for the restore to complete\n await restore_poller.wait()\n\n ````\n" diff --git a/docs-ref-autogen/azure-keyvault-certificates/azure.keyvault.certificates.CertificateClient.yml b/docs-ref-autogen/azure-keyvault-certificates/azure.keyvault.certificates.CertificateClient.yml index bf5f6cbf1db8..c979f866b90e 100644 --- a/docs-ref-autogen/azure-keyvault-certificates/azure.keyvault.certificates.CertificateClient.yml +++ b/docs-ref-autogen/azure-keyvault-certificates/azure.keyvault.certificates.CertificateClient.yml @@ -39,17 +39,6 @@ constructor: Vault domain. Defaults to True.' types: - -examples: -- "Create a new `CertificateClient`\n\n\n\n````python\n\n from azure.identity\ - \ import DefaultAzureCredential\n from azure.keyvault.certificates import CertificateClient\n\ - \n # Create a CertificateClient using default Azure credentials\n credential\ - \ = DefaultAzureCredential()\n certificate_client = CertificateClient(vault_url=vault_url,\ - \ credential=credential)\n\n ````\n" methods: - uid: azure.keyvault.certificates.CertificateClient.backup_certificate name: backup_certificate @@ -82,16 +71,6 @@ methods: description: if the certificate doesn't exist, - type: azure.core.exceptions.HttpResponseError description: for other errors - examples: - - "Get a certificate backup\n\n\n\n````python\n\ - \n # backup certificate\n certificate_backup = certificate_client.backup_certificate(cert_name)\n\ - \n # returns the raw bytes of the backed up certificate\n print(certificate_backup)\n\ - \n ````\n" - uid: azure.keyvault.certificates.CertificateClient.begin_create_certificate name: begin_create_certificate summary: "Creates a new certificate.\n\nIf this is the first version, the certificate\ @@ -136,28 +115,6 @@ methods: description: if the certificate policy is invalid, - type: azure.core.exceptions.HttpResponseError description: for other errors. - examples: - - "Create a certificate\n\n\n\n````python\n\ - \n from azure.keyvault.certificates import (CertificateContentType,\n \ - \ CertificatePolicy,\n \ - \ WellKnownIssuerNames)\n\n # specify the certificate\ - \ policy\n cert_policy = CertificatePolicy(\n issuer_name=WellKnownIssuerNames.self,\n\ - \ subject=\"CN=*.microsoft.com\",\n san_dns_names=[\"sdk.azure-int.net\"\ - ],\n exportable=True,\n key_type=\"RSA\",\n key_size=2048,\n\ - \ reuse_key=False,\n content_type=CertificateContentType.pkcs12,\n\ - \ validity_in_months=24,\n )\n\n # create a certificate with optional\ - \ arguments, returns a long running operation poller\n certificate_operation_poller\ - \ = certificate_client.begin_create_certificate(\n certificate_name=cert_name,\ - \ policy=cert_policy\n )\n\n # Here we are waiting for the certificate creation\ - \ operation to be completed\n certificate = certificate_operation_poller.result()\n\ - \n # You can get the final status of the certificate operation poller using\ - \ .result()\n print(certificate_operation_poller.result())\n\n print(certificate.id)\n\ - \ print(certificate.name)\n print(certificate.policy.issuer_name)\n\n ````\n" - uid: azure.keyvault.certificates.CertificateClient.begin_delete_certificate name: begin_delete_certificate summary: 'Delete all versions of a certificate. Requires certificates/delete permission. @@ -198,18 +155,6 @@ methods: description: if the certificate doesn't exist, - type: azure.core.exceptions.HttpResponseError description: for other errors - examples: - - "Delete a certificate\n\n\n\n````python\n\ - \n # delete a certificate\n deleted_certificate = certificate_client.begin_delete_certificate(certificate.name).result()\n\ - \n print(deleted_certificate.name)\n\n # if the vault has soft-delete enabled,\ - \ the certificate's deleted date,\n # scheduled purge date, and recovery id\ - \ are available\n print(deleted_certificate.deleted_on)\n print(deleted_certificate.scheduled_purge_date)\n\ - \ print(deleted_certificate.recovery_id)\n\n ````\n" - uid: azure.keyvault.certificates.CertificateClient.begin_recover_deleted_certificate name: begin_recover_deleted_certificate summary: 'Recover a deleted certificate to its latest version. Possible only in @@ -249,17 +194,6 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Recover a deleted certificate\n\n\n\n````python\n\ - \n # recover a deleted certificate to its latest version (requires soft-delete\ - \ enabled for the vault)\n recovered_certificate = certificate_client.begin_recover_deleted_certificate(cert_name).result()\n\ - \n print(recovered_certificate.id)\n print(recovered_certificate.name)\n\n\ - \ ````\n" - uid: azure.keyvault.certificates.CertificateClient.cancel_certificate_operation name: cancel_certificate_operation summary: Cancels an in-progress certificate operation. Requires the certificates/update @@ -321,23 +255,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Create an issuer\n\ - \n\n\n````python\n\ - \n from azure.keyvault.certificates import AdministratorContact\n\n # First\ - \ we specify the AdministratorContact for a issuer.\n admin_contacts = [\n \ - \ AdministratorContact(first_name=\"John\", last_name=\"Doe\", email=\"admin@microsoft.com\"\ - , phone=\"4255555555\")\n ]\n\n issuer = certificate_client.create_issuer(\n\ - \ issuer_name=\"issuer1\",\n provider=\"Test\",\n account_id=\"\ - keyvaultuser\",\n admin_contacts=admin_contacts,\n enabled=True,\n\ - \ )\n\n print(issuer.name)\n print(issuer.provider)\n print(issuer.account_id)\n\ - \n for contact in issuer.admin_contacts:\n print(contact.first_name)\n\ - \ print(contact.last_name)\n print(contact.email)\n print(contact.phone)\n\ - \n ````\n" - uid: azure.keyvault.certificates.CertificateClient.delete_certificate_operation name: delete_certificate_operation summary: 'Deletes and stops the creation operation for a specific certificate. @@ -368,16 +285,6 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Delete contacts\n\ - \n\n\n````python\n\ - \n deleted_contacts = certificate_client.delete_contacts()\n\n for deleted_contact\ - \ in deleted_contacts:\n print(deleted_contact.name)\n print(deleted_contact.email)\n\ - \ print(deleted_contact.phone)\n\n ````\n" - uid: azure.keyvault.certificates.CertificateClient.delete_issuer name: delete_issuer summary: 'Deletes the specified certificate issuer. @@ -397,18 +304,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Delete an issuer\n\ - \n\n\n````python\n\ - \n deleted_issuer = certificate_client.delete_issuer(\"issuer1\")\n\n print(deleted_issuer.name)\n\ - \ print(deleted_issuer.provider)\n print(deleted_issuer.account_id)\n\n \ - \ for contact in deleted_issuer.admin_contacts:\n print(contact.first_name)\n\ - \ print(contact.last_name)\n print(contact.email)\n print(contact.phone)\n\ - \n ````\n" - uid: azure.keyvault.certificates.CertificateClient.get_certificate name: get_certificate summary: 'Gets a certificate with its management policy attached. Requires certificates/get @@ -435,16 +330,6 @@ methods: description: if the certificate doesn't exist, - type: azure.core.exceptions.HttpResponseError description: for other errors - examples: - - "Get a certificate\n\ - \n\n\n````python\n\ - \n # get the certificate\n certificate = certificate_client.get_certificate(cert_name)\n\ - \n print(certificate.id)\n print(certificate.name)\n print(certificate.policy.issuer_name)\n\ - \n ````\n" - uid: azure.keyvault.certificates.CertificateClient.get_certificate_operation name: get_certificate_operation summary: Gets the creation operation of a certificate. Requires the certificates/get @@ -516,15 +401,6 @@ methods: description: if the certificate doesn't exist, - type: azure.core.exceptions.HttpResponseError description: for other errors - examples: - - "Get a certificate with a specific version\n\n\n\n````python\n\ - \n certificate = certificate_client.get_certificate_version(cert_name, version)\n\ - \n print(certificate.id)\n print(certificate.properties.version)\n\n ````\n" - uid: azure.keyvault.certificates.CertificateClient.get_contacts name: get_contacts summary: Gets the certificate contacts for the key vault. Requires the certificates/managecontacts @@ -536,16 +412,6 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Get contacts\n\n\ - \n\n````python\n\ - \n contacts = certificate_client.get_contacts()\n\n # Loop through the certificate\ - \ contacts for this key vault.\n for contact in contacts:\n print(contact.name)\n\ - \ print(contact.email)\n print(contact.phone)\n\n ````\n" - uid: azure.keyvault.certificates.CertificateClient.get_deleted_certificate name: get_deleted_certificate summary: 'Get a deleted certificate. Possible only in a vault with soft-delete enabled. @@ -572,19 +438,6 @@ methods: description: if the certificate doesn't exist, - type: azure.core.exceptions.HttpResponseError description: for other errors - examples: - - "Get a deleted certificate\n\n\n\n````python\n\ - \n # get a deleted certificate (requires soft-delete enabled for the vault)\n\ - \ deleted_certificate = certificate_client.get_deleted_certificate(cert_name)\n\ - \ print(deleted_certificate.name)\n\n # if the vault has soft-delete enabled,\ - \ the certificate's deleted date,\n # scheduled purge date, and recovery id\ - \ are available\n print(deleted_certificate.deleted_on)\n print(deleted_certificate.scheduled_purge_date)\n\ - \ print(deleted_certificate.recovery_id)\n\n ````\n" - uid: azure.keyvault.certificates.CertificateClient.get_issuer name: get_issuer summary: Gets the specified certificate issuer. Requires certificates/manageissuers/getissuers @@ -605,17 +458,6 @@ methods: description: if the issuer doesn't exist, - type: azure.core.exceptions.HttpResponseError description: for other errors - examples: - - "Get an issuer\n\ - \n\n\n````python\n\ - \n issuer = certificate_client.get_issuer(\"issuer1\")\n\n print(issuer.name)\n\ - \ print(issuer.provider)\n print(issuer.account_id)\n\n for contact in issuer.admin_contacts:\n\ - \ print(contact.first_name)\n print(contact.last_name)\n print(contact.email)\n\ - \ print(contact.phone)\n\n ````\n" - uid: azure.keyvault.certificates.CertificateClient.import_certificate name: import_certificate summary: 'Import a certificate created externally. Requires certificates/import @@ -703,19 +545,6 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "List all the deleted certificates\n\n\n\n````python\n\ - \n # get an iterator of deleted certificates (requires soft-delete enabled for\ - \ the vault)\n deleted_certificates = certificate_client.list_deleted_certificates()\n\ - \n for certificate in deleted_certificates:\n print(certificate.id)\n\ - \ print(certificate.name)\n print(certificate.deleted_on)\n \ - \ print(certificate.scheduled_purge_date)\n print(certificate.deleted_on)\n\ - \n ````\n" - uid: azure.keyvault.certificates.CertificateClient.list_properties_of_certificate_versions name: list_properties_of_certificate_versions summary: 'List the identifiers and properties of a certificate''s versions. @@ -736,18 +565,6 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "List all versions of a certificate\n\n\n\n````python\n\ - \n # get an iterator of a certificate's versions\n certificate_versions =\ - \ certificate_client.list_properties_of_certificate_versions(certificate_name)\n\ - \n for certificate in certificate_versions:\n print(certificate.id)\n\ - \ print(certificate.updated_on)\n print(certificate.version)\n\n \ - \ ````\n" - uid: azure.keyvault.certificates.CertificateClient.list_properties_of_certificates name: list_properties_of_certificates summary: 'List identifiers and properties of all certificates in the vault. @@ -769,17 +586,6 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "List all certificates\n\n\n\n````python\n\ - \n # get an iterator of certificates\n certificates = certificate_client.list_properties_of_certificates()\n\ - \n for certificate in certificates:\n print(certificate.id)\n print(certificate.created_on)\n\ - \ print(certificate.name)\n print(certificate.updated_on)\n \ - \ print(certificate.enabled)\n\n ````\n" - uid: azure.keyvault.certificates.CertificateClient.list_properties_of_issuers name: list_properties_of_issuers summary: 'Lists properties of the certificate issuers for the key vault. @@ -793,16 +599,6 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "List issuers of a vault\n\n\n\n````python\n\ - \n issuers = certificate_client.list_properties_of_issuers()\n\n for issuer\ - \ in issuers:\n print(issuer.name)\n print(issuer.provider)\n\n \ - \ ````\n" - uid: azure.keyvault.certificates.CertificateClient.merge_certificate name: merge_certificate summary: 'Merges a certificate or a certificate chain with a key pair existing on @@ -904,16 +700,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Restore a certificate backup\n\n\n\n````python\n\ - \n # restore a certificate backup\n restored_certificate = certificate_client.restore_certificate_backup(certificate_backup)\n\ - \n print(restored_certificate.id)\n print(restored_certificate.name)\n print(restored_certificate.properties.version)\n\ - \n ````\n" - uid: azure.keyvault.certificates.CertificateClient.set_contacts name: set_contacts summary: Sets the certificate contacts for the key vault. Requires certificates/managecontacts @@ -931,20 +717,6 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Create contacts\n\ - \n\n\n````python\n\ - \n from azure.keyvault.certificates import CertificateContact\n\n # Create\ - \ a list of the contacts that you want to set for this key vault.\n contact_list\ - \ = [\n CertificateContact(email=\"admin@contoso.com\", name=\"John Doe\"\ - , phone=\"1111111111\"),\n CertificateContact(email=\"admin2@contoso.com\"\ - , name=\"John Doe2\", phone=\"2222222222\"),\n ]\n\n contacts = certificate_client.set_contacts(contact_list)\n\ - \ for contact in contacts:\n print(contact.name)\n print(contact.email)\n\ - \ print(contact.phone)\n\n ````\n" - uid: azure.keyvault.certificates.CertificateClient.update_certificate_policy name: update_certificate_policy summary: 'Updates the policy for a certificate. Requires certificates/update permission. @@ -1000,18 +772,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Update a certificate's attributes\n\n\n\n````python\n\ - \n # update attributes of an existing certificate\n tags = {\"foo\": \"updated\ - \ tag\"}\n updated_certificate = certificate_client.update_certificate_properties(\n\ - \ certificate_name=certificate.name, tags=tags\n )\n\n print(updated_certificate.properties.version)\n\ - \ print(updated_certificate.properties.updated_on)\n print(updated_certificate.properties.tags)\n\ - \n ````\n" - uid: azure.keyvault.certificates.CertificateClient.update_issuer name: update_issuer summary: Updates the specified certificate issuer. Requires certificates/setissuers diff --git a/docs-ref-autogen/azure-keyvault-certificates/azure.keyvault.certificates.KeyVaultCertificateIdentifier.yml b/docs-ref-autogen/azure-keyvault-certificates/azure.keyvault.certificates.KeyVaultCertificateIdentifier.yml index 85d5e3ee23ec..780cefa605c6 100644 --- a/docs-ref-autogen/azure-keyvault-certificates/azure.keyvault.certificates.KeyVaultCertificateIdentifier.yml +++ b/docs-ref-autogen/azure-keyvault-certificates/azure.keyvault.certificates.KeyVaultCertificateIdentifier.yml @@ -14,16 +14,6 @@ constructor: isRequired: true types: - -examples: -- "Parse a certificate's ID\n\n\n\n````python\n\n cert = client.get_certificate(cert_name)\n\ - \ parsed_certificate_id = KeyVaultCertificateIdentifier(cert.id)\n\n print(parsed_certificate_id.name)\n\ - \ print(parsed_certificate_id.vault_url)\n print(parsed_certificate_id.version)\n\ - \ print(parsed_certificate_id.source_id)\n\n ````\n" attributes: - uid: azure.keyvault.certificates.KeyVaultCertificateIdentifier.name name: name diff --git a/docs-ref-autogen/azure-keyvault-certificates/azure.keyvault.certificates.aio.CertificateClient.yml b/docs-ref-autogen/azure-keyvault-certificates/azure.keyvault.certificates.aio.CertificateClient.yml index ea31b6e07ab1..941b09bce8bd 100644 --- a/docs-ref-autogen/azure-keyvault-certificates/azure.keyvault.certificates.aio.CertificateClient.yml +++ b/docs-ref-autogen/azure-keyvault-certificates/azure.keyvault.certificates.aio.CertificateClient.yml @@ -39,19 +39,6 @@ constructor: Vault domain. Defaults to True.' types: - -examples: -- "Creates a new instance of the Certificate client\n\n\n\n````python\n\n from azure.identity.aio\ - \ import DefaultAzureCredential\n from azure.keyvault.certificates.aio import\ - \ CertificateClient\n\n # Create a KeyVaultCertificate using default Azure credentials\n\ - \ credential = DefaultAzureCredential()\n certificate_client = CertificateClient(vault_url=vault_url,\ - \ credential=credential)\n\n # the client and credential should be closed when\ - \ no longer needed\n # (both are also async context managers)\n await certificate_client.close()\n\ - \ await credential.close()\n\n ````\n" methods: - uid: azure.keyvault.certificates.aio.CertificateClient.backup_certificate name: backup_certificate @@ -84,16 +71,6 @@ methods: description: if the certificate doesn't exist, - type: azure.core.exceptions.HttpResponseError description: for other errors - examples: - - "Get a certificate backup\n\n\n\n````python\n\ - \n # backup certificate\n certificate_backup = await certificate_client.backup_certificate(cert_name)\n\ - \n # returns the raw bytes of the backed up certificate\n print(certificate_backup)\n\ - \n ````\n" - uid: azure.keyvault.certificates.aio.CertificateClient.cancel_certificate_operation name: cancel_certificate_operation summary: Cancels an in-progress certificate operation. Requires the certificates/update @@ -162,22 +139,6 @@ methods: description: if the certificate policy is invalid, - type: azure.core.exceptions.HttpResponseError description: for other errors. - examples: - - "Create a certificate\n\n\n\n````python\n\ - \n from azure.keyvault.certificates import CertificatePolicy, CertificateContentType,\ - \ WellKnownIssuerNames\n\n # specify the certificate policy\n cert_policy\ - \ = CertificatePolicy(\n issuer_name=WellKnownIssuerNames.self,\n \ - \ subject=\"CN=*.microsoft.com\",\n san_dns_names=[\"sdk.azure-int.net\"\ - ],\n exportable=True,\n key_type=\"RSA\",\n key_size=2048,\n\ - \ reuse_key=False,\n content_type=CertificateContentType.pkcs12,\n\ - \ validity_in_months=24,\n )\n\n certificate = await certificate_client.create_certificate(certificate_name=cert_name,\ - \ policy=cert_policy)\n\n print(certificate.id)\n print(certificate.name)\n\ - \ print(certificate.policy.issuer_name)\n\n ````\n" - uid: azure.keyvault.certificates.aio.CertificateClient.create_issuer name: create_issuer summary: Sets the specified certificate issuer. Requires certificates/setissuers @@ -222,23 +183,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Create an issuer\n\n\n\n````python\n\ - \n from azure.keyvault.certificates import AdministratorContact\n\n # First\ - \ we specify the AdministratorContact for a issuer.\n admin_contacts = [\n \ - \ AdministratorContact(first_name=\"John\", last_name=\"Doe\", email=\"admin@microsoft.com\"\ - , phone=\"4255555555\")\n ]\n\n issuer = await certificate_client.create_issuer(\n\ - \ issuer_name=\"issuer1\",\n provider=\"Test\",\n account_id=\"\ - keyvaultuser\",\n admin_contacts=admin_contacts,\n enabled=True,\n\ - \ )\n\n print(issuer.name)\n print(issuer.provider)\n print(issuer.account_id)\n\ - \n for contact in issuer.admin_contacts:\n print(contact.first_name)\n\ - \ print(contact.last_name)\n print(contact.email)\n print(contact.phone)\n\ - \n ````\n" - uid: azure.keyvault.certificates.aio.CertificateClient.delete_certificate name: delete_certificate summary: 'Delete all versions of a certificate. Requires certificates/delete permission. @@ -261,18 +205,6 @@ methods: description: if the certificate doesn't exist, - type: azure.core.exceptions.HttpResponseError description: for other errors - examples: - - "Delete a certificate\n\n\n\n````python\n\ - \n # delete a certificate\n deleted_certificate = await certificate_client.delete_certificate(cert_name)\n\ - \n print(deleted_certificate.name)\n\n # if the vault has soft-delete enabled,\ - \ the certificate's\n # scheduled purge date, deleted_on, and recovery id are\ - \ available\n print(deleted_certificate.deleted_on)\n print(deleted_certificate.scheduled_purge_date)\n\ - \ print(deleted_certificate.recovery_id)\n\n ````\n" - uid: azure.keyvault.certificates.aio.CertificateClient.delete_certificate_operation name: delete_certificate_operation summary: 'Deletes and stops the creation operation for a specific certificate. @@ -307,16 +239,6 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Delete contacts\n\n\n\n````python\n\ - \n deleted_contacts = await certificate_client.delete_contacts()\n\n for deleted_contact\ - \ in deleted_contacts:\n print(deleted_contact.name)\n print(deleted_contact.email)\n\ - \ print(deleted_contact.phone)\n\n ````\n" - uid: azure.keyvault.certificates.aio.CertificateClient.delete_issuer name: delete_issuer summary: 'Deletes the specified certificate issuer. @@ -336,18 +258,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Delete an issuer\n\n\n\n````python\n\ - \n deleted_issuer = await certificate_client.delete_issuer(\"issuer1\")\n\n\ - \ print(deleted_issuer.name)\n print(deleted_issuer.provider)\n print(deleted_issuer.account_id)\n\ - \n for contact in deleted_issuer.admin_contacts:\n print(contact.first_name)\n\ - \ print(contact.last_name)\n print(contact.email)\n print(contact.phone)\n\ - \n ````\n" - uid: azure.keyvault.certificates.aio.CertificateClient.get_certificate name: get_certificate summary: 'Gets a certificate with its management policy attached. Requires certificates/get @@ -374,16 +284,6 @@ methods: description: if the certificate doesn't exist, - type: azure.core.exceptions.HttpResponseError description: for other errors - examples: - - "Get a certificate\n\n\n\n````python\n\ - \n # get the latest version of a certificate\n certificate = await certificate_client.get_certificate(cert_name)\n\ - \n print(certificate.id)\n print(certificate.name)\n print(certificate.policy.issuer_name)\n\ - \n ````\n" - uid: azure.keyvault.certificates.aio.CertificateClient.get_certificate_operation name: get_certificate_operation summary: Gets the creation operation of a certificate. Requires the certificates/get @@ -456,16 +356,6 @@ methods: description: if the certificate doesn't exist, - type: azure.core.exceptions.HttpResponseError description: for other errors - examples: - - "Get a certificate with a specific version\n\n\n\n````python\n\ - \n certificate = await certificate_client.get_certificate_version(cert_name,\ - \ version)\n\n print(certificate.id)\n print(certificate.properties.version)\n\ - \n ````\n" - uid: azure.keyvault.certificates.aio.CertificateClient.get_contacts name: get_contacts summary: Gets the certificate contacts for the key vault. Requires the certificates/managecontacts @@ -477,17 +367,6 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Get contacts\n\ - \n\n\n````python\n\ - \n contacts = await certificate_client.get_contacts()\n\n # Loop through the\ - \ certificate contacts for this key vault.\n for contact in contacts:\n \ - \ print(contact.name)\n print(contact.email)\n print(contact.phone)\n\ - \n ````\n" - uid: azure.keyvault.certificates.aio.CertificateClient.get_deleted_certificate name: get_deleted_certificate summary: 'Get a deleted certificate. Possible only in a vault with soft-delete enabled. @@ -514,16 +393,6 @@ methods: description: if the certificate doesn't exist, - type: azure.core.exceptions.HttpResponseError description: for other errors - examples: - - "Get a deleted certificate\n\n\n\n````python\n\ - \n # get a deleted certificate (requires soft-delete enabled for the vault)\n\ - \ deleted_certificate = await certificate_client.get_deleted_certificate(cert_name)\n\ - \ print(deleted_certificate.name)\n\n ````\n" - uid: azure.keyvault.certificates.aio.CertificateClient.get_issuer name: get_issuer summary: Gets the specified certificate issuer. Requires certificates/manageissuers/getissuers @@ -544,17 +413,6 @@ methods: description: if the issuer doesn't exist, - type: azure.core.exceptions.HttpResponseError description: for other errors - examples: - - "Get an issuer\n\ - \n\n\n````python\n\ - \n issuer = await certificate_client.get_issuer(\"issuer1\")\n\n print(issuer.name)\n\ - \ print(issuer.provider)\n print(issuer.account_id)\n\n for contact in issuer.admin_contacts:\n\ - \ print(contact.first_name)\n print(contact.last_name)\n print(contact.email)\n\ - \ print(contact.phone)\n\n ````\n" - uid: azure.keyvault.certificates.aio.CertificateClient.import_certificate name: import_certificate summary: 'Import a certificate created externally. Requires certificates/import @@ -642,19 +500,6 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "List all the deleted certificates\n\n\n\n````python\n\ - \n # get an iterator of deleted certificates (requires soft-delete enabled for\ - \ the vault)\n deleted_certificates = certificate_client.list_deleted_certificates()\n\ - \n async for certificate in deleted_certificates:\n print(certificate.id)\n\ - \ print(certificate.name)\n print(certificate.scheduled_purge_date)\n\ - \ print(certificate.recovery_id)\n print(certificate.deleted_on)\n\ - \n ````\n" - uid: azure.keyvault.certificates.aio.CertificateClient.list_properties_of_certificate_versions name: list_properties_of_certificate_versions summary: 'List the identifiers and properties of a certificate''s versions. @@ -675,18 +520,6 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "List all versions of a certificate\n\n\n\n````python\n\ - \n # get an iterator of all versions of a certificate\n certificate_versions\ - \ = certificate_client.list_properties_of_certificate_versions(certificate_name)\n\ - \n async for certificate in certificate_versions:\n print(certificate.id)\n\ - \ print(certificate.updated_on)\n print(certificate.version)\n\n \ - \ ````\n" - uid: azure.keyvault.certificates.aio.CertificateClient.list_properties_of_certificates name: list_properties_of_certificates summary: 'List identifiers and properties of all certificates in the vault. @@ -708,17 +541,6 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "List all certificates\n\n\n\n````python\n\ - \n # list certificates\n certificates = certificate_client.list_properties_of_certificates()\n\ - \n async for certificate in certificates:\n print(certificate.id)\n \ - \ print(certificate.created_on)\n print(certificate.name)\n print(certificate.updated_on)\n\ - \ print(certificate.enabled)\n\n ````\n" - uid: azure.keyvault.certificates.aio.CertificateClient.list_properties_of_issuers name: list_properties_of_issuers summary: 'Lists properties of the certificate issuers for the key vault. @@ -732,16 +554,6 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "List issuers of a vault\n\n\n\n````python\n\ - \n issuers = certificate_client.list_properties_of_issuers()\n\n async for\ - \ issuer in issuers:\n print(issuer.name)\n print(issuer.provider)\n\ - \n ````\n" - uid: azure.keyvault.certificates.aio.CertificateClient.merge_certificate name: merge_certificate summary: 'Merges a certificate or a certificate chain with a key pair existing on @@ -843,17 +655,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Recover a deleted certificate\n\n\n\n````python\n\ - \n # recover deleted certificate to its latest version (requires soft-delete\ - \ enabled for the vault)\n recovered_certificate = await certificate_client.recover_deleted_certificate(cert_name)\n\ - \ print(recovered_certificate.id)\n print(recovered_certificate.name)\n\n\ - \ ````\n" - uid: azure.keyvault.certificates.aio.CertificateClient.restore_certificate_backup name: restore_certificate_backup summary: 'Restore a certificate backup to the vault. Requires certificates/restore @@ -880,16 +681,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Restore a certificate backup\n\n\n\n````python\n\ - \n # restores a certificate backup\n restored_certificate = await certificate_client.restore_certificate_backup(certificate_backup)\n\ - \ print(restored_certificate.id)\n print(restored_certificate.name)\n print(restored_certificate.properties.version)\n\ - \n ````\n" - uid: azure.keyvault.certificates.aio.CertificateClient.set_contacts name: set_contacts summary: Sets the certificate contacts for the key vault. Requires certificates/managecontacts @@ -908,20 +699,6 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Create contacts\n\n\n\n````python\n\ - \n from azure.keyvault.certificates import CertificateContact\n\n # Create\ - \ a list of the contacts that you want to set for this key vault.\n contact_list\ - \ = [\n CertificateContact(email=\"admin@contoso.com\", name=\"John Doe\"\ - , phone=\"1111111111\"),\n CertificateContact(email=\"admin2@contoso.com\"\ - , name=\"John Doe2\", phone=\"2222222222\"),\n ]\n\n contacts = await certificate_client.set_contacts(contact_list)\n\ - \ for contact in contacts:\n print(contact.name)\n print(contact.email)\n\ - \ print(contact.phone)\n\n ````\n" - uid: azure.keyvault.certificates.aio.CertificateClient.update_certificate_policy name: update_certificate_policy summary: 'Updates the policy for a certificate. Requires certificates/update permission. @@ -977,18 +754,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Update a certificate's attributes\n\n\n\n````python\n\ - \n # update attributes of an existing certificate\n tags = {\"foo\": \"updated\ - \ tag\"}\n updated_certificate = await certificate_client.update_certificate_properties(\n\ - \ certificate_name=certificate.name, tags=tags\n )\n\n print(updated_certificate.properties.version)\n\ - \ print(updated_certificate.properties.updated_on)\n print(updated_certificate.properties.tags)\n\ - \n ````\n" - uid: azure.keyvault.certificates.aio.CertificateClient.update_issuer name: update_issuer summary: Updates the specified certificate issuer. Requires certificates/setissuers diff --git a/docs-ref-autogen/azure-keyvault-keys/azure.keyvault.keys.KeyClient.yml b/docs-ref-autogen/azure-keyvault-keys/azure.keyvault.keys.KeyClient.yml index 41c175f9eca5..9151a8d25c2b 100644 --- a/docs-ref-autogen/azure-keyvault-keys/azure.keyvault.keys.KeyClient.yml +++ b/docs-ref-autogen/azure-keyvault-keys/azure.keyvault.keys.KeyClient.yml @@ -40,16 +40,6 @@ constructor: Vault or Managed HSM domain. Defaults to True.' types: - -examples: -- "Create a new `KeyClient`\n\ - \n\n\n````python\n\n from azure.identity\ - \ import DefaultAzureCredential\n from azure.keyvault.keys import KeyClient\n\n\ - \ # Create a KeyClient using default Azure credentials\n credential = DefaultAzureCredential()\n\ - \ key_client = KeyClient(vault_url, credential)\n\n ````\n" methods: - uid: azure.keyvault.keys.KeyClient.backup_key name: backup_key @@ -81,15 +71,6 @@ methods: description: if the key doesn't exist, - type: azure.core.exceptions.HttpResponseError description: for other errors - examples: - - "Get a key backup\n\n\n\n````python\n\n # backup key\n\ - \ key_backup = key_client.backup_key(key_name)\n\n # returns the raw bytes\ - \ of the backed up key\n print(key_backup)\n\n ````\n" - uid: azure.keyvault.keys.KeyClient.begin_delete_key name: begin_delete_key summary: 'Delete all versions of a key and its cryptographic material. @@ -130,18 +111,6 @@ methods: description: if the key doesn't exist, - type: azure.core.exceptions.HttpResponseError description: for other errors - examples: - - "Delete a key\n\n\n\n````python\n\n # delete a key\n deleted_key_poller = key_client.begin_delete_key(key_name)\n\ - \ deleted_key = deleted_key_poller.result()\n\n print(deleted_key.name)\n\n\ - \ # if the vault has soft-delete enabled, the key's deleted_date,\n # scheduled\ - \ purge date and recovery id are set\n print(deleted_key.deleted_date)\n print(deleted_key.scheduled_purge_date)\n\ - \ print(deleted_key.recovery_id)\n\n # if you want to block until deletion\ - \ is complete, call wait() on the poller\n deleted_key_poller.wait()\n\n ````\n" - uid: azure.keyvault.keys.KeyClient.begin_recover_deleted_key name: begin_recover_deleted_key summary: 'Recover a deleted key to its latest version. Possible only in a vault @@ -180,18 +149,6 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Recover a deleted key\n\n\ - \n\n````python\n\n # recover\ - \ a deleted key to its latest version (requires soft-delete enabled for the vault)\n\ - \ recover_key_poller = key_client.begin_recover_deleted_key(key_name)\n recovered_key\ - \ = recover_key_poller.result()\n print(recovered_key.id)\n print(recovered_key.name)\n\ - \n # if you want to block until key is recovered server-side, call wait() on\ - \ the poller\n recover_key_poller.wait()\n\n ````\n" - uid: azure.keyvault.keys.KeyClient.create_ec_key name: create_ec_key summary: 'Create a new elliptic curve key or, if `name` is already in use, create @@ -261,17 +218,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Create an elliptic curve key\n\ - \n\n\n````python\n\n key_curve\ - \ = \"P-256\"\n\n # create an EC (Elliptic curve) key with curve specification\n\ - \ # EC key can be created with default curve of 'P-256'\n ec_key = key_client.create_ec_key(key_name,\ - \ curve=key_curve)\n\n print(ec_key.id)\n print(ec_key.properties.version)\n\ - \ print(ec_key.key_type)\n print(ec_key.key.crv)\n\n ````\n" - uid: azure.keyvault.keys.KeyClient.create_key name: create_key summary: 'Create a key or, if `name` is already in use, create a new version of @@ -359,17 +305,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Create a key\n\n\n\n````python\n\n from dateutil import parser as date_parse\n\n\ - \ expires_on = date_parse.parse(\"2050-02-02T08:00:00.000Z\")\n\n # create\ - \ a key with optional arguments\n key = key_client.create_key(key_name, KeyType.rsa_hsm,\ - \ expires_on=expires_on)\n\n print(key.name)\n print(key.id)\n print(key.key_type)\n\ - \ print(key.properties.expires_on)\n\n ````\n" - uid: azure.keyvault.keys.KeyClient.create_oct_key name: create_oct_key summary: 'Create a new octet sequence (symmetric) key or, if `name` is in use, create @@ -438,15 +373,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Create an octet sequence (symmetric) key\n\n\n\n````python\n\ - \n key = key_client.create_oct_key(key_name, size=256, hardware_protected=True)\n\ - \n print(key.id)\n print(key.name)\n print(key.key_type)\n\n ````\n" - uid: azure.keyvault.keys.KeyClient.create_rsa_key name: create_rsa_key summary: 'Create a new RSA key or, if `name` is already in use, create a new version @@ -521,18 +447,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Create RSA key\n\n\n\n````python\n\n key_size = 2048\n key_ops = [\"encrypt\", \"\ - decrypt\", \"sign\", \"verify\", \"wrapKey\", \"unwrapKey\"]\n\n # create an\ - \ rsa key with size specification\n # RSA key can be created with default size\ - \ of '2048'\n key = key_client.create_rsa_key(key_name, hardware_protected=True,\ - \ size=key_size, key_operations=key_ops)\n\n print(key.id)\n print(key.name)\n\ - \ print(key.key_type)\n print(key.key_operations)\n\n ````\n" - uid: azure.keyvault.keys.KeyClient.get_cryptography_client name: get_cryptography_client summary: Gets a for the given @@ -577,18 +491,6 @@ methods: description: if the key doesn't exist, - type: azure.core.exceptions.HttpResponseError description: for other errors - examples: - - "Get a deleted key\n\n\n\n````python\n\n # get a deleted\ - \ key (requires soft-delete enabled for the vault)\n deleted_key = key_client.get_deleted_key(key_name)\n\ - \ print(deleted_key.name)\n\n # if the vault has soft-delete enabled, the\ - \ key's deleted_date\n # scheduled purge date and recovery id are set\n print(deleted_key.deleted_date)\n\ - \ print(deleted_key.scheduled_purge_date)\n print(deleted_key.recovery_id)\n\ - \n ````\n" - uid: azure.keyvault.keys.KeyClient.get_key name: get_key summary: 'Get a key''s attributes and, if it''s an asymmetric key, its public material. @@ -619,17 +521,6 @@ methods: description: if the key doesn't exist, - type: azure.core.exceptions.HttpResponseError description: for other errors - examples: - - "Get a key\n\n\n\n````python\n\n # get the latest version of a key\n key = key_client.get_key(key_name)\n\ - \n # alternatively, specify a version\n key_version = key.properties.version\n\ - \ key = key_client.get_key(key_name, key_version)\n\n print(key.id)\n print(key.name)\n\ - \ print(key.properties.version)\n print(key.key_type)\n print(key.properties.vault_url)\n\ - \n ````\n" - uid: azure.keyvault.keys.KeyClient.get_key_rotation_policy name: get_key_rotation_policy summary: Get the rotation policy of a Key Vault key. @@ -665,14 +556,6 @@ methods: description: if less than one random byte is requested, - type: azure.core.exceptions.HttpResponseError description: for other errors - examples: - - "Get random bytes\n\n\n\n````python\n\n # get eight random bytes from a managed HSM\n\ - \ random_bytes = client.get_random_bytes(count=8)\n\n ````\n" - uid: azure.keyvault.keys.KeyClient.import_key name: import_key summary: 'Import a key created externally. @@ -745,17 +628,6 @@ methods: description: An iterator of deleted keys types: - [] - examples: - - "List all the deleted keys\n\ - \n\n\n````python\n\n # get an iterator\ - \ of deleted keys (requires soft-delete enabled for the vault)\n deleted_keys\ - \ = key_client.list_deleted_keys()\n\n for key in deleted_keys:\n print(key.id)\n\ - \ print(key.name)\n print(key.scheduled_purge_date)\n print(key.recovery_id)\n\ - \ print(key.deleted_date)\n\n ````\n" - uid: azure.keyvault.keys.KeyClient.list_properties_of_key_versions name: list_properties_of_key_versions summary: 'List the identifiers and properties of a key''s versions. @@ -773,16 +645,6 @@ methods: description: An iterator of keys without their cryptographic material types: - [] - examples: - - "List all versions of a key\n\ - \n\n\n````python\n\n # get an iterator\ - \ of a key's versions\n key_versions = key_client.list_properties_of_key_versions(\"\ - key-name\")\n\n for key in key_versions:\n print(key.id)\n print(key.name)\n\ - \n ````\n" - uid: azure.keyvault.keys.KeyClient.list_properties_of_keys name: list_properties_of_keys summary: 'List identifiers and properties of all keys in the vault. @@ -795,14 +657,6 @@ methods: information types: - [] - examples: - - "List all keys\n\n\n\n````python\n\n # get an iterator of keys\n keys = key_client.list_properties_of_keys()\n\ - \n for key in keys:\n print(key.id)\n print(key.name)\n\n ````\n" - uid: azure.keyvault.keys.KeyClient.purge_deleted_key name: purge_deleted_key summary: 'Permanently deletes a deleted key. Only possible in a vault with soft-delete @@ -914,15 +768,6 @@ methods: description: if the backed up key's name is already in use, - type: azure.core.exceptions.HttpResponseError description: for other errors - examples: - - "Restore a key backup\n\n\ - \n\n````python\n\n # restore\ - \ a key backup\n restored_key = key_client.restore_key_backup(key_backup)\n\ - \ print(restored_key.id)\n print(restored_key.properties.version)\n\n ````\n" - uid: azure.keyvault.keys.KeyClient.rotate_key name: rotate_key summary: 'Rotate the key based on the key policy by generating a new version of @@ -1004,18 +849,6 @@ methods: description: if the key doesn't exist, - type: azure.core.exceptions.HttpResponseError description: for other errors - examples: - - "Update a key's attributes\n\ - \n\n\n````python\n\n # update attributes\ - \ of an existing key\n expires_on = date_parse.parse(\"2050-01-02T08:00:00.000Z\"\ - )\n tags = {\"foo\": \"updated tag\"}\n updated_key = key_client.update_key_properties(key.name,\ - \ expires_on=expires_on, tags=tags)\n\n print(updated_key.properties.version)\n\ - \ print(updated_key.properties.updated_on)\n print(updated_key.properties.expires_on)\n\ - \ print(updated_key.properties.tags)\n print(key.key_type)\n\n ````\n" - uid: azure.keyvault.keys.KeyClient.update_key_rotation_policy name: update_key_rotation_policy summary: 'Updates the rotation policy of a Key Vault key. diff --git a/docs-ref-autogen/azure-keyvault-keys/azure.keyvault.keys.KeyVaultKeyIdentifier.yml b/docs-ref-autogen/azure-keyvault-keys/azure.keyvault.keys.KeyVaultKeyIdentifier.yml index ceb4bf45d7cf..bf2f400fc8fa 100644 --- a/docs-ref-autogen/azure-keyvault-keys/azure.keyvault.keys.KeyVaultKeyIdentifier.yml +++ b/docs-ref-autogen/azure-keyvault-keys/azure.keyvault.keys.KeyVaultKeyIdentifier.yml @@ -14,15 +14,6 @@ constructor: isRequired: true types: - -examples: -- "Parse a key's ID\n\n\n\n````python\n\n key = client.get_key(key_name)\n parsed_key_id = KeyVaultKeyIdentifier(key.id)\n\ - \n print(parsed_key_id.name)\n print(parsed_key_id.vault_url)\n print(parsed_key_id.version)\n\ - \ print(parsed_key_id.source_id)\n\n ````\n" attributes: - uid: azure.keyvault.keys.KeyVaultKeyIdentifier.name name: name diff --git a/docs-ref-autogen/azure-keyvault-keys/azure.keyvault.keys.aio.KeyClient.yml b/docs-ref-autogen/azure-keyvault-keys/azure.keyvault.keys.aio.KeyClient.yml index 01f9d248780a..eadab5809a58 100644 --- a/docs-ref-autogen/azure-keyvault-keys/azure.keyvault.keys.aio.KeyClient.yml +++ b/docs-ref-autogen/azure-keyvault-keys/azure.keyvault.keys.aio.KeyClient.yml @@ -40,18 +40,6 @@ constructor: Vault or Managed HSM domain. Defaults to True.' types: - -examples: -- "Create a new `KeyClient`\n\ - \n\n\n````python\n\n from azure.identity.aio\ - \ import DefaultAzureCredential\n from azure.keyvault.keys.aio import KeyClient\n\ - \n # Create a KeyClient using default Azure credentials\n credential = DefaultAzureCredential()\n\ - \ key_client = KeyClient(vault_url, credential)\n\n # the client and credential\ - \ should be closed when no longer needed\n # (both are also async context managers)\n\ - \ await key_client.close()\n await credential.close()\n\n ````\n" methods: - uid: azure.keyvault.keys.aio.KeyClient.backup_key name: backup_key @@ -81,15 +69,6 @@ methods: description: if the key doesn't exist, - type: azure.core.exceptions.HttpResponseError description: for other errors - examples: - - "Get a key backup\n\ - \n\n\n````python\n\n # backup key\n\ - \ key_backup = await key_client.backup_key(key_name)\n\n # returns the raw\ - \ bytes of the backup\n print(key_backup)\n\n ````\n" - uid: azure.keyvault.keys.aio.KeyClient.create_ec_key name: create_ec_key summary: 'Create a new elliptic curve key or, if `name` is already in use, create @@ -159,17 +138,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Create an elliptic curve key\n\n\n\n````python\n\ - \n # create an elliptic curve (ec) key\n key_curve = \"P-256\"\n ec_key\ - \ = await key_client.create_ec_key(key_name, curve=key_curve)\n\n print(ec_key.id)\n\ - \ print(ec_key.name)\n print(ec_key.key_type)\n print(ec_key.key.crv)\n\n\ - \ ````\n" - uid: azure.keyvault.keys.aio.KeyClient.create_key name: create_key summary: 'Create a key or, if `name` is already in use, create a new version of @@ -257,20 +225,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Create a key\n\n\n\n````python\n\n from dateutil\ - \ import parser as date_parse\n\n key_size = 2048\n key_ops = [\"encrypt\"\ - , \"decrypt\", \"sign\", \"verify\", \"wrapKey\", \"unwrapKey\"]\n expires_on\ - \ = date_parse.parse(\"2050-02-02T08:00:00.000Z\")\n\n # create a key with optional\ - \ arguments\n key = await key_client.create_key(\n key_name, KeyType.rsa,\ - \ size=key_size, key_operations=key_ops, expires_on=expires_on\n )\n\n print(key.id)\n\ - \ print(key.name)\n print(key.key_type)\n print(key.properties.enabled)\n\ - \ print(key.properties.expires_on)\n\n ````\n" - uid: azure.keyvault.keys.aio.KeyClient.create_oct_key name: create_oct_key summary: 'Create a new octet sequence (symmetric) key or, if `name` is in use, create @@ -339,15 +293,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Create an octet sequence (symmetric) key\n\n\n\n````python\n\ - \n key = await key_client.create_oct_key(key_name, size=256, hardware_protected=True)\n\ - \n print(key.id)\n print(key.name)\n print(key.key_type)\n\n ````\n" - uid: azure.keyvault.keys.aio.KeyClient.create_rsa_key name: create_rsa_key summary: 'Create a new RSA key or, if `name` is already in use, create a new version @@ -422,16 +367,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Create RSA key\n\n\ - \n\n````python\n\n # create an\ - \ rsa key in a hardware security module\n key = await key_client.create_rsa_key(key_name,\ - \ hardware_protected=True, size=2048)\n\n print(key.id)\n print(key.name)\n\ - \ print(key.key_type)\n\n ````\n" - uid: azure.keyvault.keys.aio.KeyClient.delete_key name: delete_key summary: 'Delete all versions of a key and its cryptographic material. @@ -457,18 +392,6 @@ methods: description: if the key doesn't exist, - type: azure.core.exceptions.HttpResponseError description: for other errors - examples: - - "Delete a key\n\n\n\n````python\n\n # delete a\ - \ key\n deleted_key = await key_client.delete_key(key_name)\n\n print(deleted_key.name)\n\ - \n # if the vault has soft-delete enabled, the key's\n # scheduled purge date,\ - \ deleted_date and recovery id are set\n print(deleted_key.deleted_date)\n \ - \ print(deleted_key.scheduled_purge_date)\n print(deleted_key.recovery_id)\n\ - \n ````\n" - uid: azure.keyvault.keys.aio.KeyClient.get_cryptography_client name: get_cryptography_client summary: Gets a for the @@ -513,15 +436,6 @@ methods: description: if the key doesn't exist, - type: azure.core.exceptions.HttpResponseError description: for other errors - examples: - - "Get a deleted key\n\ - \n\n\n````python\n\n # get a deleted\ - \ key (requires soft-delete enabled for the vault)\n deleted_key = await key_client.get_deleted_key(key_name)\n\ - \ print(deleted_key.name)\n\n ````\n" - uid: azure.keyvault.keys.aio.KeyClient.get_key name: get_key summary: 'Get a key''s attributes and, if it''s an asymmetric key, its public material. @@ -552,18 +466,6 @@ methods: description: if the key doesn't exist, - type: azure.core.exceptions.HttpResponseError description: for other errors - examples: - - "Get a key\n\n\n\n````python\n\n # get the\ - \ latest version of a key\n key = await key_client.get_key(key_name)\n\n #\ - \ alternatively, specify a version\n key_version = key.properties.version\n\ - \ key = await key_client.get_key(key_name, key_version)\n\n print(key.id)\n\ - \ print(key.name)\n print(key.properties.version)\n print(key.key_type)\n\ - \ print(key.properties.vault_url)\n\n ````\n" - uid: azure.keyvault.keys.aio.KeyClient.get_key_rotation_policy name: get_key_rotation_policy summary: Get the rotation policy of a Key Vault key. @@ -599,14 +501,6 @@ methods: description: if less than one random byte is requested, - type: azure.core.exceptions.HttpResponseError description: for other errors - examples: - - "Get random bytes\n\n\n\n````python\n\n # get eight random bytes from a managed HSM\n\ - \ random_bytes = await client.get_random_bytes(count=8)\n\n ````\n" - uid: azure.keyvault.keys.aio.KeyClient.import_key name: import_key summary: 'Import a key created externally. @@ -679,17 +573,6 @@ methods: description: An iterator of deleted keys types: - [] - examples: - - "List all the deleted keys\n\n\n\n````python\n\ - \n # get an iterator of deleted keys (requires soft-delete enabled for the vault)\n\ - \ deleted_keys = key_client.list_deleted_keys()\n\n async for key in deleted_keys:\n\ - \ print(key.id)\n print(key.name)\n print(key.scheduled_purge_date)\n\ - \ print(key.recovery_id)\n print(key.deleted_date)\n\n ````\n" - uid: azure.keyvault.keys.aio.KeyClient.list_properties_of_key_versions name: list_properties_of_key_versions summary: 'List the identifiers and properties of a key''s versions. @@ -707,17 +590,6 @@ methods: description: An iterator of keys without their cryptographic material types: - [] - examples: - - "List all versions of a key\n\n\n\n````python\n\ - \n # get an iterator of all versions of a key\n key_versions = key_client.list_properties_of_key_versions(\"\ - key-name\")\n\n async for key in key_versions:\n print(key.id)\n \ - \ print(key.updated_on)\n print(key.properties.version)\n print(key.expires_on)\n\ - \n ````\n" - uid: azure.keyvault.keys.aio.KeyClient.list_properties_of_keys name: list_properties_of_keys summary: 'List identifiers and properties of all keys in the vault. @@ -730,16 +602,6 @@ methods: information types: - [] - examples: - - "List all keys\n\n\ - \n\n````python\n\n # list keys\n\ - \ keys = key_client.list_properties_of_keys()\n\n async for key in keys:\n\ - \ print(key.id)\n print(key.created_on)\n print(key.name)\n\ - \ print(key.updated_on)\n print(key.enabled)\n\n ````\n" - uid: azure.keyvault.keys.aio.KeyClient.purge_deleted_key name: purge_deleted_key summary: 'Permanently deletes a deleted key. Only possible in a vault with soft-delete @@ -802,16 +664,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Recover a deleted key\n\ - \n\n\n````python\n\n # recover\ - \ deleted key to its latest version (requires soft-delete enabled for the vault)\n\ - \ recovered_key = await key_client.recover_deleted_key(key_name)\n print(recovered_key.id)\n\ - \ print(recovered_key.name)\n\n ````\n" - uid: azure.keyvault.keys.aio.KeyClient.release_key name: release_key summary: 'Releases a key. @@ -885,16 +737,6 @@ methods: description: if the backed up key's name is already in use, - type: azure.core.exceptions.HttpResponseError description: for other errors - examples: - - "Restore a key backup\n\ - \n\n\n````python\n\n # restores\ - \ a backup\n restored_key = await key_client.restore_key_backup(key_backup)\n\ - \ print(restored_key.id)\n print(restored_key.name)\n print(restored_key.properties.version)\n\ - \n ````\n" - uid: azure.keyvault.keys.aio.KeyClient.rotate_key name: rotate_key summary: 'Rotate the key based on the key policy by generating a new version of @@ -976,19 +818,6 @@ methods: description: if the key doesn't exist, - type: azure.core.exceptions.HttpResponseError description: for other errors - examples: - - "Update a key's attributes\n\n\n\n````python\n\ - \n # update attributes of an existing key\n expires_on = date_parse.parse(\"\ - 2050-01-02T08:00:00.000Z\")\n tags = {\"foo\": \"updated tag\"}\n updated_key\ - \ = await key_client.update_key_properties(key.name, expires_on=expires_on, tags=tags)\n\ - \n print(updated_key.properties.version)\n print(updated_key.properties.updated_on)\n\ - \ print(updated_key.properties.expires_on)\n print(updated_key.properties.tags)\n\ - \ print(updated_key.key_type)\n\n ````\n" - uid: azure.keyvault.keys.aio.KeyClient.update_key_rotation_policy name: update_key_rotation_policy summary: 'Updates the rotation policy of a Key Vault key. diff --git a/docs-ref-autogen/azure-keyvault-keys/azure.keyvault.keys.crypto.CryptographyClient.yml b/docs-ref-autogen/azure-keyvault-keys/azure.keyvault.keys.crypto.CryptographyClient.yml index eba6e8bc3075..e537efdb1c6e 100644 --- a/docs-ref-autogen/azure-keyvault-keys/azure.keyvault.keys.crypto.CryptographyClient.yml +++ b/docs-ref-autogen/azure-keyvault-keys/azure.keyvault.keys.crypto.CryptographyClient.yml @@ -5,20 +5,16 @@ fullName: azure.keyvault.keys.crypto.CryptographyClient module: azure.keyvault.keys.crypto inheritances: - azure.keyvault.keys._shared.client_base.KeyVaultClientBase -summary: "Performs cryptographic operations using Azure Key Vault keys.\n\nThis client\ - \ will perform operations locally when it's intialized with the necessary key material\ - \ or is able to get\nthat material from Key Vault. When the required key material\ - \ is unavailable, cryptographic operations are performed\nby the Key Vault service.\n\ - \nCreate a CryptographyClient\n\n\n\n````python\n\n # create a CryptographyClient\ - \ using a KeyVaultKey instance\n key = key_client.get_key(key_name)\n crypto_client\ - \ = CryptographyClient(key, credential)\n\n # or a key's id, which must include\ - \ a version\n key_id = \"https://.vault.azure.net/keys//fe4fdcab688c479a9aa80f01ffeac26\"\ - \n crypto_client = CryptographyClient(key_id, credential)\n\n ````" +summary: 'Performs cryptographic operations using Azure Key Vault keys. + + + This client will perform operations locally when it''s intialized with the necessary + key material or is able to get + + that material from Key Vault. When the required key material is unavailable, cryptographic + operations are performed + + by the Key Vault service.' constructor: syntax: 'CryptographyClient(key: KeyVaultKey | str, credential: TokenCredential, **kwargs)' @@ -57,17 +53,13 @@ constructor: methods: - uid: azure.keyvault.keys.crypto.CryptographyClient.decrypt name: decrypt - summary: "Decrypt a single block of encrypted data using the client's key.\n\nRequires\ - \ the keys/decrypt permission. This method decrypts only a single block of data,\ - \ whose size depends on\nthe key and encryption algorithm.\n\nDecrypt bytes\n\n\n\n````python\n\n from azure.keyvault.keys.crypto import EncryptionAlgorithm\n\ - \n result = client.decrypt(EncryptionAlgorithm.rsa_oaep, ciphertext)\n print(result.plaintext)\n\ - \n ````" + summary: 'Decrypt a single block of encrypted data using the client''s key. + + + Requires the keys/decrypt permission. This method decrypts only a single block + of data, whose size depends on + + the key and encryption algorithm.' signature: 'decrypt(algorithm: EncryptionAlgorithm, ciphertext: bytes, **kwargs) -> DecryptResult' parameters: @@ -117,19 +109,13 @@ methods: are provided. - uid: azure.keyvault.keys.crypto.CryptographyClient.encrypt name: encrypt - summary: "Encrypt bytes using the client's key.\n\nRequires the keys/encrypt permission.\ - \ This method encrypts only a single block of data, whose size depends on\nthe\ - \ key and encryption algorithm.\n\nEncrypt bytes\n\n\n\n````python\n\ - \n from azure.keyvault.keys.crypto import EncryptionAlgorithm\n\n # the result\ - \ holds the ciphertext and identifies the encryption key and algorithm used\n\ - \ result = client.encrypt(EncryptionAlgorithm.rsa_oaep, b\"plaintext\")\n \ - \ ciphertext = result.ciphertext\n print(result.key_id)\n print(result.algorithm)\n\ - \n ````" + summary: 'Encrypt bytes using the client''s key. + + + Requires the keys/encrypt permission. This method encrypts only a single block + of data, whose size depends on + + the key and encryption algorithm.' signature: 'encrypt(algorithm: EncryptionAlgorithm, plaintext: bytes, **kwargs) -> EncryptResult' parameters: @@ -189,18 +175,10 @@ methods: - - uid: azure.keyvault.keys.crypto.CryptographyClient.sign name: sign - summary: "Create a signature from a digest using the client's key.\n\nRequires the\ - \ keys/sign permission.\n\nSign bytes\n\n\n\n````python\n\ - \n import hashlib\n\n from azure.keyvault.keys.crypto import SignatureAlgorithm\n\ - \n digest = hashlib.sha256(b\"plaintext\").digest()\n\n # sign returns the\ - \ signature and the metadata required to verify it\n result = client.sign(SignatureAlgorithm.rs256,\ - \ digest)\n print(result.key_id)\n print(result.algorithm)\n signature =\ - \ result.signature\n\n ````" + summary: 'Create a signature from a digest using the client''s key. + + + Requires the keys/sign permission.' signature: 'sign(algorithm: SignatureAlgorithm, digest: bytes, **kwargs) -> SignResult' parameters: - name: algorithm @@ -218,15 +196,10 @@ methods: - - uid: azure.keyvault.keys.crypto.CryptographyClient.unwrap_key name: unwrap_key - summary: "Unwrap a key previously wrapped with the client's key.\n\nRequires the\ - \ keys/unwrapKey permission.\n\nUnwrap a key\n\n\n\n````python\n\ - \n from azure.keyvault.keys.crypto import KeyWrapAlgorithm\n\n result = client.unwrap_key(KeyWrapAlgorithm.rsa_oaep,\ - \ encrypted_key)\n key = result.key\n\n ````" + summary: 'Unwrap a key previously wrapped with the client''s key. + + + Requires the keys/unwrapKey permission.' signature: 'unwrap_key(algorithm: KeyWrapAlgorithm, encrypted_key: bytes, **kwargs) -> UnwrapResult' parameters: @@ -245,16 +218,10 @@ methods: - - uid: azure.keyvault.keys.crypto.CryptographyClient.verify name: verify - summary: "Verify a signature using the client's key.\n\nRequires the keys/verify\ - \ permission.\n\nVerify a signature\n\n\n\n````python\n\ - \n from azure.keyvault.keys.crypto import SignatureAlgorithm\n\n result =\ - \ client.verify(SignatureAlgorithm.rs256, digest, signature)\n assert result.is_valid\n\ - \n ````" + summary: 'Verify a signature using the client''s key. + + + Requires the keys/verify permission.' signature: 'verify(algorithm: SignatureAlgorithm, digest: bytes, signature: bytes, **kwargs) -> VerifyResult' parameters: @@ -281,17 +248,10 @@ methods: - - uid: azure.keyvault.keys.crypto.CryptographyClient.wrap_key name: wrap_key - summary: "Wrap a key with the client's key.\n\nRequires the keys/wrapKey permission.\n\ - \nWrap a key\n\n\n\n````python\n\n from azure.keyvault.keys.crypto import\ - \ KeyWrapAlgorithm\n\n # the result holds the encrypted key and identifies the\ - \ encryption key and algorithm used\n result = client.wrap_key(KeyWrapAlgorithm.rsa_oaep,\ - \ key_bytes)\n encrypted_key = result.encrypted_key\n print(result.key_id)\n\ - \ print(result.algorithm)\n\n ````" + summary: 'Wrap a key with the client''s key. + + + Requires the keys/wrapKey permission.' signature: 'wrap_key(algorithm: KeyWrapAlgorithm, key: bytes, **kwargs) -> WrapResult' parameters: - name: algorithm diff --git a/docs-ref-autogen/azure-keyvault-keys/azure.keyvault.keys.crypto.aio.CryptographyClient.yml b/docs-ref-autogen/azure-keyvault-keys/azure.keyvault.keys.crypto.aio.CryptographyClient.yml index 6c81aa7f7e72..73b2a8c2593a 100644 --- a/docs-ref-autogen/azure-keyvault-keys/azure.keyvault.keys.crypto.aio.CryptographyClient.yml +++ b/docs-ref-autogen/azure-keyvault-keys/azure.keyvault.keys.crypto.aio.CryptographyClient.yml @@ -5,23 +5,16 @@ fullName: azure.keyvault.keys.crypto.aio.CryptographyClient module: azure.keyvault.keys.crypto.aio inheritances: - azure.keyvault.keys._shared.async_client_base.AsyncKeyVaultClientBase -summary: "Performs cryptographic operations using Azure Key Vault keys.\n\nThis client\ - \ will perform operations locally when it's intialized with the necessary key material\ - \ or is able to get\nthat material from Key Vault. When the required key material\ - \ is unavailable, cryptographic operations are performed\nby the Key Vault service.\n\ - \nCreate a CryptographyClient\n\n\n\n````python\n\n # create a CryptographyClient\ - \ using a KeyVaultKey instance\n key = await key_client.get_key(key_name)\n \ - \ crypto_client = CryptographyClient(key, credential)\n\n # or a key's id, which\ - \ must include a version\n key_id = \"https://.vault.azure.net/keys//fe4fdcab688c479a9aa80f01ffeac26\"\n crypto_client = CryptographyClient(key_id,\ - \ credential)\n\n # the client and credential should be closed when no longer\ - \ needed\n # (both are also async context managers)\n await crypto_client.close()\n\ - \ await credential.close()\n\n ````" +summary: 'Performs cryptographic operations using Azure Key Vault keys. + + + This client will perform operations locally when it''s intialized with the necessary + key material or is able to get + + that material from Key Vault. When the required key material is unavailable, cryptographic + operations are performed + + by the Key Vault service.' constructor: syntax: 'CryptographyClient(key: KeyVaultKey | str, credential: AsyncTokenCredential, **kwargs)' @@ -60,17 +53,13 @@ constructor: methods: - uid: azure.keyvault.keys.crypto.aio.CryptographyClient.decrypt name: decrypt - summary: "Decrypt a single block of encrypted data using the client's key.\n\nRequires\ - \ the keys/decrypt permission. This method decrypts only a single block of data,\ - \ whose size depends on\nthe key and encryption algorithm.\n\nDecrypt bytes\n\n\n\n````python\n\n from azure.keyvault.keys.crypto import EncryptionAlgorithm\n\ - \n result = await client.decrypt(EncryptionAlgorithm.rsa_oaep, ciphertext)\n\ - \ print(result.plaintext)\n\n ````" + summary: 'Decrypt a single block of encrypted data using the client''s key. + + + Requires the keys/decrypt permission. This method decrypts only a single block + of data, whose size depends on + + the key and encryption algorithm.' signature: 'async decrypt(algorithm: EncryptionAlgorithm, ciphertext: bytes, **kwargs) -> DecryptResult' parameters: @@ -120,19 +109,13 @@ methods: are provided. - uid: azure.keyvault.keys.crypto.aio.CryptographyClient.encrypt name: encrypt - summary: "Encrypt bytes using the client's key.\n\nRequires the keys/encrypt permission.\ - \ This method encrypts only a single block of data, whose size depends on\nthe\ - \ key and encryption algorithm.\n\nEncrypt bytes\n\n\n\n````python\n\ - \n from azure.keyvault.keys.crypto import EncryptionAlgorithm\n\n # the result\ - \ holds the ciphertext and identifies the encryption key and algorithm used\n\ - \ result = await client.encrypt(EncryptionAlgorithm.rsa_oaep, b\"plaintext\"\ - )\n print(result.key_id)\n print(result.algorithm)\n ciphertext = result.ciphertext\n\ - \n ````" + summary: 'Encrypt bytes using the client''s key. + + + Requires the keys/encrypt permission. This method encrypts only a single block + of data, whose size depends on + + the key and encryption algorithm.' signature: 'async encrypt(algorithm: EncryptionAlgorithm, plaintext: bytes, **kwargs) -> EncryptResult' parameters: @@ -192,18 +175,10 @@ methods: - - uid: azure.keyvault.keys.crypto.aio.CryptographyClient.sign name: sign - summary: "Create a signature from a digest using the client's key.\n\nRequires the\ - \ keys/sign permission.\n\nSign bytes\n\n\n\n````python\n\ - \n import hashlib\n\n from azure.keyvault.keys.crypto import SignatureAlgorithm\n\ - \n digest = hashlib.sha256(b\"plaintext\").digest()\n\n # sign returns the\ - \ signature and the metadata required to verify it\n result = await client.sign(SignatureAlgorithm.rs256,\ - \ digest)\n print(result.key_id)\n print(result.algorithm)\n signature =\ - \ result.signature\n\n ````" + summary: 'Create a signature from a digest using the client''s key. + + + Requires the keys/sign permission.' signature: 'async sign(algorithm: SignatureAlgorithm, digest: bytes, **kwargs) -> SignResult' parameters: @@ -222,15 +197,10 @@ methods: - - uid: azure.keyvault.keys.crypto.aio.CryptographyClient.unwrap_key name: unwrap_key - summary: "Unwrap a key previously wrapped with the client's key.\n\nRequires the\ - \ keys/unwrapKey permission.\n\nUnwrap a key\n\n\n\n````python\n\ - \n from azure.keyvault.keys.crypto import KeyWrapAlgorithm\n\n result = await\ - \ client.unwrap_key(KeyWrapAlgorithm.rsa_oaep, encrypted_key)\n\n ````" + summary: 'Unwrap a key previously wrapped with the client''s key. + + + Requires the keys/unwrapKey permission.' signature: 'async unwrap_key(algorithm: KeyWrapAlgorithm, encrypted_key: bytes, **kwargs) -> UnwrapResult' parameters: @@ -249,16 +219,10 @@ methods: - - uid: azure.keyvault.keys.crypto.aio.CryptographyClient.verify name: verify - summary: "Verify a signature using the client's key.\n\nRequires the keys/verify\ - \ permission.\n\nVerify a signature\n\n\n\n````python\n\ - \n from azure.keyvault.keys.crypto import SignatureAlgorithm\n\n verified\ - \ = await client.verify(SignatureAlgorithm.rs256, digest, signature)\n assert\ - \ verified.is_valid\n\n ````" + summary: 'Verify a signature using the client''s key. + + + Requires the keys/verify permission.' signature: 'async verify(algorithm: SignatureAlgorithm, digest: bytes, signature: bytes, **kwargs) -> VerifyResult' parameters: @@ -285,17 +249,10 @@ methods: - - uid: azure.keyvault.keys.crypto.aio.CryptographyClient.wrap_key name: wrap_key - summary: "Wrap a key with the client's key.\n\nRequires the keys/wrapKey permission.\n\ - \nWrap a key\n\n\ - \n\n````python\n\ - \n from azure.keyvault.keys.crypto import KeyWrapAlgorithm\n\n # wrap returns\ - \ a tuple with the wrapped bytes and the metadata required to unwrap the key\n\ - \ result = await client.wrap_key(KeyWrapAlgorithm.rsa_oaep, key_bytes)\n print(result.key_id)\n\ - \ print(result.algorithm)\n encrypted_key = result.encrypted_key\n\n ````" + summary: 'Wrap a key with the client''s key. + + + Requires the keys/wrapKey permission.' signature: 'async wrap_key(algorithm: KeyWrapAlgorithm, key: bytes, **kwargs) -> WrapResult' parameters: diff --git a/docs-ref-autogen/azure-keyvault-secrets/azure.keyvault.secrets.KeyVaultSecretIdentifier.yml b/docs-ref-autogen/azure-keyvault-secrets/azure.keyvault.secrets.KeyVaultSecretIdentifier.yml index 30112732d3b0..5113cdab89a8 100644 --- a/docs-ref-autogen/azure-keyvault-secrets/azure.keyvault.secrets.KeyVaultSecretIdentifier.yml +++ b/docs-ref-autogen/azure-keyvault-secrets/azure.keyvault.secrets.KeyVaultSecretIdentifier.yml @@ -14,16 +14,6 @@ constructor: isRequired: true types: - -examples: -- "Parse a secret's ID\n\n\n\n````python\n\n secret = client.get_secret(secret_name)\n parsed_secret_id\ - \ = KeyVaultSecretIdentifier(secret.id)\n\n print(parsed_secret_id.name)\n print(parsed_secret_id.vault_url)\n\ - \ print(parsed_secret_id.version)\n print(parsed_secret_id.source_id)\n\n \ - \ ````\n" attributes: - uid: azure.keyvault.secrets.KeyVaultSecretIdentifier.name name: name diff --git a/docs-ref-autogen/azure-keyvault-secrets/azure.keyvault.secrets.SecretClient.yml b/docs-ref-autogen/azure-keyvault-secrets/azure.keyvault.secrets.SecretClient.yml index 8a5dfdee4f29..05a0b092bd15 100644 --- a/docs-ref-autogen/azure-keyvault-secrets/azure.keyvault.secrets.SecretClient.yml +++ b/docs-ref-autogen/azure-keyvault-secrets/azure.keyvault.secrets.SecretClient.yml @@ -39,16 +39,6 @@ constructor: Vault domain. Defaults to True.' types: - -examples: -- "Create a new `SecretClient`\n\ - \n\n\n````python\n\n from azure.identity\ - \ import DefaultAzureCredential\n from azure.keyvault.secrets import SecretClient\n\ - \n # Create a SecretClient using default Azure credentials\n credential = DefaultAzureCredential()\n\ - \ secret_client = SecretClient(vault_url, credential)\n\n ````\n" methods: - uid: azure.keyvault.secrets.SecretClient.backup_secret name: backup_secret @@ -69,15 +59,6 @@ methods: description: if the secret doesn't exist, - type: azure.core.exceptions.HttpResponseError description: for other errors - examples: - - "Back up a secret\n\n\ - \n\n````python\n\n # backup secret\n\ - \ # returns the raw bytes of the backed up secret\n secret_backup = secret_client.backup_secret(secret_name)\n\ - \n print(secret_backup)\n\n ````\n" - uid: azure.keyvault.secrets.SecretClient.begin_delete_secret name: begin_delete_secret summary: 'Delete all versions of a secret. Requires secrets/delete permission. @@ -116,20 +97,6 @@ methods: description: if the secret doesn't exist, - type: azure.core.exceptions.HttpResponseError description: for other errors - examples: - - "Delete a secret\n\n\n\n````python\n\n # delete a\ - \ secret\n deleted_secret_poller = secret_client.begin_delete_secret(secret_name)\n\ - \ deleted_secret = deleted_secret_poller.result()\n\n print(deleted_secret.name)\n\ - \n # if the vault has soft-delete enabled, the secret's, deleted_date\n #\ - \ scheduled purge date and recovery id are set\n print(deleted_secret.deleted_date)\n\ - \ print(deleted_secret.scheduled_purge_date)\n print(deleted_secret.recovery_id)\n\ - \n # if you want to block until secret is deleted server-side, call wait() on\ - \ the poller\n deleted_secret_poller.wait()\n\n ````\n" - uid: azure.keyvault.secrets.SecretClient.begin_recover_deleted_secret name: begin_recover_deleted_secret summary: 'Recover a deleted secret to its latest version. Possible only in a vault @@ -174,18 +141,6 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Recover a deleted secret\n\ - \n\n\n````python\n\n # recover\ - \ deleted secret to the latest version\n recover_secret_poller = secret_client.begin_recover_deleted_secret(secret_name)\n\ - \ recovered_secret = recover_secret_poller.result()\n print(recovered_secret.id)\n\ - \ print(recovered_secret.name)\n\n # if you want to block until secret is\ - \ recovered server-side, call wait() on the poller\n recover_secret_poller.wait()\n\ - \n ````\n" - uid: azure.keyvault.secrets.SecretClient.get_deleted_secret name: get_deleted_secret summary: Get a deleted secret. Possible only in vaults with soft-delete enabled. @@ -205,15 +160,6 @@ methods: description: if the deleted secret doesn't exist, - type: azure.core.exceptions.HttpResponseError description: for other errors - examples: - - "Get a deleted secret\n\ - \n\n\n````python\n\n # gets a deleted\ - \ secret (requires soft-delete enabled for the vault)\n deleted_secret = secret_client.get_deleted_secret(secret_name)\n\ - \ print(deleted_secret.name)\n\n ````\n" - uid: azure.keyvault.secrets.SecretClient.get_secret name: get_secret summary: Get a secret. Requires the secrets/get permission. @@ -238,18 +184,6 @@ methods: description: if the secret doesn't exist, - type: azure.core.exceptions.HttpResponseError description: for other errors - examples: - - "Get a secret\n\n\n\n````python\n\n # get the\ - \ latest version of a secret\n secret = secret_client.get_secret(secret_name)\n\ - \n # alternatively, specify a version\n secret = secret_client.get_secret(secret_name,\ - \ secret.properties.version)\n\n print(secret.id)\n print(secret.name)\n \ - \ print(secret.properties.version)\n print(secret.properties.vault_url)\n\n\ - \ ````\n" - uid: azure.keyvault.secrets.SecretClient.list_deleted_secrets name: list_deleted_secrets summary: 'Lists all deleted secrets. Possible only in vaults with soft-delete enabled. @@ -261,19 +195,6 @@ methods: description: An iterator of deleted secrets, excluding their values types: - [] - examples: - - "List deleted secrets\n\ - \n\n\n````python\n\n # gets an\ - \ iterator of deleted secrets (requires soft-delete enabled for the vault)\n \ - \ deleted_secrets = secret_client.list_deleted_secrets()\n\n for secret in\ - \ deleted_secrets:\n # the list doesn't include values or versions of the\ - \ deleted secrets\n print(secret.id)\n print(secret.name)\n \ - \ print(secret.scheduled_purge_date)\n print(secret.recovery_id)\n \ - \ print(secret.deleted_date)\n\n\n ````\n" - uid: azure.keyvault.secrets.SecretClient.list_properties_of_secret_versions name: list_properties_of_secret_versions summary: 'List properties of all versions of a secret, excluding their values. Requires @@ -293,17 +214,6 @@ methods: description: An iterator of secrets, excluding their values types: - [] - examples: - - "List all versions of a secret\n\n\n\n````python\n\ - \n secret_versions = secret_client.list_properties_of_secret_versions(\"secret-name\"\ - )\n\n for secret in secret_versions:\n # the list doesn't include the\ - \ values at each version\n print(secret.id)\n print(secret.enabled)\n\ - \ print(secret.updated_on)\n\n ````\n" - uid: azure.keyvault.secrets.SecretClient.list_properties_of_secrets name: list_properties_of_secrets summary: 'List identifiers and attributes of all secrets in the vault. Requires @@ -317,16 +227,6 @@ methods: description: An iterator of secrets, excluding their values types: - [] - examples: - - "List all secrets\n\n\ - \n\n````python\n\n # list secrets\n\ - \ secrets = secret_client.list_properties_of_secrets()\n\n for secret in secrets:\n\ - \ # the list doesn't include values or versions of the secrets\n print(secret.id)\n\ - \ print(secret.name)\n print(secret.enabled)\n\n ````\n" - uid: azure.keyvault.secrets.SecretClient.purge_deleted_secret name: purge_deleted_secret summary: 'Permanently deletes a deleted secret. Possible only in vaults with soft-delete @@ -382,15 +282,6 @@ methods: description: if the secret's name is already in use, - type: azure.core.exceptions.HttpResponseError description: for other errors - examples: - - "Restore a backed up secret\n\n\n\n````python\n\ - \n # restores a backed up secret\n restored_secret = secret_client.restore_secret_backup(secret_backup)\n\ - \ print(restored_secret.id)\n print(restored_secret.version)\n\n ````\n" - uid: azure.keyvault.secrets.SecretClient.set_secret name: set_secret summary: 'Set a secret value. If *name* is in use, create a new version of the secret. @@ -436,17 +327,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Set a secret's value\n\ - \n\n\n````python\n\n from dateutil\ - \ import parser as date_parse\n\n expires_on = date_parse.parse(\"2050-02-02T08:00:00.000Z\"\ - )\n\n # create a secret, setting optional arguments\n secret = secret_client.set_secret(secret_name,\ - \ \"secret-value\", expires_on=expires_on)\n\n print(secret.name)\n print(secret.properties.version)\n\ - \ print(secret.properties.expires_on)\n\n ````\n" - uid: azure.keyvault.secrets.SecretClient.update_secret_properties name: update_secret_properties summary: 'Update properties of a secret other than its value. Requires secrets/set @@ -501,15 +381,3 @@ methods: description: if the secret doesn't exist, - type: azure.core.exceptions.HttpResponseError description: for other errors - examples: - - "Update a secret's attributes\n\n\n\n````python\n\ - \n # update attributes of an existing secret\n\n content_type = \"text/plain\"\ - \n tags = {\"foo\": \"updated tag\"}\n updated_secret_properties = secret_client.update_secret_properties(\n\ - \ secret_name, content_type=content_type, tags=tags\n )\n\n print(updated_secret_properties.version)\n\ - \ print(updated_secret_properties.updated_on)\n print(updated_secret_properties.content_type)\n\ - \ print(updated_secret_properties.tags)\n\n ````\n" diff --git a/docs-ref-autogen/azure-keyvault-secrets/azure.keyvault.secrets.aio.SecretClient.yml b/docs-ref-autogen/azure-keyvault-secrets/azure.keyvault.secrets.aio.SecretClient.yml index 734a2689b40b..62ab3f739257 100644 --- a/docs-ref-autogen/azure-keyvault-secrets/azure.keyvault.secrets.aio.SecretClient.yml +++ b/docs-ref-autogen/azure-keyvault-secrets/azure.keyvault.secrets.aio.SecretClient.yml @@ -39,18 +39,6 @@ constructor: Vault domain. Defaults to True.' types: - -examples: -- "Create a new `SecretClient`\n\n\n\n````python\n\n from azure.identity.aio\ - \ import DefaultAzureCredential\n from azure.keyvault.secrets.aio import SecretClient\n\ - \n # Create a SecretClient using default Azure credentials\n credential = DefaultAzureCredential()\n\ - \ secret_client = SecretClient(vault_url, credential)\n\n # the client and credential\ - \ should be closed when no longer needed\n # (both are also async context managers)\n\ - \ await secret_client.close()\n await credential.close()\n\n ````\n" methods: - uid: azure.keyvault.secrets.aio.SecretClient.backup_secret name: backup_secret @@ -71,16 +59,6 @@ methods: description: if the secret doesn't exist, - type: azure.core.exceptions.HttpResponseError description: for other errors - examples: - - "Back up a secret\n\ - \n\n\n````python\n\ - \n # backup secret\n secret_backup = await secret_client.backup_secret(secret_name)\n\ - \n # returns the raw bytes of the backed up secret\n print(secret_backup)\n\ - \n ````\n" - uid: azure.keyvault.secrets.aio.SecretClient.delete_secret name: delete_secret summary: 'Delete all versions of a secret. Requires secrets/delete permission. @@ -102,18 +80,6 @@ methods: description: if the secret doesn't exist, - type: azure.core.exceptions.HttpResponseError description: for other errors - examples: - - "Delete a secret\n\ - \n\n\n````python\n\ - \n # delete a secret\n deleted_secret = await secret_client.delete_secret(secret_name)\n\ - \n print(deleted_secret.name)\n\n # if the vault has soft-delete enabled,\ - \ the secret's deleted_date,\n # scheduled purge date and recovery id are\ - \ set\n print(deleted_secret.deleted_date)\n print(deleted_secret.scheduled_purge_date)\n\ - \ print(deleted_secret.recovery_id)\n\n ````\n" - uid: azure.keyvault.secrets.aio.SecretClient.get_deleted_secret name: get_deleted_secret summary: Get a deleted secret. Possible only in vaults with soft-delete enabled. @@ -133,16 +99,6 @@ methods: description: if the deleted secret doesn't exist, - type: azure.core.exceptions.HttpResponseError description: for other errors - examples: - - "Get a deleted secret\n\n\n\n````python\n\ - \n # gets a deleted secret (requires soft-delete enabled for the vault)\n\ - \ deleted_secret = await secret_client.get_deleted_secret(secret_name)\n\ - \ print(deleted_secret.name)\n\n ````\n" - uid: azure.keyvault.secrets.aio.SecretClient.get_secret name: get_secret summary: Get a secret. Requires the secrets/get permission. @@ -168,18 +124,6 @@ methods: description: if the secret doesn't exist, - type: azure.core.exceptions.HttpResponseError description: for other errors - examples: - - "Get a secret\n\n\ - \n\n````python\n\ - \n # get the latest version of a secret\n secret = await secret_client.get_secret(secret_name)\n\ - \n # alternatively, specify a version\n secret = await secret_client.get_secret(secret_name,\ - \ secret_version)\n\n print(secret.id)\n print(secret.name)\n \ - \ print(secret.properties.version)\n print(secret.properties.vault_url)\n\ - \n ````\n" - uid: azure.keyvault.secrets.aio.SecretClient.list_deleted_secrets name: list_deleted_secrets summary: 'Lists all deleted secrets. Possible only in vaults with soft-delete enabled. @@ -191,20 +135,6 @@ methods: description: An iterator of deleted secrets, excluding their values types: - [] - examples: - - "Lists deleted secrets\n\n\n\n````python\n\ - \n # gets a list of deleted secrets (requires soft-delete enabled for the\ - \ vault)\n deleted_secrets = secret_client.list_deleted_secrets()\n\n \ - \ async for secret in deleted_secrets:\n # the list doesn't include\ - \ values or versions of the deleted secrets\n print(secret.id)\n \ - \ print(secret.name)\n print(secret.scheduled_purge_date)\n \ - \ print(secret.recovery_id)\n print(secret.deleted_date)\n\n\ - \ ````\n" - uid: azure.keyvault.secrets.aio.SecretClient.list_properties_of_secret_versions name: list_properties_of_secret_versions summary: 'List properties of all versions of a secret, excluding their values. Requires @@ -224,17 +154,6 @@ methods: description: An iterator of secrets, excluding their values types: - [] - examples: - - "List all versions of a secret\n\n\n\n````python\n\ - \n # gets a list of all versions of a secret\n secret_versions = secret_client.list_properties_of_secret_versions(\"\ - secret-name\")\n\n async for secret in secret_versions:\n # the\ - \ list doesn't include the versions' values\n print(secret.id)\n \ - \ print(secret.enabled)\n print(secret.updated_on)\n\n ````\n" - uid: azure.keyvault.secrets.aio.SecretClient.list_properties_of_secrets name: list_properties_of_secrets summary: 'List identifiers and attributes of all secrets in the vault. Requires @@ -248,17 +167,6 @@ methods: description: An iterator of secrets types: - [] - examples: - - "Lists all secrets\n\ - \n\n\n````python\n\ - \n # gets a list of secrets in the vault\n secrets = secret_client.list_properties_of_secrets()\n\ - \n async for secret in secrets:\n # the list doesn't include values\ - \ or versions of the secrets\n print(secret.id)\n print(secret.name)\n\ - \ print(secret.enabled)\n\n ````\n" - uid: azure.keyvault.secrets.aio.SecretClient.purge_deleted_secret name: purge_deleted_secret summary: 'Permanently delete a deleted secret. Possible only in vaults with soft-delete @@ -320,16 +228,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Recover a deleted secret\n\n\n\n````python\n\ - \n # recover deleted secret to the latest version\n recovered_secret\ - \ = await secret_client.recover_deleted_secret(secret_name)\n print(recovered_secret.id)\n\ - \ print(recovered_secret.name)\n\n ````\n" - uid: azure.keyvault.secrets.aio.SecretClient.restore_secret_backup name: restore_secret_backup summary: Restore a backed up secret. Requires the secrets/restore permission. @@ -349,16 +247,6 @@ methods: description: if the secret's name is already in use, - type: azure.core.exceptions.HttpResponseError description: for other errors - examples: - - "Restore a backed up secret\n\n\n\n````python\n\ - \n # restores a backed up secret\n restored_secret = await secret_client.restore_secret_backup(secret_backup)\n\ - \ print(restored_secret.id)\n print(restored_secret.version)\n\n \ - \ ````\n" - uid: azure.keyvault.secrets.aio.SecretClient.set_secret name: set_secret summary: 'Set a secret value. If *name* is in use, create a new version of the secret. @@ -404,19 +292,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Set a secret's value\n\n\n\n````python\n\ - \n from dateutil import parser as date_parse\n\n expires_on = date_parse.parse(\"\ - 2050-02-02T08:00:00.000Z\")\n async with secret_client:\n # create a secret,\ - \ setting optional arguments\n secret = await secret_client.set_secret(secret_name,\ - \ \"secret-value\", enabled=True, expires_on=expires_on)\n\n print(secret.id)\n\ - \ print(secret.name)\n print(secret.properties.enabled)\n print(secret.properties.expires_on)\n\ - \n ````\n" - uid: azure.keyvault.secrets.aio.SecretClient.update_secret_properties name: update_secret_properties summary: 'Update properties of a secret other than its value. Requires secrets/set @@ -471,16 +346,3 @@ methods: description: if the secret doesn't exist, - type: azure.core.exceptions.HttpResponseError description: for other errors - examples: - - "Updates a secret's attributes\n\n\n\n````python\n\ - \n # update attributes of an existing secret\n content_type = \"text/plain\"\ - \n tags = {\"foo\": \"updated tag\"}\n updated_secret_properties =\ - \ await secret_client.update_secret_properties(\n secret_name, content_type=content_type,\ - \ tags=tags\n )\n\n print(updated_secret_properties.version)\n \ - \ print(updated_secret_properties.updated_on)\n print(updated_secret_properties.content_type)\n\ - \ print(updated_secret_properties.tags)\n\n ````\n" diff --git a/docs-ref-autogen/azure-monitor-query/azure.monitor.query.LogsQueryClient.yml b/docs-ref-autogen/azure-monitor-query/azure.monitor.query.LogsQueryClient.yml index cf7ee7022a31..0c7fb86df960 100644 --- a/docs-ref-autogen/azure-monitor-query/azure.monitor.query.LogsQueryClient.yml +++ b/docs-ref-autogen/azure-monitor-query/azure.monitor.query.LogsQueryClient.yml @@ -39,33 +39,12 @@ methods: signature: close() -> None - uid: azure.monitor.query.LogsQueryClient.query_batch name: query_batch - summary: "Execute a list of Kusto queries. Each request can be either a LogsBatchQuery\n\ - object or an equivalent serialized model.\n\n**NOTE**: The response is returned\ - \ in the same order as that of the requests sent.\n\nGet a response for multiple\ - \ Log Queries.\n\n\n\n````python\n\n requests =\ - \ [\n LogsBatchQuery(\n query=\"AzureActivity | summarize count()\"\ - ,\n timespan=timedelta(hours=1),\n workspace_id= os.environ['LOGS_WORKSPACE_ID']\n\ - \ ),\n LogsBatchQuery(\n query= \"\"\"bad query\"\"\",\n\ - \ timespan=timedelta(days=1),\n workspace_id= os.environ['LOGS_WORKSPACE_ID']\n\ - \ ),\n LogsBatchQuery(\n query= \"\"\"let Weight = 92233720368547758;\n\ - \ range x from 1 to 3 step 1\n | summarize percentilesw(x,\ - \ Weight * 100, 50)\"\"\",\n workspace_id= os.environ['LOGS_WORKSPACE_ID'],\n\ - \ timespan=(datetime(2021, 6, 2, tzinfo=timezone.utc), datetime(2021,\ - \ 6, 5, tzinfo=timezone.utc)), # (start, end)\n include_statistics=True\n\ - \ ),\n ]\n results = client.query_batch(requests)\n\n for res in results:\n\ - \ if res.status == LogsQueryStatus.FAILURE:\n # this will be a\ - \ LogsQueryError\n print(res)\n elif res.status == LogsQueryStatus.PARTIAL:\n\ - \ ## this will be a LogsQueryPartialResult\n print(res.partial_error)\n\ - \ for table in res.partial_data:\n df = pd.DataFrame(table.rows,\ - \ columns=table.columns)\n print(df)\n elif res.status ==\ - \ LogsQueryStatus.SUCCESS:\n ## this will be a LogsQueryResult\n \ - \ table = res.tables[0]\n df = pd.DataFrame(table.rows, columns=table.columns)\n\ - \ print(df)\n\n\n\n ````" + summary: 'Execute a list of Kusto queries. Each request can be either a LogsBatchQuery + + object or an equivalent serialized model. + + + **NOTE**: The response is returned in the same order as that of the requests sent.' signature: 'query_batch(queries: Sequence[Dict] | Sequence[LogsBatchQuery], **kwargs: Any) -> List[LogsQueryResult | LogsQueryError | LogsQueryPartialResult]' parameters: @@ -91,27 +70,11 @@ methods: - type: azure.core.exceptions.HttpResponseError - uid: azure.monitor.query.LogsQueryClient.query_resource name: query_resource - summary: "Execute a Kusto query on a resource.\n\nReturns all the Azure Monitor\ - \ logs matching the given Kusto query for an Azure resource.\n\nGet a response\ - \ for a single query on a resource's logs.\n\n\n\n````python\n\ - \n import os\n import pandas as pd\n from datetime import timedelta\n \ - \ from azure.core.exceptions import HttpResponseError\n from azure.identity\ - \ import DefaultAzureCredential\n from azure.monitor.query import LogsQueryClient,\ - \ LogsQueryStatus\n\n\n credential = DefaultAzureCredential()\n client =\ - \ LogsQueryClient(credential)\n\n query = \"\"\"AzureActivity | take 5\"\"\"\ - \n\n try:\n response = client.query_resource(os.environ['LOGS_RESOURCE_ID'],\ - \ query, timespan=timedelta(days=1))\n if response.status == LogsQueryStatus.PARTIAL:\n\ - \ error = response.partial_error\n data = response.partial_data\n\ - \ print(error)\n elif response.status == LogsQueryStatus.SUCCESS:\n\ - \ data = response.tables\n for table in data:\n df =\ - \ pd.DataFrame(data=table.rows, columns=table.columns)\n print(df)\n\ - \ except HttpResponseError as err:\n print(\"something fatal happened\"\ - )\n print(err)\n\n\n ````" + summary: 'Execute a Kusto query on a resource. + + + Returns all the Azure Monitor logs matching the given Kusto query for an Azure + resource.' signature: 'query_resource(resource_id: str, query: str, *, timespan: timedelta | Tuple[datetime, timedelta] | Tuple[datetime, datetime] | None, **kwargs: Any) -> LogsQueryResult | LogsQueryPartialResult' diff --git a/docs-ref-autogen/azure-monitor-query/azure.monitor.query.MetricsQueryClient.yml b/docs-ref-autogen/azure-monitor-query/azure.monitor.query.MetricsQueryClient.yml index af0ac11360c7..ba4024865870 100644 --- a/docs-ref-autogen/azure-monitor-query/azure.monitor.query.MetricsQueryClient.yml +++ b/docs-ref-autogen/azure-monitor-query/azure.monitor.query.MetricsQueryClient.yml @@ -5,18 +5,19 @@ fullName: azure.monitor.query.MetricsQueryClient module: azure.monitor.query inheritances: - builtins.object -summary: "MetricsQueryClient should be used to collect numeric data from monitored\ - \ resources into a\ntime series database. Metrics are numerical values that are\ - \ collected at regular intervals and\ndescribe some aspect of a system at a particular\ - \ time. Metrics are lightweight and capable of\nsupporting near real-time scenarios,\ - \ making them particularly useful for alerting and\nfast detection of issues.\n\n\ - Creating the MetricsQueryClient with a TokenCredential.\n\n\n\n````python\n\n credential =\ - \ DefaultAzureCredential()\n\n client = MetricsQueryClient(credential)\n\n ````" +summary: 'MetricsQueryClient should be used to collect numeric data from monitored + resources into a + + time series database. Metrics are numerical values that are collected at regular + intervals and + + describe some aspect of a system at a particular time. Metrics are lightweight and + capable of + + supporting near real-time scenarios, making them particularly useful for alerting + and + + fast detection of issues.' constructor: syntax: 'MetricsQueryClient(credential: TokenCredential, **kwargs: Any)' parameters: diff --git a/docs-ref-autogen/azure-monitor-query/azure.monitor.query.aio.LogsQueryClient.yml b/docs-ref-autogen/azure-monitor-query/azure.monitor.query.aio.LogsQueryClient.yml index ea143c9b89e6..2e484cf869c1 100644 --- a/docs-ref-autogen/azure-monitor-query/azure.monitor.query.aio.LogsQueryClient.yml +++ b/docs-ref-autogen/azure-monitor-query/azure.monitor.query.aio.LogsQueryClient.yml @@ -72,30 +72,11 @@ methods: - type: azure.core.exceptions.HttpResponseError - uid: azure.monitor.query.aio.LogsQueryClient.query_resource name: query_resource - summary: "Execute a Kusto query on a resource.\n\nReturns all the Azure Monitor\ - \ logs matching the given Kusto query for an Azure resource.\n\nGet a response\ - \ for a single query on a resource's logs.\n\n\n\n````python\n\n from datetime\ - \ import timedelta\n import os\n\n import pandas as pd\n\n from azure.core.exceptions\ - \ import HttpResponseError\n from azure.identity.aio import DefaultAzureCredential\n\ - \ from azure.monitor.query.aio import LogsQueryClient\n from azure.monitor.query\ - \ import LogsQueryStatus\n\n\n credential = DefaultAzureCredential()\n client\ - \ = LogsQueryClient(credential)\n\n query = \"\"\"AzureActivity | take 5\"\"\ - \"\n\n async def resource_logs_query():\n async with client:\n \ - \ try:\n response = await client.query_resource(os.environ['LOGS_RESOURCE_ID'],\ - \ query, timespan=timedelta(days=1))\n if response.status == LogsQueryStatus.PARTIAL:\n\ - \ error = response.partial_error\n data =\ - \ response.partial_data\n print(error)\n elif\ - \ response.status == LogsQueryStatus.SUCCESS:\n data = response.tables\n\ - \ for table in data:\n df = pd.DataFrame(data=table.rows,\ - \ columns=table.columns)\n print(df)\n except HttpResponseError\ - \ as err:\n print(\"something fatal happened\")\n \ - \ print(err)\n await credential.close()\n\n\n ````" + summary: 'Execute a Kusto query on a resource. + + + Returns all the Azure Monitor logs matching the given Kusto query for an Azure + resource.' signature: 'async query_resource(resource_id: str, query: str, *, timespan: timedelta | Tuple[datetime, timedelta] | Tuple[datetime, datetime] | None, **kwargs: Any) -> LogsQueryResult | LogsQueryPartialResult' diff --git a/docs-ref-autogen/azure-schemaregistry/azure.schemaregistry.SchemaRegistryClient.yml b/docs-ref-autogen/azure-schemaregistry/azure.schemaregistry.SchemaRegistryClient.yml index 9d36948e15ab..1286f83b63aa 100644 --- a/docs-ref-autogen/azure-schemaregistry/azure.schemaregistry.SchemaRegistryClient.yml +++ b/docs-ref-autogen/azure-schemaregistry/azure.schemaregistry.SchemaRegistryClient.yml @@ -29,18 +29,6 @@ constructor: Default value and only accepted value currently is "2021-10".' types: - -examples: -- "Create a new instance of the SchemaRegistryClient.\n\n\n\n````python\n\n SCHEMAREGISTRY_FQN\ - \ = os.environ[\"SCHEMAREGISTRY_FULLY_QUALIFIED_NAMESPACE\"]\n token_credential\ - \ = DefaultAzureCredential()\n schema_registry_client = SchemaRegistryClient(\n\ - \ fully_qualified_namespace=SCHEMAREGISTRY_FQN, credential=token_credential\n\ - \ )\n\n ````\n" methods: - uid: azure.schemaregistry.SchemaRegistryClient.close name: close @@ -89,25 +77,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Get schema by id.\n\n\n\n````python\n\n schema = schema_registry_client.get_schema(schema_id)\n\ - \ definition = schema.definition\n properties = schema.properties\n\n ````\n\ - \nGet schema by version.\n\n\n\n````python\n\n group_name = os.environ[\"SCHEMAREGISTRY_GROUP\"\ - ]\n name = \"your-schema-name\"\n schema = schema_registry_client.get_schema(group_name=group_name,\ - \ name=name, version=version)\n definition = schema.definition\n properties\ - \ = schema.properties\n\n ````\n" - uid: azure.schemaregistry.SchemaRegistryClient.get_schema_properties name: get_schema_properties summary: 'Gets the schema properties corresponding to an existing schema within @@ -143,23 +112,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Get schema id.\n\n\n\n````python\n\n group_name = os.environ[\"SCHEMAREGISTRY_GROUP\"\ - ]\n name = \"your-schema-name\"\n format = \"Avro\"\n schema_json = {\n\ - \ \"namespace\": \"example.avro\",\n \"type\": \"record\",\n \ - \ \"name\": \"User\",\n \"fields\": [\n {\"name\": \"name\",\ - \ \"type\": \"string\"},\n {\"name\": \"favorite_number\", \"type\"\ - : [\"int\", \"null\"]},\n {\"name\": \"favorite_color\", \"type\": [\"\ - string\", \"null\"]},\n ],\n }\n definition = json.dumps(schema_json,\ - \ separators=(\",\", \":\"))\n schema_properties = schema_registry_client.get_schema_properties(\n\ - \ group_name, name, definition, format\n )\n schema_id = schema_properties.id\n\ - \n ````\n" - uid: azure.schemaregistry.SchemaRegistryClient.register_schema name: register_schema summary: 'Register new schema. If schema of specified name does not exist in specified @@ -199,20 +151,3 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Register a new schema.\n\n\n\n````python\n\n GROUP_NAME = os.environ[\"SCHEMAREGISTRY_GROUP\"\ - ]\n NAME = \"your-schema-name\"\n FORMAT = \"Avro\"\n SCHEMA_JSON = {\n\ - \ \"namespace\": \"example.avro\",\n \"type\": \"record\",\n \ - \ \"name\": \"User\",\n \"fields\": [\n {\"name\": \"name\",\ - \ \"type\": \"string\"},\n {\"name\": \"favorite_number\", \"type\"\ - : [\"int\", \"null\"]},\n {\"name\": \"favorite_color\", \"type\": [\"\ - string\", \"null\"]},\n ],\n }\n DEFINTION = json.dumps(SCHEMA_JSON,\ - \ separators=(\",\", \":\"))\n schema_properties = schema_registry_client.register_schema(\n\ - \ GROUP_NAME, NAME, DEFINTION, FORMAT\n )\n schema_id = schema_properties.id\n\ - \n ````\n" diff --git a/docs-ref-autogen/azure-schemaregistry/azure.schemaregistry.aio.SchemaRegistryClient.yml b/docs-ref-autogen/azure-schemaregistry/azure.schemaregistry.aio.SchemaRegistryClient.yml index 6b9b7389cefa..5f9a281610c1 100644 --- a/docs-ref-autogen/azure-schemaregistry/azure.schemaregistry.aio.SchemaRegistryClient.yml +++ b/docs-ref-autogen/azure-schemaregistry/azure.schemaregistry.aio.SchemaRegistryClient.yml @@ -29,18 +29,6 @@ constructor: Default value and only accepted value currently is "2021-10".' types: - -examples: -- "Create a new instance of the SchemaRegistryClient.\n\n\n\n````python\n\n SCHEMAREGISTRY_FQN\ - \ = os.environ[\"SCHEMAREGISTRY_FULLY_QUALIFIED_NAMESPACE\"]\n token_credential\ - \ = DefaultAzureCredential()\n schema_registry_client = SchemaRegistryClient(\n\ - \ fully_qualified_namespace=SCHEMAREGISTRY_FQN, credential=token_credential\n\ - \ )\n\n ````\n" methods: - uid: azure.schemaregistry.aio.SchemaRegistryClient.close name: close @@ -89,25 +77,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Get schema by id.\n\n\n\n````python\n\n schema = await schema_registry_client.get_schema(schema_id)\n\ - \ definition = schema.definition\n properties = schema.properties\n\n ````\n\ - \nGet schema by version.\n\n\n\n````python\n\n group_name = os.environ[\"SCHEMAREGISTRY_GROUP\"\ - ]\n name = \"your-schema-name\"\n schema = await schema_registry_client.get_schema(group_name=group_name,\ - \ name=name, version=version)\n definition = schema.definition\n properties\ - \ = schema.properties\n\n ````\n" - uid: azure.schemaregistry.aio.SchemaRegistryClient.get_schema_properties name: get_schema_properties summary: 'Gets the schema properties corresponding to an existing schema within @@ -143,23 +112,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Get schema by id.\n\n\n\n````python\n\n group_name = os.environ[\"SCHEMAREGISTRY_GROUP\"\ - ]\n name = \"your-schema-name\"\n format = \"Avro\"\n schema_json = {\n\ - \ \"namespace\": \"example.avro\",\n \"type\": \"record\",\n \ - \ \"name\": \"User\",\n \"fields\": [\n {\"name\": \"name\",\ - \ \"type\": \"string\"},\n {\"name\": \"favorite_number\", \"type\"\ - : [\"int\", \"null\"]},\n {\"name\": \"favorite_color\", \"type\": [\"\ - string\", \"null\"]},\n ],\n }\n definition = json.dumps(schema_json,\ - \ separators=(\",\", \":\"))\n schema_properties = await schema_registry_client.get_schema_properties(\n\ - \ group_name, name, definition, format\n )\n schema_id = schema_properties.id\n\ - \n ````\n" - uid: azure.schemaregistry.aio.SchemaRegistryClient.register_schema name: register_schema summary: 'Register new schema. If schema of specified name does not exist in specified @@ -199,20 +151,3 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Register a new schema.\n\n\n\n````python\n\n GROUP_NAME = os.environ[\"SCHEMAREGISTRY_GROUP\"\ - ]\n NAME = \"your-schema-name\"\n FORMAT = \"Avro\"\n SCHEMA_JSON = {\n\ - \ \"namespace\": \"example.avro\",\n \"type\": \"record\",\n \ - \ \"name\": \"User\",\n \"fields\": [\n {\"name\": \"name\",\ - \ \"type\": \"string\"},\n {\"name\": \"favorite_number\", \"type\"\ - : [\"int\", \"null\"]},\n {\"name\": \"favorite_color\", \"type\": [\"\ - string\", \"null\"]},\n ],\n }\n DEFINITION = json.dumps(SCHEMA_JSON,\ - \ separators=(\",\", \":\"))\n schema_properties = await schema_registry_client.register_schema(\n\ - \ GROUP_NAME, NAME, DEFINITION, FORMAT\n )\n schema_id = schema_properties.id\n\ - \n ````\n" diff --git a/docs-ref-autogen/azure-search-documents/azure.search.documents.SearchClient.yml b/docs-ref-autogen/azure-search-documents/azure.search.documents.SearchClient.yml index 7baca6355d34..90b4ee71cce3 100644 --- a/docs-ref-autogen/azure-search-documents/azure.search.documents.SearchClient.yml +++ b/docs-ref-autogen/azure-search-documents/azure.search.documents.SearchClient.yml @@ -40,18 +40,6 @@ constructor: will be assumed.' types: - -examples: -- "Creating the SearchClient with an API key.\n\n\n\n````python\n\n from azure.core.credentials\ - \ import AzureKeyCredential\n from azure.search.documents import SearchClient\n\ - \n service_endpoint = os.getenv(\"AZURE_SEARCH_SERVICE_ENDPOINT\")\n index_name\ - \ = os.getenv(\"AZURE_SEARCH_INDEX_NAME\")\n key = os.getenv(\"AZURE_SEARCH_API_KEY\"\ - )\n\n search_client = SearchClient(service_endpoint, index_name, AzureKeyCredential(key))\n\ - \n ````\n" methods: - uid: azure.search.documents.SearchClient.autocomplete name: autocomplete @@ -126,19 +114,6 @@ methods: return: types: - [] - examples: - - "Get a auto-completions.\n\ - \n\n\n````python\n\ - \n from azure.core.credentials import AzureKeyCredential\n from azure.search.documents\ - \ import SearchClient\n\n search_client = SearchClient(service_endpoint, index_name,\ - \ AzureKeyCredential(key))\n\n results = search_client.autocomplete(search_text=\"\ - bo\", suggester_name=\"sg\")\n\n print(\"Autocomplete suggestions for 'bo'\"\ - )\n for result in results:\n print(\" Completion: {}\".format(result[\"\ - text\"]))\n\n ````\n" - uid: azure.search.documents.SearchClient.close name: close summary: Close the session. @@ -172,16 +147,6 @@ methods: return: types: - [] - examples: - - "Delete existing documents to an index\n\n\n\n````python\n\ - \n result = search_client.delete_documents(documents=[{\"HotelId\": \"1000\"\ - }])\n\n print(\"Delete new document succeeded: {}\".format(result[0].succeeded))\n\ - \n ````\n" - uid: azure.search.documents.SearchClient.get_document name: get_document summary: Retrieve a document from the Azure search index by its key. @@ -201,20 +166,6 @@ methods: return: types: - - examples: - - "Get a specific document from the search index.\n\n\n\n````python\n\ - \n from azure.core.credentials import AzureKeyCredential\n from azure.search.documents\ - \ import SearchClient\n\n search_client = SearchClient(service_endpoint, index_name,\ - \ AzureKeyCredential(key))\n\n result = search_client.get_document(key=\"23\"\ - )\n\n print(\"Details for hotel '23' are:\")\n print(\" Name: {}\"\ - .format(result[\"HotelName\"]))\n print(\" Rating: {}\".format(result[\"\ - Rating\"]))\n print(\" Category: {}\".format(result[\"Category\"]))\n\n \ - \ ````\n" - uid: azure.search.documents.SearchClient.get_document_count name: get_document_count summary: Return the number of documents in the Azure search index. @@ -260,16 +211,6 @@ methods: return: types: - [] - examples: - - "Merge fields into existing documents to an index\n\n\n\n````python\n\n result = search_client.merge_documents(documents=[{\"\ - HotelId\": \"1000\", \"Rating\": 4.5}])\n\n print(\"Merge into new document\ - \ succeeded: {}\".format(result[0].succeeded))\n\n ````\n" - uid: azure.search.documents.SearchClient.merge_or_upload_documents name: merge_or_upload_documents summary: 'Merge documents in to existing documents in the Azure search index, @@ -451,19 +392,6 @@ methods: return: types: - [] - examples: - - "Get search result facets.\n\ - \n\n\n````python\n\ - \n from azure.core.credentials import AzureKeyCredential\n from azure.search.documents\ - \ import SearchClient\n\n search_client = SearchClient(service_endpoint, index_name,\ - \ AzureKeyCredential(key))\n\n results = search_client.search(search_text=\"\ - WiFi\", facets=[\"Category,count:3\", \"ParkingIncluded\"])\n\n facets = results.get_facets()\n\ - \n print(\"Catgory facet counts for hotels:\")\n for facet in facets[\"Category\"\ - ]:\n print(\" {}\".format(facet))\n\n ````\n" - uid: azure.search.documents.SearchClient.suggest name: suggest summary: "Get search suggestion results from the Azure search index.\n\ncharacter,\ @@ -546,20 +474,6 @@ methods: return: types: - [] - examples: - - "Get search suggestions.\n\ - \n\n\n````python\n\ - \n from azure.core.credentials import AzureKeyCredential\n from azure.search.documents\ - \ import SearchClient\n\n search_client = SearchClient(service_endpoint, index_name,\ - \ AzureKeyCredential(key))\n\n results = search_client.suggest(search_text=\"\ - coffee\", suggester_name=\"sg\")\n\n print(\"Search suggestions for 'coffee'\"\ - )\n for result in results:\n hotel = search_client.get_document(key=result[\"\ - HotelId\"])\n print(\" Text: {} for Hotel: {}\".format(repr(result[\"\ - text\"]), hotel[\"HotelName\"]))\n\n ````\n" - uid: azure.search.documents.SearchClient.upload_documents name: upload_documents summary: 'Upload documents to the Azure search index. @@ -580,15 +494,3 @@ methods: return: types: - [] - examples: - - "Upload new documents to an index\n\n\n\n````python\n\ - \n DOCUMENT = {\n 'Category': 'Hotel',\n 'HotelId': '1000',\n \ - \ 'Rating': 4.0,\n 'Rooms': [],\n 'HotelName': 'Azure Inn',\n\ - \ }\n\n result = search_client.upload_documents(documents=[DOCUMENT])\n\n\ - \ print(\"Upload of new document succeeded: {}\".format(result[0].succeeded))\n\ - \n ````\n" diff --git a/docs-ref-autogen/azure-search-documents/azure.search.documents.aio.SearchClient.yml b/docs-ref-autogen/azure-search-documents/azure.search.documents.aio.SearchClient.yml index 25e78662ee1c..1bee9c000de8 100644 --- a/docs-ref-autogen/azure-search-documents/azure.search.documents.aio.SearchClient.yml +++ b/docs-ref-autogen/azure-search-documents/azure.search.documents.aio.SearchClient.yml @@ -40,19 +40,6 @@ constructor: will be assumed.' types: - -examples: -- "Creating the SearchClient with an API key.\n\n\n\n````python\n\n from azure.core.credentials import\ - \ AzureKeyCredential\n from azure.search.documents.aio import SearchClient\n \ - \ service_endpoint = os.getenv(\"AZURE_SEARCH_SERVICE_ENDPOINT\")\n index_name\ - \ = os.getenv(\"AZURE_SEARCH_INDEX_NAME\")\n key = os.getenv(\"AZURE_SEARCH_API_KEY\"\ - )\n\n search_client = SearchClient(service_endpoint, index_name, AzureKeyCredential(key))\n\ - \n ````\n" methods: - uid: azure.search.documents.aio.SearchClient.autocomplete name: autocomplete @@ -127,20 +114,6 @@ methods: return: types: - [] - examples: - - "Get a auto-completions.\n\n\n\n````python\n\n from azure.core.credentials import AzureKeyCredential\n\ - \ from azure.search.documents.aio import SearchClient\n\n search_client =\ - \ SearchClient(service_endpoint, index_name, AzureKeyCredential(key))\n\n async\ - \ with search_client:\n results = await search_client.autocomplete(search_text=\"\ - bo\", suggester_name=\"sg\")\n\n print(\"Autocomplete suggestions for 'bo'\"\ - )\n for result in results:\n print(\" Completion: {}\".format(result[\"\ - text\"]))\n\n ````\n" - uid: azure.search.documents.aio.SearchClient.close name: close summary: Close the session. @@ -174,16 +147,6 @@ methods: return: types: - [] - examples: - - "Delete existing documents to an index\n\n\n\n````python\n\n result = await\ - \ search_client.upload_documents(documents=[{\"HotelId\": \"1000\"}])\n\n print(\"\ - Delete new document succeeded: {}\".format(result[0].succeeded))\n\n ````\n" - uid: azure.search.documents.aio.SearchClient.get_document name: get_document summary: Retrieve a document from the Azure search index by its key. @@ -203,21 +166,6 @@ methods: return: types: - - examples: - - "Get a specific document from the search index.\n\n\n\n````python\n\n from azure.core.credentials\ - \ import AzureKeyCredential\n from azure.search.documents.aio import SearchClient\n\ - \n search_client = SearchClient(service_endpoint, index_name, AzureKeyCredential(key))\n\ - \n async with search_client:\n result = await search_client.get_document(key=\"\ - 23\")\n\n print(\"Details for hotel '23' are:\")\n print(\" \ - \ Name: {}\".format(result[\"HotelName\"]))\n print(\" Rating: {}\"\ - .format(result[\"Rating\"]))\n print(\" Category: {}\".format(result[\"\ - Category\"]))\n\n ````\n" - uid: azure.search.documents.aio.SearchClient.get_document_count name: get_document_count summary: Return the number of documents in the Azure search index. @@ -264,17 +212,6 @@ methods: return: types: - [] - examples: - - "Merge fields into existing documents to an index\n\n\n\n````python\n\n result = await\ - \ search_client.upload_documents(documents=[{\"HotelId\": \"1000\", \"Rating\"\ - : 4.5}])\n\n print(\"Merge into new document succeeded: {}\".format(result[0].succeeded))\n\ - \n ````\n" - uid: azure.search.documents.aio.SearchClient.merge_or_upload_documents name: merge_or_upload_documents summary: 'Merge documents in to existing documents in the Azure search index, @@ -457,21 +394,6 @@ methods: return: types: - [] - examples: - - "Get search result facets.\n\n\n\n````python\n\n from azure.core.credentials import AzureKeyCredential\n\ - \ from azure.search.documents.aio import SearchClient\n\n search_client =\ - \ SearchClient(service_endpoint, index_name, AzureKeyCredential(key))\n\n async\ - \ with search_client:\n results = await search_client.search(search_text=\"\ - WiFi\", facets=[\"Category,count:3\", \"ParkingIncluded\"])\n\n facets =\ - \ await results.get_facets()\n\n print(\"Catgory facet counts for hotels:\"\ - )\n for facet in facets[\"Category\"]:\n print(\" {}\".format(facet))\n\ - \n ````\n" - uid: azure.search.documents.aio.SearchClient.suggest name: suggest summary: "Get search suggestion results from the Azure search index.\n\ncharacter,\ @@ -555,21 +477,6 @@ methods: return: types: - [] - examples: - - "Get search suggestions.\n\n\n\n````python\n\n from azure.core.credentials import AzureKeyCredential\n\ - \ from azure.search.documents.aio import SearchClient\n\n search_client =\ - \ SearchClient(service_endpoint, index_name, AzureKeyCredential(key))\n\n async\ - \ with search_client:\n results = await search_client.suggest(search_text=\"\ - coffee\", suggester_name=\"sg\")\n\n print(\"Search suggestions for 'coffee'\"\ - )\n for result in results:\n hotel = await search_client.get_document(key=result[\"\ - HotelId\"])\n print(\" Text: {} for Hotel: {}\".format(repr(result[\"\ - text\"]), hotel[\"HotelName\"]))\n\n ````\n" - uid: azure.search.documents.aio.SearchClient.upload_documents name: upload_documents summary: 'Upload documents to the Azure search index. @@ -590,15 +497,3 @@ methods: return: types: - [] - examples: - - "Upload new documents to an index\n\n\n\n````python\n\n DOCUMENT =\ - \ {\n 'Category': 'Hotel',\n 'HotelId': '1000',\n 'Rating':\ - \ 4.0,\n 'Rooms': [],\n 'HotelName': 'Azure Inn',\n }\n\n result\ - \ = await search_client.upload_documents(documents=[DOCUMENT])\n\n print(\"\ - Upload of new document succeeded: {}\".format(result[0].succeeded))\n\n ````\n" diff --git a/docs-ref-autogen/azure-search-documents/azure.search.documents.indexes.SearchIndexClient.yml b/docs-ref-autogen/azure-search-documents/azure.search.documents.indexes.SearchIndexClient.yml index c3d5aa53030c..b953f69d27a7 100644 --- a/docs-ref-autogen/azure-search-documents/azure.search.documents.indexes.SearchIndexClient.yml +++ b/docs-ref-autogen/azure-search-documents/azure.search.documents.indexes.SearchIndexClient.yml @@ -58,19 +58,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Analyze text\n\n\n\n````python\n\n from azure.core.credentials\ - \ import AzureKeyCredential\n from azure.search.documents.indexes import SearchIndexClient\n\ - \ from azure.search.documents.indexes.models import AnalyzeTextOptions\n\n \ - \ client = SearchIndexClient(service_endpoint, AzureKeyCredential(key))\n\n \ - \ analyze_request = AnalyzeTextOptions(text=\"One's \", analyzer_name=\"\ - standard.lucene\")\n\n result = client.analyze_text(index_name, analyze_request)\n\ - \ print(result.as_dict())\n\n ````\n" - uid: azure.search.documents.indexes.SearchIndexClient.close name: close summary: Close the session. @@ -91,24 +78,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Creating a new index.\n\n\n\n````python\n\ - \n name = \"hotels\"\n fields = [\n SimpleField(name=\"hotelId\", type=SearchFieldDataType.String,\ - \ key=True),\n SimpleField(name=\"baseRate\", type=SearchFieldDataType.Double),\n\ - \ SearchableField(name=\"description\", type=SearchFieldDataType.String,\ - \ collection=True),\n ComplexField(name=\"address\", fields=[\n \ - \ SimpleField(name=\"streetAddress\", type=SearchFieldDataType.String),\n \ - \ SimpleField(name=\"city\", type=SearchFieldDataType.String),\n \ - \ ], collection=True)\n ]\n cors_options = CorsOptions(allowed_origins=[\"\ - *\"], max_age_in_seconds=60)\n scoring_profiles = []\n index = SearchIndex(\n\ - \ name=name,\n fields=fields,\n scoring_profiles=scoring_profiles,\n\ - \ cors_options=cors_options)\n\n result = client.create_index(index)\n\ - \n ````\n" - uid: azure.search.documents.indexes.SearchIndexClient.create_or_update_index name: create_or_update_index summary: Creates a new search index or updates an index if it already exists. @@ -150,27 +119,6 @@ methods: - type: azure.core.exceptions.ResourceNotModifiedError - type: azure.core.exceptions.ResourceNotFoundError - type: azure.core.exceptions.ResourceExistsError - examples: - - "Update an index.\n\n\n\n````python\n\ - \n name = \"hotels\"\n fields = [\n SimpleField(name=\"hotelId\", type=SearchFieldDataType.String,\ - \ key=True),\n SimpleField(name=\"baseRate\", type=SearchFieldDataType.Double),\n\ - \ SearchableField(name=\"description\", type=SearchFieldDataType.String,\ - \ collection=True),\n SearchableField(name=\"hotelName\", type=SearchFieldDataType.String),\n\ - \ ComplexField(name=\"address\", fields=[\n SimpleField(name=\"\ - streetAddress\", type=SearchFieldDataType.String),\n SimpleField(name=\"\ - city\", type=SearchFieldDataType.String),\n SimpleField(name=\"state\"\ - , type=SearchFieldDataType.String),\n ], collection=True)\n ]\n cors_options\ - \ = CorsOptions(allowed_origins=[\"*\"], max_age_in_seconds=60)\n scoring_profile\ - \ = ScoringProfile(\n name=\"MyProfile\"\n )\n scoring_profiles = []\n\ - \ scoring_profiles.append(scoring_profile)\n index = SearchIndex(\n \ - \ name=name,\n fields=fields,\n scoring_profiles=scoring_profiles,\n\ - \ cors_options=cors_options)\n\n result = client.create_or_update_index(index=index)\n\ - \n ````\n" - uid: azure.search.documents.indexes.SearchIndexClient.create_or_update_synonym_map name: create_or_update_synonym_map summary: 'Create a new Synonym Map in an Azure Search service, or update an @@ -206,17 +154,6 @@ methods: description: The created Synonym Map types: - - examples: - - "Create a Synonym Map\n\n\n\n````python\n\ - \n synonyms = [\n \"USA, United States, United States of America\",\n\ - \ \"Washington, Wash. => WA\",\n ]\n synonym_map = SynonymMap(name=\"\ - test-syn-map\", synonyms=synonyms)\n result = client.create_synonym_map(synonym_map)\n\ - \ print(\"Create new Synonym Map 'test-syn-map succeeded\")\n\n ````\n" - uid: azure.search.documents.indexes.SearchIndexClient.delete_index name: delete_index summary: 'Deletes a search index and all the documents it contains. The model must @@ -237,14 +174,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Delete an index.\n\n\n\n````python\n\ - \n name = \"hotels\"\n client.delete_index(name)\n\n ````\n" - uid: azure.search.documents.indexes.SearchIndexClient.delete_synonym_map name: delete_synonym_map summary: 'Delete a named Synonym Map in an Azure Search service. To use access conditions, @@ -269,15 +198,6 @@ methods: description: None types: - - examples: - - "Delete a Synonym Map\n\n\n\n````python\n\ - \n client.delete_synonym_map(\"test-syn-map\")\n print(\"Synonym Map 'test-syn-map'\ - \ deleted\")\n\n ````\n" - uid: azure.search.documents.indexes.SearchIndexClient.get_index name: get_index signature: 'get_index(name: str, **kwargs: Any) -> SearchIndex' @@ -293,14 +213,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Get an index.\n\ - \n\n\n````python\n\ - \n name = \"hotels\"\n result = client.get_index(name)\n\n ````\n" - uid: azure.search.documents.indexes.SearchIndexClient.get_index_statistics name: get_index_statistics summary: 'Returns statistics for the given index, including a document count @@ -353,16 +265,6 @@ methods: - exceptions: - type: azure.core.exceptions.ResourceNotFoundError - examples: - - "Get a Synonym Map\n\n\n\n````python\n\ - \n result = client.get_synonym_map(\"test-syn-map\")\n print(\"Retrived Synonym\ - \ Map 'test-syn-map' with synonyms\")\n for syn in result.synonyms:\n \ - \ print(\" {}\".format(syn))\n\n ````\n" - uid: azure.search.documents.indexes.SearchIndexClient.get_synonym_map_names name: get_synonym_map_names summary: List the Synonym Map names in an Azure Search service. @@ -393,16 +295,6 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "List Synonym Maps\n\n\n\n````python\n\ - \n result = client.get_synonym_maps()\n names = [x.name for x in result]\n\ - \ print(\"Found {} Synonym Maps in the service: {}\".format(len(result), \"\ - , \".join(names)))\n\n ````\n" - uid: azure.search.documents.indexes.SearchIndexClient.list_index_names name: list_index_names summary: List the index names in an Azure Search service. diff --git a/docs-ref-autogen/azure-search-documents/azure.search.documents.indexes.SearchIndexerClient.yml b/docs-ref-autogen/azure-search-documents/azure.search.documents.indexes.SearchIndexerClient.yml index 141bb7ec7f65..86950be22355 100644 --- a/docs-ref-autogen/azure-search-documents/azure.search.documents.indexes.SearchIndexerClient.yml +++ b/docs-ref-autogen/azure-search-documents/azure.search.documents.indexes.SearchIndexerClient.yml @@ -55,19 +55,6 @@ methods: description: The created SearchIndexerDataSourceConnection types: - - examples: - - "Create a Data Source\n\n\n\n````python\n\ - \n container = SearchIndexerDataContainer(name='searchcontainer')\n data_source_connection\ - \ = SearchIndexerDataSourceConnection(\n name=\"sample-data-source-connection\"\ - ,\n type=\"azureblob\",\n connection_string=connection_string,\n \ - \ container=container\n )\n result = client.create_data_source_connection(data_source_connection)\n\ - \ print(result)\n print(\"Create new Data Source Connection - sample-data-source-connection\"\ - )\n\n ````\n" - uid: azure.search.documents.indexes.SearchIndexerClient.create_indexer name: create_indexer summary: Creates a new SearchIndexer. @@ -176,16 +163,6 @@ methods: description: None types: - - examples: - - "Delete a SearchIndexerDataSourceConnection\n\n\n\n````python\n\ - \n client.delete_data_source_connection(\"sample-data-source-connection\")\n\ - \ print(\"Data Source Connection 'sample-data-source-connection' successfully\ - \ deleted\")\n\n ````\n" - uid: azure.search.documents.indexes.SearchIndexerClient.delete_indexer name: delete_indexer summary: 'Deletes an indexer. To use access conditions, the SearchIndexer model @@ -245,16 +222,6 @@ methods: description: The SearchIndexerDataSourceConnection that is fetched. types: - - examples: - - "Retrieve a SearchIndexerDataSourceConnection\n\n\n\n````python\n\ - \n result = client.get_data_source_connection(\"sample-data-source-connection\"\ - )\n print(\"Retrived Data Source Connection 'sample-data-source-connection'\"\ - )\n\n ````\n" - uid: azure.search.documents.indexes.SearchIndexerClient.get_data_source_connection_names name: get_data_source_connection_names summary: Lists all data source connection names available for a search service. @@ -281,16 +248,6 @@ methods: description: List of all the data source connections. types: - [] - examples: - - "List all the SearchIndexerDataSourceConnections\n\n\n\n````python\n\n result = client.get_data_source_connections()\n\ - \ names = [ds.name for ds in result]\n print(\"Found {} Data Source Connections\ - \ in the service: {}\".format(len(result), \", \".join(names)))\n\n ````\n" - uid: azure.search.documents.indexes.SearchIndexerClient.get_indexer name: get_indexer summary: Retrieves a indexer definition. diff --git a/docs-ref-autogen/azure-search-documents/azure.search.documents.indexes.aio.SearchIndexClient.yml b/docs-ref-autogen/azure-search-documents/azure.search.documents.indexes.aio.SearchIndexClient.yml index 46f21901deaa..4501840d6be1 100644 --- a/docs-ref-autogen/azure-search-documents/azure.search.documents.indexes.aio.SearchIndexClient.yml +++ b/docs-ref-autogen/azure-search-documents/azure.search.documents.indexes.aio.SearchIndexClient.yml @@ -58,20 +58,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Analyze text\n\n\n\n````python\n\n from azure.core.credentials import AzureKeyCredential\n\ - \ from azure.search.documents.indexes.aio import SearchIndexClient\n from\ - \ azure.search.documents.indexes.models import AnalyzeTextOptions\n\n client\ - \ = SearchIndexClient(service_endpoint, AzureKeyCredential(key))\n\n analyze_request\ - \ = AnalyzeTextOptions(text=\"One's \", analyzer_name=\"standard.lucene\"\ - )\n\n async with client:\n result = await client.analyze_text(index_name,\ - \ analyze_request)\n print(result.as_dict())\n\n ````\n" - uid: azure.search.documents.indexes.aio.SearchIndexClient.close name: close summary: Close the session. @@ -92,24 +78,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Creating a new index.\n\n\n\n````python\n\n name = \"hotels\"\n fields = [\n \ - \ SimpleField(name=\"hotelId\", type=SearchFieldDataType.String, key=True),\n\ - \ SimpleField(name=\"baseRate\", type=SearchFieldDataType.Double),\n \ - \ SearchableField(name=\"description\", type=SearchFieldDataType.String, collection=True),\n\ - \ ComplexField(name=\"address\", fields=[\n SimpleField(name=\"\ - streetAddress\", type=SearchFieldDataType.String),\n SimpleField(name=\"\ - city\", type=SearchFieldDataType.String),\n ], collection=True)\n ]\n\n\ - \ cors_options = CorsOptions(allowed_origins=[\"*\"], max_age_in_seconds=60)\n\ - \ scoring_profiles = []\n index = SearchIndex(\n name=name,\n \ - \ fields=fields,\n scoring_profiles=scoring_profiles,\n cors_options=cors_options)\n\ - \n result = await client.create_index(index)\n\n ````\n" - uid: azure.search.documents.indexes.aio.SearchIndexClient.create_or_update_index name: create_or_update_index summary: Creates a new search index or updates an index if it already exists. @@ -151,28 +119,6 @@ methods: - type: azure.core.exceptions.ResourceNotModifiedError - type: azure.core.exceptions.ResourceNotFoundError - type: azure.core.exceptions.ResourceExistsError - examples: - - "Update an index.\n\n\n\n````python\n\n name = \"hotels\"\n fields = [\n \ - \ SimpleField(name=\"hotelId\", type=SearchFieldDataType.String, key=True),\n\ - \ SimpleField(name=\"baseRate\", type=SearchFieldDataType.Double),\n \ - \ SearchableField(name=\"description\", type=SearchFieldDataType.String, collection=True),\n\ - \ SearchableField(name=\"hotelName\", type=SearchFieldDataType.String),\n\ - \ ComplexField(name=\"address\", fields=[\n SimpleField(name=\"\ - streetAddress\", type=SearchFieldDataType.String),\n SimpleField(name=\"\ - city\", type=SearchFieldDataType.String),\n SimpleField(name=\"state\"\ - , type=SearchFieldDataType.String),\n ], collection=True)\n ]\n\n cors_options\ - \ = CorsOptions(allowed_origins=[\"*\"], max_age_in_seconds=60)\n scoring_profile\ - \ = ScoringProfile(\n name=\"MyProfile\"\n )\n scoring_profiles = []\n\ - \ scoring_profiles.append(scoring_profile)\n index = SearchIndex(\n \ - \ name=name,\n fields=fields,\n scoring_profiles=scoring_profiles,\n\ - \ cors_options=cors_options)\n\n result = await client.create_or_update_index(index=index)\n\ - \n ````\n" - uid: azure.search.documents.indexes.aio.SearchIndexClient.create_or_update_synonym_map name: create_or_update_synonym_map summary: 'Create a new Synonym Map in an Azure Search service, or update an @@ -209,17 +155,6 @@ methods: description: The created Synonym Map types: - - examples: - - "Create a Synonym Map\n\n\n\n````python\n\n synonyms = [\n \"USA, United States,\ - \ United States of America\",\n \"Washington, Wash. => WA\",\n ]\n synonym_map\ - \ = SynonymMap(name=\"test-syn-map\", synonyms=synonyms)\n result = await client.create_synonym_map(synonym_map)\n\ - \ print(\"Create new Synonym Map 'test-syn-map succeeded\")\n\n ````\n" - uid: azure.search.documents.indexes.aio.SearchIndexClient.delete_index name: delete_index summary: 'Deletes a search index and all the documents it contains. The model must @@ -240,15 +175,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Delete an index.\n\n\n\n````python\n\n name = \"hotels\"\n await client.delete_index(name)\n\ - \n ````\n" - uid: azure.search.documents.indexes.aio.SearchIndexClient.delete_synonym_map name: delete_synonym_map summary: 'Delete a named Synonym Map in an Azure Search service. To use access conditions, @@ -273,15 +199,6 @@ methods: description: None types: - - examples: - - "Delete a Synonym Map\n\n\n\n````python\n\n await client.delete_synonym_map(\"test-syn-map\"\ - )\n print(\"Synonym Map 'test-syn-map' deleted\")\n\n ````\n" - uid: azure.search.documents.indexes.aio.SearchIndexClient.get_index name: get_index signature: 'async get_index(name: str, **kwargs: Any) -> SearchIndex' @@ -297,15 +214,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Get an index.\n\n\n\n````python\n\n name = \"hotels\"\n result = await\ - \ client.get_index(name)\n\n ````\n" - uid: azure.search.documents.indexes.aio.SearchIndexClient.get_index_statistics name: get_index_statistics summary: 'Returns statistics for the given index, including a document count @@ -358,17 +266,6 @@ methods: - exceptions: - type: azure.core.exceptions.ResourceNotFoundError - examples: - - "Get a Synonym Map\n\n\n\n````python\n\n result = await client.get_synonym_map(\"\ - test-syn-map\")\n print(\"Retrived Synonym Map 'test-syn-map' with synonyms\"\ - )\n for syn in result.synonyms:\n print(\" {}\".format(syn))\n\n \ - \ ````\n" - uid: azure.search.documents.indexes.aio.SearchIndexClient.get_synonym_map_names name: get_synonym_map_names summary: List the Synonym Map names in an Azure Search service. @@ -399,16 +296,6 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "List Synonym Maps\n\n\n\n````python\n\n result = await client.get_synonym_maps()\n\ - \ names = [x.name for x in result]\n print(\"Found {} Synonym Maps in the\ - \ service: {}\".format(len(result), \", \".join(names)))\n\n ````\n" - uid: azure.search.documents.indexes.aio.SearchIndexClient.list_index_names name: list_index_names summary: List the index names in an Azure Search service. diff --git a/docs-ref-autogen/azure-search-documents/azure.search.documents.indexes.aio.SearchIndexerClient.yml b/docs-ref-autogen/azure-search-documents/azure.search.documents.indexes.aio.SearchIndexerClient.yml index bf8179866f21..4a5c6850b704 100644 --- a/docs-ref-autogen/azure-search-documents/azure.search.documents.indexes.aio.SearchIndexerClient.yml +++ b/docs-ref-autogen/azure-search-documents/azure.search.documents.indexes.aio.SearchIndexerClient.yml @@ -55,20 +55,6 @@ methods: :rtype: ~azure.search.documents.indexes.models.SearchIndexerDataSourceConnection' signature: 'async create_data_source_connection(data_source_connection: SearchIndexerDataSourceConnection, **kwargs: Any) -> SearchIndexerDataSourceConnection' - examples: - - "Create a SearchIndexerDataSourceConnection\n\n\n\n````python\n\n container\ - \ = SearchIndexerDataContainer(name='searchcontainer')\n data_source = SearchIndexerDataSourceConnection(\n\ - \ name=\"async-sample-data-source-connection\",\n type=\"azureblob\"\ - ,\n connection_string=connection_string,\n container=container\n \ - \ )\n result = await client.create_data_source_connection(data_source)\n \ - \ print(\"Create new Data Source Connection - async-sample-data-source-connection\"\ - )\n\n ````\n" - uid: azure.search.documents.indexes.aio.SearchIndexerClient.create_indexer name: create_indexer summary: Creates a new SearchIndexer. @@ -246,15 +232,7 @@ methods: return: description: The SearchIndexerDataSourceConnection that is fetched. types: - - '[[]()][], [], [], [], [], , - , , , - , ()()' + - - uid: azure.search.documents.indexes.aio.SearchIndexerClient.get_data_source_connection_names name: get_data_source_connection_names summary: Lists all data source connection names available for a search service. @@ -271,17 +249,6 @@ methods: description: List of all the data source connections. types: - [] - examples: - - "List all SearchIndexerDataSourceConnections\n\n\n\n````python\n\n result = await\ - \ client.get_data_source_connections()\n names = [x.name for x in result]\n\ - \ print(\"Found {} Data Source Connections in the service: {}\".format(len(result),\ - \ \", \".join(names)))\n\n ````\n" - uid: azure.search.documents.indexes.aio.SearchIndexerClient.get_indexer name: get_indexer summary: Retrieves a indexer definition. diff --git a/docs-ref-autogen/azure-security-attestation/azure.security.attestation.AttestationAdministrationClient.yml b/docs-ref-autogen/azure-security-attestation/azure.security.attestation.AttestationAdministrationClient.yml index dd919e2e7153..2ae7b5b78f3b 100644 --- a/docs-ref-autogen/azure-security-attestation/azure.security.attestation.AttestationAdministrationClient.yml +++ b/docs-ref-autogen/azure-security-attestation/azure.security.attestation.AttestationAdministrationClient.yml @@ -193,21 +193,6 @@ methods: types: - [, ] - examples: - - "Adding a policy management certificate.\n\n\n\n````python\n\ - \n new_key = create_rsa_key()\n new_certificate = create_x509_certificate(new_key,\ - \ u\"NewCertificateName\")\n\n # Add the new certificate to the list. Specify\ - \ a validation slack of\n # 1.0 to test passing in validation parameters to\ - \ this method.\n add_result, _ = admin_client.add_policy_management_certificate(\n\ - \ new_certificate,\n signing_key=self.isolated_key,\n signing_certificate=self.isolated_certificate,\n\ - \ validation_slack=1.0,\n )\n if add_result.certificate_resolution !=\ - \ CertificateModification.IS_PRESENT:\n raise Exception(\"Certificate was\ - \ not added!\")\n\n\n ````\n" - uid: azure.security.attestation.AttestationAdministrationClient.close name: close signature: close() -> None @@ -283,16 +268,6 @@ methods: description: 'Raised when an attestation token is invalid.' - examples: - - "Getting the current policy document.\n\n\n\n````python\n\ - \n with AttestationAdministrationClient(\n os.environ.get(\"ATTESTATION_AAD_URL\"\ - ), DefaultAzureCredential()\n ) as admin_client:\n policy, _ = admin_client.get_policy(AttestationType.SGX_ENCLAVE)\n\ - \ print(\"Current instance SGX Policy is: \", policy)\n\n ````\n" - uid: azure.security.attestation.AttestationAdministrationClient.get_policy_management_certificates name: get_policy_management_certificates summary: 'Retrieves the set of policy management certificates for the instance. @@ -362,27 +337,6 @@ methods: and an attestation token. types: - [[[]], ] - examples: - - "Retrieving the policy management certificates.\n\n\n\n````python\n\ - \n print(\"Get the policy management certificates for a isolated instance.\"\ - )\n\n endpoint = os.environ.get(\"ATTESTATION_ISOLATED_URL\")\n with AttestationAdministrationClient(\n\ - \ endpoint, DefaultAzureCredential()\n ) as admin_client:\n certificates,\ - \ _ = admin_client.get_policy_management_certificates(\n validation_slack=1.0\n\ - \ )\n print(\"Isolated instance has\", len(certificates), \"certificates\"\ - )\n\n # An Isolated attestation instance should have at least one signing\n\ - \ # certificate which is configured when the instance is created.\n \ - \ #\n # Note that the certificate list returned is an array of certificate\ - \ chains.\n for cert_chain in certificates:\n print(\"Certificate\ - \ chain has \", len(cert_chain), \" elements.\")\n i = 1\n \ - \ for cert in cert_chain:\n # load_pem_x509_certifcate takes a\ - \ bytes, not str, so convert.\n certificate = load_pem_x509_certificate(cert.encode(\"\ - ascii\"))\n print(\" Certificate\", i, \"subject:\", certificate.subject)\n\ - \ i += 1\n\n\n ````\n" - uid: azure.security.attestation.AttestationAdministrationClient.remove_policy_management_certificate name: remove_policy_management_certificate summary: 'Removes a policy management certificate from the set of policy management @@ -480,21 +434,6 @@ methods: types: - [, ] - examples: - - "Removing a policy management certificate.\n\n\n\n````python\n\ - \n with AttestationAdministrationClient(\n endpoint, DefaultAzureCredential()\n\ - \ ) as admin_client:\n # Now remove the certificate we just added.\n \ - \ print(\"Remove the newly added certificate.\")\n remove_result, _\ - \ = admin_client.remove_policy_management_certificate(\n new_certificate,\n\ - \ signing_key=self.isolated_key,\n signing_certificate=self.isolated_certificate,\n\ - \ )\n\n if (\n remove_result.certificate_resolution\n \ - \ != CertificateModification.IS_ABSENT\n ):\n raise Exception(\"\ - Certificate was not removed!\")\n\n ````\n" - uid: azure.security.attestation.AttestationAdministrationClient.reset_policy name: reset_policy summary: "Resets the attestation policy for the specified attestation type to the\ @@ -578,20 +517,6 @@ methods: description: 'Raised when an attestation token is invalid.' - examples: - - "Resetting an AAD mode attestation instance.\n\n\n\n````python\n\ - \n print(\"Set Secured Policy on an Isolated mode attestation instance.\")\n\ - \ # < Load the PEM encoded isolated signing certificate and key >\n with\ - \ AttestationAdministrationClient(\n os.environ.get(\"ATTESTATION_ISOLATED_URL\"\ - ), DefaultAzureCredential()\n ) as admin_client:\n set_result, _ = admin_client.reset_policy(\n\ - \ AttestationType.SGX_ENCLAVE,\n signing_key=isolated_key,\n\ - \ signing_certificate=isolated_certificate,\n )\n print(\"\ - Policy Set Resolution: \", set_result.policy_resolution)\n\n ````\n" - uid: azure.security.attestation.AttestationAdministrationClient.set_policy name: set_policy summary: "Sets the attestation policy for the specified attestation type.\n\n> [!NOTE]\n\ @@ -677,37 +602,3 @@ methods: description: 'Raised when an attestation token is invalid.' - examples: - - "Setting the attestation policy with hash verification.\n\n\n\n````python\n\n from cryptography.hazmat.primitives\ - \ import hashes\n\n write_banner(\"set_policy_aad_secured\")\n \ - \ print(\"Set Secured Policy on an AAD mode attestation instance.\")\n \ - \ with AttestationAdministrationClient(\n os.environ.get(\"\ - ATTESTATION_AAD_URL\"), DefaultAzureCredential()\n ) as admin_client:\n\ - \ # Create an RSA Key and wrap an X.509 certificate around\n \ - \ # the public key for that certificate.\n rsa_key =\ - \ create_rsa_key()\n cert = create_x509_certificate(rsa_key, u\"\ - TestCertificate\")\n\n # Set a minimal policy.\n policy_to_set\ - \ = \"\"\"\n version= 1.0;\n authorizationrules{=> permit();};\n issuancerules\ - \ {};\n \"\"\"\n set_result, _ = admin_client.set_policy(\n \ - \ AttestationType.SGX_ENCLAVE,\n policy_to_set,\n\ - \ signing_key=rsa_key,\n signing_certificate=cert,\n\ - \ )\n print(\"Policy Set Resolution: \", set_result.policy_resolution)\n\ - \ print(\"Resulting policy signer should match the input certificate:\"\ - )\n print(\"Policy Signer: \", set_result.policy_signer.certificates[0])\n\ - \ print(\"Certificate: \", cert)\n\n # Create an\ - \ Attestation Token object representing the\n # attestation policy.\n\ - \ expected_policy = AttestationPolicyToken(\n \ - \ policy_to_set, signing_key=rsa_key, signing_certificate=cert\n \ - \ )\n\n # Generate the Sha256 hash of the attestation token.\n\ - \ hasher = hashes.Hash(hashes.SHA256(), backend=default_backend())\n\ - \ hasher.update(expected_policy.to_jwt_string().encode(\"utf-8\"\ - ))\n expected_hash = hasher.finalize()\n\n print(\"\ - Expected hash should match returned hash.\")\n print(\"Expected\ - \ hash: \", expected_hash)\n print(\"Returned hash: \", set_result.policy_token_hash)\n\ - \n\n ````\n" diff --git a/docs-ref-autogen/azure-security-attestation/azure.security.attestation.AttestationClient.yml b/docs-ref-autogen/azure-security-attestation/azure.security.attestation.AttestationClient.yml index f102ac882cea..db2ac2077a30 100644 --- a/docs-ref-autogen/azure-security-attestation/azure.security.attestation.AttestationClient.yml +++ b/docs-ref-autogen/azure-security-attestation/azure.security.attestation.AttestationClient.yml @@ -203,25 +203,6 @@ methods: claims in the returned attestation token. types: - [, ] - examples: - - "Attesting using a draft attestation policy.\n\n\n\n````python\n\ - \n draft_policy = \"\"\"\n version= 1.0;\n authorizationrules\n {\n \ - \ [ type==\"x-ms-sgx-is-debuggable\", value==false ] &&\n [ type==\"\ - x-ms-sgx-product-id\", value==1 ] &&\n [ type==\"x-ms-sgx-svn\", value>=\ - \ 0 ] &&\n [ type==\"x-ms-sgx-mrsigner\", value==\"2c1a44952ae8207135c6c29b75b8c029372ee94b677e15c20bd42340f10d41aa\"\ - ]\n => permit();\n };\n issuancerules {\n c:[type==\"x-ms-sgx-mrsigner\"\ - ] => issue(type=\"My-MrSigner\", value=c.value);\n };\n \"\"\"\n print(\"\ - Attest Open enclave using \", self.shared_url)\n print(\"Using draft policy:\"\ - , draft_policy)\n with AttestationClient(\n self.shared_url, DefaultAzureCredential()\n\ - \ ) as attest_client:\n response, token = attest_client.attest_open_enclave(\n\ - \ oe_report, runtime_data=runtime_data, draft_policy=draft_policy\n\ - \ )\n\n print(\"Token algorithm\", token.algorithm)\n print(\"\ - Issuer of token is: \", response.issuer)\n\n ````\n" - uid: azure.security.attestation.AttestationClient.attest_sgx_enclave name: attest_sgx_enclave summary: 'Attests the validity of an SGX quote. @@ -331,18 +312,6 @@ methods: claims in the returned attestation token. types: - [, ] - examples: - - "Attesting an SGX Enclave\n\n\n\n````python\n\ - \n print(\"\\nAttest SGX enclave using {}\".format(self.shared_url))\n with\ - \ AttestationClient(\n self.shared_url, DefaultAzureCredential()\n ) as\ - \ attest_client:\n response, _ = attest_client.attest_sgx_enclave(\n \ - \ quote, runtime_data=runtime_data\n )\n\n print(\"Issuer of token\ - \ is: \", response.issuer)\n\n ````\n" - uid: azure.security.attestation.AttestationClient.attest_tpm name: attest_tpm summary: 'Attest a TPM based enclave. diff --git a/docs-ref-autogen/azure-security-attestation/azure.security.attestation.aio.AttestationAdministrationClient.yml b/docs-ref-autogen/azure-security-attestation/azure.security.attestation.aio.AttestationAdministrationClient.yml index c55433c58067..1f46b2002f59 100644 --- a/docs-ref-autogen/azure-security-attestation/azure.security.attestation.aio.AttestationAdministrationClient.yml +++ b/docs-ref-autogen/azure-security-attestation/azure.security.attestation.aio.AttestationAdministrationClient.yml @@ -191,23 +191,6 @@ methods: types: - [, ] - examples: - - "Adding a policy management certificate.\n\n\n\n````python\n\ - \n async with DefaultAzureCredential() as credential, AttestationAdministrationClient(\n\ - \ endpoint, credential\n ) as admin_client:\n \ - \ new_key = create_rsa_key()\n new_certificate = create_x509_certificate(new_key,\ - \ u\"NewCertificateName\")\n\n # Add the new certificate to the\ - \ list.\n add_result, _ = await admin_client.add_policy_management_certificate(\n\ - \ new_certificate,\n signing_key=self.isolated_key,\n\ - \ signing_certificate=self.isolated_certificate,\n \ - \ validation_slack=1.0,\n )\n if add_result.certificate_resolution\ - \ != CertificateModification.IS_PRESENT:\n raise Exception(\"\ - Certificate was not added!\")\n\n ````\n" - uid: azure.security.attestation.aio.AttestationAdministrationClient.close name: close signature: async close() -> None @@ -283,17 +266,6 @@ methods: description: 'Raised when an attestation token is invalid.' - examples: - - "Getting the current policy document.\n\n\n\n````python\n\ - \n async with DefaultAzureCredential() as credential, AttestationAdministrationClient(\n\ - \ os.environ.get(\"ATTESTATION_AAD_URL\"), credential\n ) as admin_client:\n\ - \ policy, _ = await admin_client.get_policy(AttestationType.SGX_ENCLAVE)\n\ - \ print(\"Current instance SGX Policy is: \", policy)\n\n ````\n" - uid: azure.security.attestation.aio.AttestationAdministrationClient.get_policy_management_certificates name: get_policy_management_certificates summary: 'Retrieves the set of policy management certificates for the instance. @@ -363,27 +335,6 @@ methods: and an attestation token. types: - [[[]], ] - examples: - - "Retrieving the policy management certificates.\n\n\n\n````python\n\ - \n print(\"Get the policy management certificates for a isolated instance.\"\ - )\n async with DefaultAzureCredential() as credential, AttestationAdministrationClient(\n\ - \ os.environ.get(\"ATTESTATION_ISOLATED_URL\"), credential\n ) as admin_client:\n\ - \ certificates, _ = await admin_client.get_policy_management_certificates()\n\ - \ print(\"Isolated instance has\", len(certificates), \"certificates\")\n\ - \n # An Isolated attestation instance should have at least one signing\n\ - \ # certificate which is configured when the instance is created.\n \ - \ #\n # Note that the certificate list returned is an array of certificate\ - \ chains.\n for cert_chain in certificates:\n print(\"Certificate\ - \ chain has \", len(cert_chain), \" elements.\")\n i = 1\n \ - \ for cert in cert_chain:\n # load_pem_x509_certifcate takes a\ - \ bytes, not str, so convert.\n certificate = load_pem_x509_certificate(cert.encode(\"\ - ascii\"))\n print(\" Certificate\", i, \"subject:\", certificate.subject)\n\ - \ i += 1\n\n ````\n" - uid: azure.security.attestation.aio.AttestationAdministrationClient.remove_policy_management_certificate name: remove_policy_management_certificate summary: 'Removes a policy management certificate from the set of policy management @@ -481,20 +432,6 @@ methods: types: - [, ] - examples: - - "Removing a policy management certificate.\n\n\n\n````python\n\ - \n async with DefaultAzureCredential() as credential, AttestationAdministrationClient(\n\ - \ endpoint, credential\n ) as admin_client:\n remove_result, _ =\ - \ await admin_client.remove_policy_management_certificate(\n new_certificate,\n\ - \ signing_key=self.isolated_key,\n signing_certificate=self.isolated_certificate,\n\ - \ )\n\n if (\n remove_result.certificate_resolution\n \ - \ != CertificateModification.IS_ABSENT\n ):\n raise Exception(\"\ - Certificate was not removed!\")\n\n ````\n" - uid: azure.security.attestation.aio.AttestationAdministrationClient.reset_policy name: reset_policy summary: "Resets the attestation policy for the specified attestation type to the\ @@ -661,37 +598,3 @@ methods: description: 'Raised when an attestation token is invalid.' - examples: - - "Setting the attestation policy with hash verification.\n\n\n\n````python\n\n from cryptography.hazmat.primitives\ - \ import hashes\n\n write_banner(\"set_policy_aad_secured\")\n \ - \ print(\"Set Secured Policy on an AAD mode attestation instance.\")\n \ - \ async with DefaultAzureCredential() as credential, AttestationAdministrationClient(\n\ - \ os.environ.get(\"ATTESTATION_AAD_URL\"), credential\n \ - \ ) as admin_client:\n # Create an RSA Key and wrap an X.509 certificate\ - \ around\n # the public key for that certificate.\n \ - \ rsa_key = create_rsa_key()\n cert = create_x509_certificate(rsa_key,\ - \ u\"TestCertificate\")\n\n # Set a minimal policy.\n \ - \ policy_to_set = \"\"\"\n version= 1.0;\n authorizationrules{=> permit();};\n\ - \ issuancerules {};\n \"\"\"\n set_result, _ = await admin_client.set_policy(\n\ - \ AttestationType.SGX_ENCLAVE,\n policy_to_set,\n\ - \ signing_key=rsa_key,\n signing_certificate=cert,\n\ - \ )\n print(\"Policy Set Resolution: \", set_result.policy_resolution)\n\ - \ print(\"Resulting policy signer should match the input certificate:\"\ - )\n print(\"Policy Signer: \", set_result.policy_signer.certificates[0])\n\ - \ print(\"Certificate: \", cert)\n\n # Create an\ - \ Attestation Token object representing the stored\n # attestation\ - \ policy.\n expected_policy = AttestationPolicyToken(\n \ - \ policy_to_set,\n signing_key=rsa_key,\n \ - \ signing_certificate=cert,\n )\n\n # Generate\ - \ the Sha256 hash of the attestation token.\n hasher = hashes.Hash(hashes.SHA256(),\ - \ backend=default_backend())\n hasher.update(expected_policy.to_jwt_string().encode(\"\ - utf-8\"))\n expected_hash = hasher.finalize()\n\n \ - \ print(\"Expected hash should match returned hash.\")\n print(\"\ - Expected hash: \", expected_hash)\n print(\"Returned hash: \", set_result.policy_token_hash)\n\ - \n ````\n" diff --git a/docs-ref-autogen/azure-security-attestation/azure.security.attestation.aio.AttestationClient.yml b/docs-ref-autogen/azure-security-attestation/azure.security.attestation.aio.AttestationClient.yml index 29d7f58bcc89..abbcd226c516 100644 --- a/docs-ref-autogen/azure-security-attestation/azure.security.attestation.aio.AttestationClient.yml +++ b/docs-ref-autogen/azure-security-attestation/azure.security.attestation.aio.AttestationClient.yml @@ -203,25 +203,6 @@ methods: the claims in the returned attestation token. types: - [, ] - examples: - - "Attesting using a draft attestation policy.\n\n\n\n````python\n\ - \n draft_policy = \"\"\"\n version= 1.0;\n authorizationrules\n {\n \ - \ [ type==\"x-ms-sgx-is-debuggable\", value==false ] &&\n [ type==\"\ - x-ms-sgx-product-id\", value==1 ] &&\n [ type==\"x-ms-sgx-svn\", value>=\ - \ 0 ] &&\n [ type==\"x-ms-sgx-mrsigner\", value==\"2c1a44952ae8207135c6c29b75b8c029372ee94b677e15c20bd42340f10d41aa\"\ - ]\n => permit();\n };\n issuancerules {\n c:[type==\"x-ms-sgx-mrsigner\"\ - ] => issue(type=\"My-MrSigner\", value=c.value);\n };\n \"\"\"\n print(\"\ - Attest Open enclave using \", self.shared_url)\n print(\"Using draft policy:\"\ - , draft_policy)\n async with DefaultAzureCredential() as credential, AttestationClient(\n\ - \ self.shared_url, credential\n ) as attest_client:\n response,\ - \ token = await attest_client.attest_open_enclave(\n oe_report, runtime_data=runtime_data,\ - \ draft_policy=draft_policy\n )\n\n print(\"Token algorithm\", token.algorithm)\n\ - \ print(\"Issuer of token is: \", response.issuer)\n\n ````\n" - uid: azure.security.attestation.aio.AttestationClient.attest_sgx_enclave name: attest_sgx_enclave summary: 'Attests the validity of an SGX quote. @@ -332,18 +313,6 @@ methods: the claims in the returned attestation token. types: - [, ] - examples: - - "Attesting an SGX Enclave\n\n\n\n````python\n\ - \n print(\"\\nAttest SGX enclave using {}\".format(self.shared_url))\n async\ - \ with DefaultAzureCredential() as credential, AttestationClient(\n self.shared_url,\ - \ credential\n ) as attest_client:\n response, _ = await attest_client.attest_sgx_enclave(\n\ - \ quote, runtime_data=runtime_data\n )\n\n print(\"Issuer of\ - \ token is: \", response.issuer)\n\n ````\n" - uid: azure.security.attestation.aio.AttestationClient.attest_tpm name: attest_tpm summary: 'Attest a TPM based enclave. diff --git a/docs-ref-autogen/azure-servicebus/azure.servicebus.AutoLockRenewer.yml b/docs-ref-autogen/azure-servicebus/azure.servicebus.AutoLockRenewer.yml index 1131b646f3ed..01da8d4cd545 100644 --- a/docs-ref-autogen/azure-servicebus/azure.servicebus.AutoLockRenewer.yml +++ b/docs-ref-autogen/azure-servicebus/azure.servicebus.AutoLockRenewer.yml @@ -82,30 +82,6 @@ constructor: isRequired: true types: - [] -examples: -- "Automatically renew a message lock\n\n\n\n````python\n\n from azure.servicebus\ - \ import AutoLockRenewer\n lock_renewal = AutoLockRenewer(max_workers=4)\n with\ - \ servicebus_receiver:\n for message in servicebus_receiver:\n #\ - \ Auto renew message for 1 minute.\n lock_renewal.register(servicebus_receiver,\ - \ message, max_lock_renewal_duration=60)\n process_message(message)\n\ - \ servicebus_receiver.complete_message(message)\n\n ````\n\nAutomatically\ - \ renew a session lock\n\n\n\n````python\n\n from azure.servicebus\ - \ import AutoLockRenewer\n\n lock_renewal = AutoLockRenewer(max_workers=4)\n\ - \ with servicebus_client.get_queue_receiver(queue_name=queue_name, session_id=session_id)\ - \ as receiver:\n session = receiver.session\n # Auto renew session\ - \ lock for 2 minutes\n lock_renewal.register(receiver, session, max_lock_renewal_duration=120)\n\ - \ for message in receiver:\n process_message(message)\n\ - \ receiver.complete_message(message)\n\n ````\n" methods: - uid: azure.servicebus.AutoLockRenewer.close name: close diff --git a/docs-ref-autogen/azure-servicebus/azure.servicebus.ServiceBusClient.yml b/docs-ref-autogen/azure-servicebus/azure.servicebus.ServiceBusClient.yml index 5af9e919009b..26725e540fb2 100644 --- a/docs-ref-autogen/azure-servicebus/azure.servicebus.ServiceBusClient.yml +++ b/docs-ref-autogen/azure-servicebus/azure.servicebus.ServiceBusClient.yml @@ -89,18 +89,6 @@ variables: name: fully_qualified_namespace types: - -examples: -- "Create a new instance of the ServiceBusClient.\n\n\n\n````python\n\n import os\n from azure.identity import DefaultAzureCredential\n\ - \ from azure.servicebus import ServiceBusClient\n fully_qualified_namespace\ - \ = os.environ['SERVICE_BUS_FULLY_QUALIFIED_NAMESPACE']\n servicebus_client =\ - \ ServiceBusClient(\n fully_qualified_namespace=fully_qualified_namespace,\n\ - \ credential=DefaultAzureCredential()\n )\n\n ````\n" methods: - uid: azure.servicebus.ServiceBusClient.close name: close @@ -171,17 +159,6 @@ methods: return: types: - - examples: - - "Create a new instance of the ServiceBusClient from connection string.\n\n\n\n````python\n\n import os\n from azure.servicebus\ - \ import ServiceBusClient\n servicebus_connection_str = os.environ['SERVICE_BUS_CONNECTION_STR']\n\ - \ servicebus_client = ServiceBusClient.from_connection_string(conn_str=servicebus_connection_str)\n\ - \n ````\n" - uid: azure.servicebus.ServiceBusClient.get_queue_receiver name: get_queue_receiver summary: Get ServiceBusReceiver for the specific queue. @@ -274,19 +251,6 @@ methods: return: types: - - examples: - - "Create a new instance of the ServiceBusReceiver from ServiceBusClient.\n\n\n\n````python\n\n import os\n from azure.servicebus\ - \ import ServiceBusClient\n servicebus_connection_str = os.environ['SERVICE_BUS_CONNECTION_STR']\n\ - \ queue_name = os.environ['SERVICE_BUS_QUEUE_NAME']\n servicebus_client =\ - \ ServiceBusClient.from_connection_string(conn_str=servicebus_connection_str)\n\ - \ with servicebus_client:\n queue_receiver = servicebus_client.get_queue_receiver(queue_name=queue_name)\n\ - \n ````\n" - uid: azure.servicebus.ServiceBusClient.get_queue_sender name: get_queue_sender summary: Get ServiceBusSender for the specific queue. @@ -300,19 +264,6 @@ methods: return: types: - - examples: - - "Create a new instance of the ServiceBusSender from ServiceBusClient.\n\n\n\n````python\n\n import os\n from azure.servicebus\ - \ import ServiceBusClient\n servicebus_connection_str = os.environ['SERVICE_BUS_CONNECTION_STR']\n\ - \ queue_name = os.environ['SERVICE_BUS_QUEUE_NAME']\n servicebus_client =\ - \ ServiceBusClient.from_connection_string(conn_str=servicebus_connection_str)\n\ - \ with servicebus_client:\n queue_sender = servicebus_client.get_queue_sender(queue_name=queue_name)\n\ - \n ````\n" - uid: azure.servicebus.ServiceBusClient.get_subscription_receiver name: get_subscription_receiver summary: Get ServiceBusReceiver for the specific subscription under the topic. @@ -413,20 +364,6 @@ methods: return: types: - - examples: - - "Create a new instance of the ServiceBusReceiver from ServiceBusClient.\n\n\n\n````python\n\n import os\n from azure.servicebus\ - \ import ServiceBusClient\n servicebus_connection_str = os.environ['SERVICE_BUS_CONNECTION_STR']\n\ - \ topic_name = os.environ[\"SERVICE_BUS_TOPIC_NAME\"]\n subscription_name\ - \ = os.environ[\"SERVICE_BUS_SUBSCRIPTION_NAME\"]\n servicebus_client = ServiceBusClient.from_connection_string(conn_str=servicebus_connection_str)\n\ - \ with servicebus_client:\n subscription_receiver = servicebus_client.get_subscription_receiver(\n\ - \ topic_name=topic_name,\n subscription_name=subscription_name,\n\ - \ )\n\n ````\n" - uid: azure.servicebus.ServiceBusClient.get_topic_sender name: get_topic_sender summary: Get ServiceBusSender for the specific topic. @@ -440,16 +377,3 @@ methods: return: types: - - examples: - - "Create a new instance of the ServiceBusSender from ServiceBusClient.\n\n\n\n````python\n\n import os\n from azure.servicebus\ - \ import ServiceBusClient\n servicebus_connection_str = os.environ['SERVICE_BUS_CONNECTION_STR']\n\ - \ topic_name = os.environ['SERVICE_BUS_TOPIC_NAME']\n servicebus_client =\ - \ ServiceBusClient.from_connection_string(conn_str=servicebus_connection_str)\n\ - \ with servicebus_client:\n topic_sender = servicebus_client.get_topic_sender(topic_name=topic_name)\n\ - \n ````\n" diff --git a/docs-ref-autogen/azure-servicebus/azure.servicebus.ServiceBusMessage.yml b/docs-ref-autogen/azure-servicebus/azure.servicebus.ServiceBusMessage.yml index 41f26e5983e6..d9d6a7ded610 100644 --- a/docs-ref-autogen/azure-servicebus/azure.servicebus.ServiceBusMessage.yml +++ b/docs-ref-autogen/azure-servicebus/azure.servicebus.ServiceBusMessage.yml @@ -62,17 +62,6 @@ constructor: description: The session identifier augmenting the *reply_to* address. types: - [] -examples: -- "Sending a message with additional properties\n\n\n\n````python\n\n message = ServiceBusMessage(\n \"Hello World!!\"\ - ,\n session_id=\"MySessionID\",\n application_properties={'data': 'custom_data'},\n\ - \ time_to_live=datetime.timedelta(seconds=30),\n label='MyLabel'\n \ - \ )\n\n ````\n" attributes: - uid: azure.servicebus.ServiceBusMessage.application_properties name: application_properties diff --git a/docs-ref-autogen/azure-servicebus/azure.servicebus.ServiceBusReceivedMessage.yml b/docs-ref-autogen/azure-servicebus/azure.servicebus.ServiceBusReceivedMessage.yml index 9981a21bf5a9..19f37724b461 100644 --- a/docs-ref-autogen/azure-servicebus/azure.servicebus.ServiceBusReceivedMessage.yml +++ b/docs-ref-autogen/azure-servicebus/azure.servicebus.ServiceBusReceivedMessage.yml @@ -20,25 +20,6 @@ variables: types: - - -examples: -- "Checking the properties on a received message.\n\n\n\n````python\n\n messages = servicebus_receiver.receive_messages(max_wait_time=5)\n\ - \ for message in messages:\n print(\"Receiving: {}\".format(message))\n\ - \ print(\"Time to live: {}\".format(message.time_to_live))\n \ - \ print(\"Sequence number: {}\".format(message.sequence_number))\n print(\"\ - Enqueued Sequence numger: {}\".format(message.enqueued_sequence_number))\n \ - \ print(\"Partition Key: {}\".format(message.partition_key))\n print(\"\ - Application Properties: {}\".format(message.application_properties))\n \ - \ print(\"Delivery count: {}\".format(message.delivery_count))\n print(\"\ - Message ID: {}\".format(message.message_id))\n print(\"Locked until: {}\"\ - .format(message.locked_until_utc))\n print(\"Lock Token: {}\".format(message.lock_token))\n\ - \ print(\"Enqueued time: {}\".format(message.enqueued_time_utc))\n\n \ - \ ````\n" attributes: - uid: azure.servicebus.ServiceBusReceivedMessage.dead_letter_error_description name: dead_letter_error_description diff --git a/docs-ref-autogen/azure-servicebus/azure.servicebus.ServiceBusReceiver.yml b/docs-ref-autogen/azure-servicebus/azure.servicebus.ServiceBusReceiver.yml index 7f1f8290273b..ab8128c14694 100644 --- a/docs-ref-autogen/azure-servicebus/azure.servicebus.ServiceBusReceiver.yml +++ b/docs-ref-autogen/azure-servicebus/azure.servicebus.ServiceBusReceiver.yml @@ -177,16 +177,6 @@ methods: - type: azure.servicebus.exceptions.SessionLockLostError if session lock has already expired. - type: azure.servicebus.exceptions.ServiceBusError when errors happen. - examples: - - "Abandon a received message.\n\n\n\n````python\n\ - \n messages = servicebus_receiver.receive_messages(max_wait_time=5)\n \ - \ for message in messages:\n servicebus_receiver.abandon_message(message)\n\ - \n ````\n" - uid: azure.servicebus.ServiceBusReceiver.close name: close signature: close() -> None @@ -212,16 +202,6 @@ methods: - type: azure.servicebus.exceptions.SessionLockLostError if session lock has already expired. - type: azure.servicebus.exceptions.ServiceBusError when errors happen. - examples: - - "Complete a received message.\n\n\n\n````python\n\ - \n messages = servicebus_receiver.receive_messages(max_wait_time=5)\n \ - \ for message in messages:\n servicebus_receiver.complete_message(message)\n\ - \n ````\n" - uid: azure.servicebus.ServiceBusReceiver.dead_letter_message name: dead_letter_message summary: 'Move the message to the Dead Letter queue. @@ -260,16 +240,6 @@ methods: - type: azure.servicebus.exceptions.SessionLockLostError if session lock has already expired. - type: azure.servicebus.exceptions.ServiceBusError when errors happen. - examples: - - "Dead letter a received message.\n\n\n\n````python\n\ - \n messages = servicebus_receiver.receive_messages(max_wait_time=5)\n \ - \ for message in messages:\n servicebus_receiver.dead_letter_message(message)\n\ - \n ````\n" - uid: azure.servicebus.ServiceBusReceiver.defer_message name: defer_message summary: 'Defers the message. @@ -294,16 +264,6 @@ methods: - type: azure.servicebus.exceptions.SessionLockLostError if session lock has already expired. - type: azure.servicebus.exceptions.ServiceBusError when errors happen. - examples: - - "Defer a received message.\n\n\n\n````python\n\ - \n messages = servicebus_receiver.receive_messages(max_wait_time=5)\n \ - \ for message in messages:\n servicebus_receiver.defer_message(message)\n\ - \n ````\n" - uid: azure.servicebus.ServiceBusReceiver.next name: next signature: next() @@ -339,16 +299,6 @@ methods: return: types: - [] - examples: - - "Look at pending messages in the queue.\n\n\n\n````python\n\n with servicebus_receiver:\n\ - \ messages = servicebus_receiver.peek_messages()\n for message in\ - \ messages:\n print(str(message))\n\n ````\n" - uid: azure.servicebus.ServiceBusReceiver.receive_deferred_messages name: receive_deferred_messages summary: 'Receive messages that have previously been deferred. @@ -377,21 +327,6 @@ methods: return: types: - [] - examples: - - "Receive deferred messages from ServiceBus.\n\n\n\n````python\n\n with servicebus_receiver:\n\ - \ deferred_sequenced_numbers = []\n messages = servicebus_receiver.receive_messages(max_wait_time=5)\n\ - \ for message in messages:\n deferred_sequenced_numbers.append(message.sequence_number)\n\ - \ print(str(message))\n servicebus_receiver.defer_message(message)\n\ - \n received_deferred_msg = servicebus_receiver.receive_deferred_messages(\n\ - \ sequence_numbers=deferred_sequenced_numbers\n )\n\n for\ - \ msg in received_deferred_msg:\n servicebus_receiver.complete_message(msg)\n\ - \n ````\n" - uid: azure.servicebus.ServiceBusReceiver.receive_messages name: receive_messages summary: 'Receive a batch of messages at once. @@ -447,17 +382,6 @@ methods: return: types: - [] - examples: - - "Receive messages from ServiceBus.\n\n\n\n````python\n\n with servicebus_receiver:\n\ - \ messages = servicebus_receiver.receive_messages(max_wait_time=5)\n \ - \ for message in messages:\n print(str(message))\n servicebus_receiver.complete_message(message)\n\ - \n ````\n" - uid: azure.servicebus.ServiceBusReceiver.renew_message_lock name: renew_message_lock summary: 'Renew the message lock. @@ -503,16 +427,6 @@ methods: settled. - type: azure.servicebus.exceptions.MessageLockLostError if message lock has already expired. - examples: - - "Renew the lock on a received message.\n\n\n\n````python\n\n messages = servicebus_receiver.receive_messages(max_wait_time=5)\n\ - \ for message in messages:\n servicebus_receiver.renew_message_lock(message)\n\ - \n ````\n" attributes: - uid: azure.servicebus.ServiceBusReceiver.session name: session @@ -523,12 +437,3 @@ attributes: return: types: - - examples: - - "Get session from a receiver\n\n\n\n````python\n\ - \n with servicebus_client.get_queue_receiver(queue_name=queue_name, session_id=session_id)\ - \ as receiver:\n session = receiver.session\n\n ````\n" diff --git a/docs-ref-autogen/azure-servicebus/azure.servicebus.ServiceBusSender.yml b/docs-ref-autogen/azure-servicebus/azure.servicebus.ServiceBusSender.yml index 45ccc5eeb3da..032661881860 100644 --- a/docs-ref-autogen/azure-servicebus/azure.servicebus.ServiceBusSender.yml +++ b/docs-ref-autogen/azure-servicebus/azure.servicebus.ServiceBusSender.yml @@ -111,15 +111,6 @@ methods: exceptions: - type: azure.servicebus.exceptions.ServiceBusError if messages cancellation failed due to message alreadycancelled or enqueued. - examples: - - "Cancelling messages scheduled to be sent in future\n\n\n\n````python\n\n with servicebus_sender:\n \ - \ servicebus_sender.cancel_scheduled_messages(sequence_nums)\n\n ````\n" - uid: azure.servicebus.ServiceBusSender.create_message_batch name: create_message_batch summary: 'Create a ServiceBusMessageBatch object with the max size of all content @@ -140,16 +131,6 @@ methods: return: types: - - examples: - - "Create ServiceBusMessageBatch object within limited size\n\n\n\n````python\n\n with servicebus_sender:\n \ - \ batch_message = servicebus_sender.create_message_batch()\n batch_message.add_message(ServiceBusMessage(\"\ - Single message inside batch\"))\n\n ````\n" - uid: azure.servicebus.ServiceBusSender.schedule_messages name: schedule_messages summary: 'Send Message or multiple Messages to be enqueued at a specific time. @@ -179,18 +160,6 @@ methods: return: types: - [] - examples: - - "Schedule a message to be sent in future\n\n\n\n````python\n\n with servicebus_sender:\n \ - \ scheduled_time_utc = datetime.datetime.utcnow() + datetime.timedelta(seconds=30)\n\ - \ scheduled_messages = [ServiceBusMessage(\"Scheduled message\") for _ in\ - \ range(10)]\n sequence_nums = servicebus_sender.schedule_messages(scheduled_messages,\ - \ scheduled_time_utc)\n\n ````\n" - uid: azure.servicebus.ServiceBusSender.send_messages name: send_messages summary: 'Sends message and blocks until acknowledgement is received or operation @@ -222,12 +191,3 @@ methods: - exceptions: - type: azure.servicebus.exceptions.OperationTimeoutError if sending times out. - examples: - - "Send message.\n\n\n\n````python\n\ - \n with servicebus_sender:\n message = ServiceBusMessage(\"Hello World\"\ - )\n servicebus_sender.send_messages(message)\n\n ````\n" diff --git a/docs-ref-autogen/azure-servicebus/azure.servicebus.ServiceBusSession.yml b/docs-ref-autogen/azure-servicebus/azure.servicebus.ServiceBusSession.yml index 531645bb9b8e..3544a4fb884a 100644 --- a/docs-ref-autogen/azure-servicebus/azure.servicebus.ServiceBusSession.yml +++ b/docs-ref-autogen/azure-servicebus/azure.servicebus.ServiceBusSession.yml @@ -25,15 +25,6 @@ variables: types: - - -examples: -- "Get session from a receiver\n\n\n\n````python\n\n with servicebus_client.get_queue_receiver(queue_name=queue_name,\ - \ session_id=session_id) as receiver:\n session = receiver.session\n\n\ - \ ````\n" methods: - uid: azure.servicebus.ServiceBusSession.get_state name: get_state @@ -53,16 +44,6 @@ methods: return: types: - - examples: - - "Get the session state\n\n\n\n````python\n\ - \n with servicebus_client.get_queue_receiver(queue_name=queue_name, session_id=session_id)\ - \ as receiver:\n session = receiver.session\n session_state\ - \ = session.get_state()\n\n ````\n" - uid: azure.servicebus.ServiceBusSession.renew_lock name: renew_lock summary: 'Renew the session lock. @@ -94,16 +75,6 @@ methods: description: The utc datetime the lock is set to expire at. types: - - examples: - - "Renew the session lock before it expires\n\n\n\n````python\n\n with servicebus_client.get_queue_receiver(queue_name=queue_name,\ - \ session_id=session_id) as receiver:\n session = receiver.session\n\ - \ session.renew_lock()\n\n ````\n" - uid: azure.servicebus.ServiceBusSession.set_state name: set_state summary: Set the session state. @@ -121,13 +92,3 @@ methods: greater than 0 if specified. The default value is None, meaning no timeout.' types: - - examples: - - "Set the session state\n\n\n\n````python\n\ - \n with servicebus_client.get_queue_receiver(queue_name=queue_name, session_id=session_id)\ - \ as receiver:\n session = receiver.session\n session.set_state(\"\ - START\")\n\n ````\n" diff --git a/docs-ref-autogen/azure-servicebus/azure.servicebus.aio.AutoLockRenewer.yml b/docs-ref-autogen/azure-servicebus/azure.servicebus.aio.AutoLockRenewer.yml index 7587d2d1c86c..b06b3adb0653 100644 --- a/docs-ref-autogen/azure-servicebus/azure.servicebus.aio.AutoLockRenewer.yml +++ b/docs-ref-autogen/azure-servicebus/azure.servicebus.aio.AutoLockRenewer.yml @@ -33,30 +33,6 @@ constructor: - [] - name: loop defaultValue: None -examples: -- "Automatically renew a message lock\n\n\n\n````python\n\n from azure.servicebus.aio import AutoLockRenewer\n\ - \n lock_renewal = AutoLockRenewer()\n async with servicebus_receiver:\n \ - \ async for message in servicebus_receiver:\n lock_renewal.register(servicebus_receiver,\ - \ message, max_lock_renewal_duration=60)\n await process_message(message)\n\ - \ await servicebus_receiver.complete_message(message)\n\n ````\n\nAutomatically\ - \ renew a session lock\n\n\n\n````python\n\n from azure.servicebus.aio\ - \ import AutoLockRenewer\n\n lock_renewal = AutoLockRenewer()\n async\ - \ with servicebus_client.get_queue_receiver(queue_name=queue_name, session_id=session_id)\ - \ as receiver:\n session = receiver.session\n # Auto renew session\ - \ lock for 2 minutes\n lock_renewal.register(receiver, session, max_lock_renewal_duration=120)\n\ - \ async for message in receiver:\n await process_message(message)\n\ - \ await receiver.complete_message(message)\n\n ````\n" methods: - uid: azure.servicebus.aio.AutoLockRenewer.close name: close diff --git a/docs-ref-autogen/azure-servicebus/azure.servicebus.aio.ServiceBusClient.yml b/docs-ref-autogen/azure-servicebus/azure.servicebus.aio.ServiceBusClient.yml index 0bed58257a72..d52dcc4d25ef 100644 --- a/docs-ref-autogen/azure-servicebus/azure.servicebus.aio.ServiceBusClient.yml +++ b/docs-ref-autogen/azure-servicebus/azure.servicebus.aio.ServiceBusClient.yml @@ -89,18 +89,6 @@ variables: name: fully_qualified_namespace types: - -examples: -- "Create a new instance of the ServiceBusClient.\n\n\n\n````python\n\n import os\n from azure.identity.aio import DefaultAzureCredential\n\ - \ from azure.servicebus.aio import ServiceBusClient\n fully_qualified_namespace\ - \ = os.environ['SERVICE_BUS_FULLY_QUALIFIED_NAMESPACE']\n servicebus_client =\ - \ ServiceBusClient(\n fully_qualified_namespace=fully_qualified_namespace,\n\ - \ credential=DefaultAzureCredential()\n )\n\n ````\n" methods: - uid: azure.servicebus.aio.ServiceBusClient.close name: close @@ -171,17 +159,6 @@ methods: return: types: - - examples: - - "Create a new instance of the ServiceBusClient from connection string.\n\n\n\n````python\n\n import os\n\ - \ from azure.servicebus.aio import ServiceBusClient\n servicebus_connection_str\ - \ = os.environ['SERVICE_BUS_CONNECTION_STR']\n servicebus_client = ServiceBusClient.from_connection_string(conn_str=servicebus_connection_str)\n\ - \n ````\n" - uid: azure.servicebus.aio.ServiceBusClient.get_queue_receiver name: get_queue_receiver summary: Get ServiceBusReceiver for the specific queue. @@ -275,19 +252,6 @@ methods: return: types: - - examples: - - "Create a new instance of the ServiceBusSender from ServiceBusClient.\n\n\n\n````python\n\n import os\n\ - \ from azure.servicebus.aio import ServiceBusClient\n servicebus_connection_str\ - \ = os.environ['SERVICE_BUS_CONNECTION_STR']\n queue_name = os.environ['SERVICE_BUS_QUEUE_NAME']\n\ - \ servicebus_client = ServiceBusClient.from_connection_string(conn_str=servicebus_connection_str)\n\ - \ async with servicebus_client:\n queue_receiver = servicebus_client.get_queue_receiver(queue_name=queue_name)\n\ - \n ````\n" - uid: azure.servicebus.aio.ServiceBusClient.get_queue_sender name: get_queue_sender summary: Get ServiceBusSender for the specific queue. @@ -301,19 +265,6 @@ methods: return: types: - - examples: - - "Create a new instance of the ServiceBusClient from connection string.\n\n\n\n````python\n\n import os\n\ - \ from azure.servicebus.aio import ServiceBusClient\n servicebus_connection_str\ - \ = os.environ['SERVICE_BUS_CONNECTION_STR']\n queue_name = os.environ['SERVICE_BUS_QUEUE_NAME']\n\ - \ servicebus_client = ServiceBusClient.from_connection_string(conn_str=servicebus_connection_str)\n\ - \ async with servicebus_client:\n queue_sender = servicebus_client.get_queue_sender(queue_name=queue_name)\n\ - \n ````\n" - uid: azure.servicebus.aio.ServiceBusClient.get_subscription_receiver name: get_subscription_receiver summary: Get ServiceBusReceiver for the specific subscription under the topic. @@ -415,21 +366,6 @@ methods: return: types: - - examples: - - "Create a new instance of the ServiceBusReceiver from ServiceBusClient.\n\n\n\n````python\n\n import os\n\ - \ from azure.servicebus.aio import ServiceBusClient\n servicebus_connection_str\ - \ = os.environ['SERVICE_BUS_CONNECTION_STR']\n topic_name = os.environ[\"SERVICE_BUS_TOPIC_NAME\"\ - ]\n subscription_name = os.environ[\"SERVICE_BUS_SUBSCRIPTION_NAME\"]\n servicebus_client\ - \ = ServiceBusClient.from_connection_string(conn_str=servicebus_connection_str)\n\ - \ async with servicebus_client:\n subscription_receiver = servicebus_client.get_subscription_receiver(\n\ - \ topic_name=topic_name,\n subscription_name=subscription_name,\n\ - \ )\n\n ````\n" - uid: azure.servicebus.aio.ServiceBusClient.get_topic_sender name: get_topic_sender summary: Get ServiceBusSender for the specific topic. @@ -443,16 +379,3 @@ methods: return: types: - - examples: - - "Create a new instance of the ServiceBusSender from ServiceBusClient.\n\n\n\n````python\n\n import os\n\ - \ from azure.servicebus.aio import ServiceBusClient\n servicebus_connection_str\ - \ = os.environ['SERVICE_BUS_CONNECTION_STR']\n topic_name = os.environ['SERVICE_BUS_TOPIC_NAME']\n\ - \ servicebus_client = ServiceBusClient.from_connection_string(conn_str=servicebus_connection_str)\n\ - \ async with servicebus_client:\n topic_sender = servicebus_client.get_topic_sender(topic_name=topic_name)\n\ - \n ````\n" diff --git a/docs-ref-autogen/azure-servicebus/azure.servicebus.aio.ServiceBusReceiver.yml b/docs-ref-autogen/azure-servicebus/azure.servicebus.aio.ServiceBusReceiver.yml index d9b67cfc15dd..6bd7eef1222c 100644 --- a/docs-ref-autogen/azure-servicebus/azure.servicebus.aio.ServiceBusReceiver.yml +++ b/docs-ref-autogen/azure-servicebus/azure.servicebus.aio.ServiceBusReceiver.yml @@ -178,16 +178,6 @@ methods: - type: azure.servicebus.exceptions.SessionLockLostError if session lock has already expired. - type: azure.servicebus.exceptions.ServiceBusError when errors happen. - examples: - - "Abandon a received message.\n\n\n\n````python\n\ - \n messages = await servicebus_receiver.receive_messages(max_wait_time=5)\n\ - \ for message in messages:\n await servicebus_receiver.abandon_message(message)\n\ - \n ````\n" - uid: azure.servicebus.aio.ServiceBusReceiver.close name: close signature: async close() -> None @@ -213,16 +203,6 @@ methods: - type: azure.servicebus.exceptions.SessionLockLostError if session lock has already expired. - type: azure.servicebus.exceptions.ServiceBusError when errors happen. - examples: - - "Complete a received message.\n\n\n\n````python\n\ - \n messages = await servicebus_receiver.receive_messages(max_wait_time=5)\n\ - \ for message in messages:\n await servicebus_receiver.complete_message(message)\n\ - \n ````\n" - uid: azure.servicebus.aio.ServiceBusReceiver.dead_letter_message name: dead_letter_message summary: 'Move the message to the Dead Letter queue. @@ -261,16 +241,6 @@ methods: - type: azure.servicebus.exceptions.SessionLockLostError if session lock has already expired. - type: azure.servicebus.exceptions.ServiceBusError when errors happen. - examples: - - "Dead letter a received message.\n\n\n\n````python\n\ - \n messages = await servicebus_receiver.receive_messages(max_wait_time=5)\n\ - \ for message in messages:\n await servicebus_receiver.dead_letter_message(message)\n\ - \n ````\n" - uid: azure.servicebus.aio.ServiceBusReceiver.defer_message name: defer_message summary: 'Defers the message. @@ -295,16 +265,6 @@ methods: - type: azure.servicebus.exceptions.SessionLockLostError if session lock has already expired. - type: azure.servicebus.exceptions.ServiceBusError when errors happen. - examples: - - "Defer a received message.\n\n\n\n````python\n\ - \n messages = await servicebus_receiver.receive_messages(max_wait_time=5)\n\ - \ for message in messages:\n await servicebus_receiver.defer_message(message)\n\ - \n ````\n" - uid: azure.servicebus.aio.ServiceBusReceiver.peek_messages name: peek_messages summary: 'Browse messages currently pending in the queue. @@ -337,15 +297,6 @@ methods: return: types: - [] - examples: - - "Peek messages in the queue.\n\n\n\n````python\n\ - \n async with servicebus_receiver:\n messages = await servicebus_receiver.peek_messages()\n\ - \ for message in messages:\n print(str(message))\n\n ````\n" - uid: azure.servicebus.aio.ServiceBusReceiver.receive_deferred_messages name: receive_deferred_messages summary: 'Receive messages that have previously been deferred. @@ -374,21 +325,6 @@ methods: return: types: - [] - examples: - - "Receive deferred messages from ServiceBus.\n\n\n\n````python\n\n async with servicebus_receiver:\n\ - \ deferred_sequenced_numbers = []\n messages = await servicebus_receiver.receive_messages(max_wait_time=5)\n\ - \ for message in messages:\n deferred_sequenced_numbers.append(message.sequence_number)\n\ - \ print(str(message))\n await servicebus_receiver.defer_message(message)\n\ - \n received_deferred_msg = await servicebus_receiver.receive_deferred_messages(\n\ - \ sequence_numbers=deferred_sequenced_numbers\n )\n\n for\ - \ message in received_deferred_msg:\n await servicebus_receiver.complete_message(message)\n\ - \n ````\n" - uid: azure.servicebus.aio.ServiceBusReceiver.receive_messages name: receive_messages summary: 'Receive a batch of messages at once. @@ -445,17 +381,6 @@ methods: return: types: - [] - examples: - - "Receive messages from ServiceBus.\n\n\n\n````python\n\n async with servicebus_receiver:\n\ - \ messages = await servicebus_receiver.receive_messages(max_wait_time=5)\n\ - \ for message in messages:\n print(str(message))\n await\ - \ servicebus_receiver.complete_message(message)\n\n ````\n" - uid: azure.servicebus.aio.ServiceBusReceiver.renew_message_lock name: renew_message_lock summary: 'Renew the message lock. @@ -501,16 +426,6 @@ methods: settled. - type: azure.servicebus.exceptions.MessageLockLostError if message lock has already expired. - examples: - - "Renew the lock on a received message.\n\n\n\n````python\n\n messages = await servicebus_receiver.receive_messages(max_wait_time=5)\n\ - \ for message in messages:\n await servicebus_receiver.renew_message_lock(message)\n\ - \n ````\n" attributes: - uid: azure.servicebus.aio.ServiceBusReceiver.session name: session @@ -521,13 +436,3 @@ attributes: return: types: - - examples: - - "Get session from a receiver\n\n\n\n````python\n\ - \n async with servicebus_client.get_queue_receiver(queue_name=queue_name,\ - \ session_id=session_id) as receiver:\n session = receiver.session\n\ - \n ````\n" diff --git a/docs-ref-autogen/azure-servicebus/azure.servicebus.aio.ServiceBusSender.yml b/docs-ref-autogen/azure-servicebus/azure.servicebus.aio.ServiceBusSender.yml index 06a3f11d9f59..d27f3d097b93 100644 --- a/docs-ref-autogen/azure-servicebus/azure.servicebus.aio.ServiceBusSender.yml +++ b/docs-ref-autogen/azure-servicebus/azure.servicebus.aio.ServiceBusSender.yml @@ -115,16 +115,6 @@ methods: exceptions: - type: azure.servicebus.exceptions.ServiceBusError if messages cancellation failed due to message alreadycancelled or enqueued. - examples: - - "Cancelling messages scheduled to be sent in future\n\n\n\n````python\n\n async with\ - \ servicebus_sender:\n await servicebus_sender.cancel_scheduled_messages(sequence_nums)\n\ - \n ````\n" - uid: azure.servicebus.aio.ServiceBusSender.create_message_batch name: create_message_batch summary: 'Create a ServiceBusMessageBatch object with the max size of all content @@ -146,17 +136,6 @@ methods: return: types: - - examples: - - "Create ServiceBusMessageBatch object within limited size\n\n\n\n````python\n\n async with\ - \ servicebus_sender:\n batch_message = await servicebus_sender.create_message_batch()\n\ - \ batch_message.add_message(ServiceBusMessage(\"Single message inside batch\"\ - ))\n\n ````\n" - uid: azure.servicebus.aio.ServiceBusSender.schedule_messages name: schedule_messages summary: 'Send Message or multiple Messages to be enqueued at a specific time by @@ -188,18 +167,6 @@ methods: return: types: - [] - examples: - - "Schedule a message to be sent in future\n\n\n\n````python\n\n async with servicebus_sender:\n\ - \ scheduled_time_utc = datetime.datetime.utcnow() + datetime.timedelta(seconds=30)\n\ - \ scheduled_messages = [ServiceBusMessage(\"Scheduled message\") for _ in\ - \ range(10)]\n sequence_nums = await servicebus_sender.schedule_messages(scheduled_messages,\ - \ scheduled_time_utc)\n\n ````\n" - uid: azure.servicebus.aio.ServiceBusSender.send_messages name: send_messages summary: 'Sends message and blocks until acknowledgement is received or operation @@ -232,12 +199,3 @@ methods: - exceptions: - type: azure.servicebus.exceptions.OperationTimeoutError if sending times out. - examples: - - "Send message.\n\n\n\n````python\n\ - \n async with servicebus_sender:\n message = ServiceBusMessage(\"Hello\ - \ World\")\n await servicebus_sender.send_messages(message)\n\n ````\n" diff --git a/docs-ref-autogen/azure-servicebus/azure.servicebus.aio.ServiceBusSession.yml b/docs-ref-autogen/azure-servicebus/azure.servicebus.aio.ServiceBusSession.yml index 6595b575531a..dd6eee5be4cc 100644 --- a/docs-ref-autogen/azure-servicebus/azure.servicebus.aio.ServiceBusSession.yml +++ b/docs-ref-autogen/azure-servicebus/azure.servicebus.aio.ServiceBusSession.yml @@ -18,15 +18,6 @@ constructor: parameters: - name: session_id - name: receiver -examples: -- "Get session from a receiver\n\n\n\n````python\n\n async with\ - \ servicebus_client.get_queue_receiver(queue_name=queue_name, session_id=session_id)\ - \ as receiver:\n session = receiver.session\n\n ````\n" methods: - uid: azure.servicebus.aio.ServiceBusSession.get_state name: get_state @@ -46,16 +37,6 @@ methods: return: types: - - examples: - - "Get the session state\n\n\n\n````python\n\ - \n async with servicebus_client.get_queue_receiver(queue_name=queue_name,\ - \ session_id=session_id) as receiver:\n session = receiver.session\n\ - \ session_state = await session.get_state()\n\n ````\n" - uid: azure.servicebus.aio.ServiceBusSession.renew_lock name: renew_lock summary: 'Renew the session lock. @@ -87,16 +68,6 @@ methods: description: The utc datetime the lock is set to expire at. types: - - examples: - - "Renew the session lock before it expires\n\n\n\n````python\n\n async with servicebus_client.get_queue_receiver(queue_name=queue_name,\ - \ session_id=session_id) as receiver:\n session = receiver.session\n\ - \ await session.renew_lock()\n\n ````\n" - uid: azure.servicebus.aio.ServiceBusSession.set_state name: set_state summary: Set the session state. @@ -117,13 +88,3 @@ methods: return: types: - - examples: - - "Set the session state\n\n\n\n````python\n\ - \n async with servicebus_client.get_queue_receiver(queue_name=queue_name,\ - \ session_id=session_id) as receiver:\n session = receiver.session\n\ - \ await session.set_state(\"START\")\n\n ````\n" diff --git a/docs-ref-autogen/azure-storage-blob/azure.storage.blob.BlobClient.yml b/docs-ref-autogen/azure-storage-blob/azure.storage.blob.BlobClient.yml index 125c6eb9861b..86f443c40ef4 100644 --- a/docs-ref-autogen/azure-storage-blob/azure.storage.blob.BlobClient.yml +++ b/docs-ref-autogen/azure-storage-blob/azure.storage.blob.BlobClient.yml @@ -128,24 +128,6 @@ constructor: or 4MB.' types: - -examples: -- "Creating the BlobClient from a URL to a public blob (no auth needed).\n\n\n\n````python\n\n from azure.storage.blob import BlobClient\n blob_client\ - \ = BlobClient.from_blob_url(blob_url=\"https://account.blob.core.windows.net/container/blob-name\"\ - )\n\n ````\n\nCreating the BlobClient from a SAS URL to a blob.\n\n\n\n````python\n\n from azure.storage.blob import BlobClient\n\n \ - \ sas_url = \"https://account.blob.core.windows.net/container/blob-name?sv=2015-04-05&st=2015-04-29T22%3A18%3A26Z&se=2015-04-30T02%3A23%3A26Z&sr=b&sp=rw&sip=168.1.5.60-168.1.5.70&spr=https&sig=Z%2FRHIX5Xcg0Mq2rqI3OlWTjEg2tYkboXr1P9ZUXDtkk%3D\"\ - \n blob_client = BlobClient.from_blob_url(sas_url)\n\n ````\n" methods: - uid: azure.storage.blob.BlobClient.abort_copy name: abort_copy @@ -170,17 +152,6 @@ methods: return: types: - - examples: - - "Abort copying a blob from URL.\n\n\n\n````python\n\ - \n # Passing in copy id to abort copy operation\n if props.copy.status !=\ - \ \"success\":\n copied_blob.abort_copy(copy_id)\n\n # check copy status\n\ - \ props = copied_blob.get_blob_properties()\n print(props.copy.status)\n\n\ - \ ````\n" - uid: azure.storage.blob.BlobClient.acquire_lease name: acquire_lease summary: 'Requests a new lease. @@ -273,16 +244,6 @@ methods: description: A BlobLeaseClient object. types: - - examples: - - "Acquiring a lease on a blob.\n\n\n\n````python\n\ - \n # Acquire a lease on the blob\n lease = blob_client.acquire_lease()\n\n\ - \ # Delete blob by passing in the lease\n blob_client.delete_blob(lease=lease)\n\ - \n ````\n" - uid: azure.storage.blob.BlobClient.append_block name: append_block summary: Commits a new block of data to the end of the existing append blob. @@ -1356,16 +1317,6 @@ methods: description: Blob-updated property dict (Snapshot ID, Etag, and last modified). types: - [, ] - examples: - - "Create a snapshot of the blob.\n\n\n\n````python\n\ - \n # Create a read-only snapshot of the blob at this point in time\n snapshot_blob\ - \ = blob_client.create_snapshot()\n\n # Get the snapshot ID\n print(snapshot_blob.get('snapshot'))\n\ - \n ````\n" - uid: azure.storage.blob.BlobClient.delete_blob name: delete_blob summary: 'Marks the specified blob for deletion. @@ -1484,14 +1435,6 @@ methods: return: types: - - examples: - - "Delete a blob.\n\ - \n\n\n````python\n\ - \n blob_client.delete_blob()\n\n ````\n" - uid: azure.storage.blob.BlobClient.delete_immutability_policy name: delete_immutability_policy summary: 'The Delete Immutability Policy operation deletes the immutability policy @@ -1681,15 +1624,6 @@ methods: description: A streaming object (StorageStreamDownloader) types: - - examples: - - "Download a blob.\n\ - \n\n\n````python\n\ - \n with open(DEST_FILE, \"wb\") as my_blob:\n download_stream = blob_client.download_blob()\n\ - \ my_blob.write(download_stream.readall())\n\n ````\n" - uid: azure.storage.blob.BlobClient.exists name: exists summary: 'Returns True if a blob exists with the defined parameters, and returns @@ -1829,16 +1763,6 @@ methods: description: A Blob client. types: - - examples: - - "Creating the BlobClient from a connection string.\n\n\n\n````python\n\n from azure.storage.blob import BlobClient\n \ - \ blob_client = BlobClient.from_connection_string(\n self.connection_string,\ - \ container_name=\"mycontainer\", blob_name=\"blobname.txt\")\n\n ````\n" - uid: azure.storage.blob.BlobClient.get_account_information name: get_account_information summary: 'Gets information related to the storage account in which the blob resides. @@ -1951,14 +1875,6 @@ methods: description: BlobProperties types: - - examples: - - "Getting the properties for a blob.\n\n\n\n````python\n\ - \n properties = blob_client.get_blob_properties()\n\n ````\n" - uid: azure.storage.blob.BlobClient.get_blob_tags name: get_blob_tags summary: 'The Get Tags operation enables users to get tags on a blob or specific @@ -2554,22 +2470,6 @@ methods: description: A streaming object (BlobQueryReader) types: - - examples: - - "select/project on blob/or blob snapshot data by providing simple query expressions.\n\n\n\ - \n````python\n\n errors = []\n def on_error(error):\n errors.append(error)\n\ - \n # upload the csv file\n blob_client = blob_service_client.get_blob_client(container_name,\ - \ \"csvfile\")\n with open(\"./sample-blobs/quick_query.csv\", \"rb\") as stream:\n\ - \ blob_client.upload_blob(stream, overwrite=True)\n\n # select the second\ - \ column of the csv file\n query_expression = \"SELECT _2 from BlobStorage\"\ - \n input_format = DelimitedTextDialect(delimiter=',', quotechar='\"', lineterminator='\\\ - n', escapechar=\"\", has_header=False)\n output_format = DelimitedJsonDialect(delimiter='\\\ - n')\n reader = blob_client.query_blob(query_expression, on_error=on_error, blob_format=input_format,\ - \ output_format=output_format)\n content = reader.readall()\n\n ````\n" - uid: azure.storage.blob.BlobClient.resize_blob name: resize_blob summary: 'Resizes a page blob to the specified size. @@ -3821,18 +3721,6 @@ methods: description: A dictionary of copy properties (etag, last_modified, copy_id, copy_status). types: - [, [, ]] - examples: - - "Copy a blob from a URL.\n\ - \n\n\n````python\n\n # Get the\ - \ blob client with the source blob\n source_blob = \"https://www.gutenberg.org/files/59466/59466-0.txt\"\ - \n copied_blob = blob_service_client.get_blob_client(\"copyblobcontainer\",\ - \ '59466-0.txt')\n\n # start copy and check copy status\n copy = copied_blob.start_copy_from_url(source_blob)\n\ - \ props = copied_blob.get_blob_properties()\n print(props.copy.status)\n\n\ - \ ````\n" - uid: azure.storage.blob.BlobClient.undelete_blob name: undelete_blob summary: 'Restores soft-deleted blobs or snapshots. @@ -3866,15 +3754,6 @@ methods: return: types: - - examples: - - "Undeleting a blob.\n\ - \n\n\n````python\n\n # Undelete\ - \ the blob before the retention policy expires\n blob_client.undelete_blob()\n\ - \n ````\n" - uid: azure.storage.blob.BlobClient.upload_blob name: upload_blob summary: Creates a new blob from a data source with automatic chunking. @@ -4135,15 +4014,6 @@ methods: description: Blob-updated property dict (Etag and last modified) types: - [, ] - examples: - - "Upload a blob to the container.\n\n\n\n````python\n\ - \n # Upload content to block blob\n with open(SOURCE_FILE, \"rb\") as data:\n\ - \ blob_client.upload_blob(data, blob_type=\"BlockBlob\")\n\n ````\n" - uid: azure.storage.blob.BlobClient.upload_blob_from_url name: upload_blob_from_url summary: 'Creates a new Block Blob where the content of the blob is read from a diff --git a/docs-ref-autogen/azure-storage-blob/azure.storage.blob.BlobServiceClient.yml b/docs-ref-autogen/azure-storage-blob/azure.storage.blob.BlobServiceClient.yml index 2abf5d9a6e12..3859b4c4d0bb 100644 --- a/docs-ref-autogen/azure-storage-blob/azure.storage.blob.BlobServiceClient.yml +++ b/docs-ref-autogen/azure-storage-blob/azure.storage.blob.BlobServiceClient.yml @@ -117,28 +117,6 @@ constructor: or 4MB.' types: - -examples: -- "Creating the BlobServiceClient with account url and credential.\n\n\n\n````python\n\n from azure.storage.blob import BlobServiceClient\n\ - \ blob_service_client = BlobServiceClient(account_url=self.url, credential=self.shared_access_key)\n\ - \n ````\n\nCreating the BlobServiceClient with Azure Identity credentials.\n\n\n\n````python\n\n # Get a token credential for authentication\n \ - \ from azure.identity import ClientSecretCredential\n token_credential = ClientSecretCredential(\n\ - \ self.active_directory_tenant_id,\n self.active_directory_application_id,\n\ - \ self.active_directory_application_secret\n )\n\n # Instantiate a BlobServiceClient\ - \ using a token credential\n from azure.storage.blob import BlobServiceClient\n\ - \ blob_service_client = BlobServiceClient(account_url=self.oauth_url, credential=token_credential)\n\ - \n ````\n" methods: - uid: azure.storage.blob.BlobServiceClient.create_container name: create_container @@ -197,16 +175,6 @@ methods: return: types: - - examples: - - "Creating a container in the blob service.\n\n\n\n````python\n\ - \n try:\n new_container = blob_service_client.create_container(\"containerfromblobservice\"\ - )\n properties = new_container.get_container_properties()\n except ResourceExistsError:\n\ - \ print(\"Container already exists.\")\n\n ````\n" - uid: azure.storage.blob.BlobServiceClient.delete_container name: delete_container summary: 'Marks the specified container for deletion. @@ -284,16 +252,6 @@ methods: return: types: - - examples: - - "Deleting a container in the blob service.\n\n\n\n````python\n\ - \n # Delete container if it exists\n try:\n blob_service_client.delete_container(\"\ - containerfromblobservice\")\n except ResourceNotFoundError:\n print(\"\ - Container already deleted.\")\n\n ````\n" - uid: azure.storage.blob.BlobServiceClient.find_blobs_by_tags name: find_blobs_by_tags summary: 'The Filter Blobs operation enables callers to list blobs across all @@ -371,16 +329,6 @@ methods: description: A Blob service client. types: - - examples: - - "Creating the BlobServiceClient from a connection string.\n\n\n\n````python\n\n from azure.storage.blob import BlobServiceClient\n\ - \ blob_service_client = BlobServiceClient.from_connection_string(self.connection_string)\n\ - \n ````\n" - uid: azure.storage.blob.BlobServiceClient.get_account_information name: get_account_information summary: 'Gets information related to the storage account. @@ -395,15 +343,6 @@ methods: description: A dict of account information (SKU and account type). types: - (, ) - examples: - - "Getting account information for the blob service.\n\n\n\n````python\n\n account_info = blob_service_client.get_account_information()\n\ - \ print('Using Storage SKU: {}'.format(account_info['sku_name']))\n\n ````\n" - uid: azure.storage.blob.BlobServiceClient.get_blob_client name: get_blob_client summary: 'Get a client to interact with the specified blob. @@ -444,16 +383,6 @@ methods: description: A BlobClient. types: - - examples: - - "Getting the blob client to interact with a specific blob.\n\n\n\n````python\n\n blob_client = blob_service_client.get_blob_client(container=\"\ - containertest\", blob=\"my_blob\")\n try:\n stream = blob_client.download_blob()\n\ - \ except ResourceNotFoundError:\n print(\"No blob found.\")\n\n ````\n" - uid: azure.storage.blob.BlobServiceClient.get_container_client name: get_container_client summary: 'Get a client to interact with the specified container. @@ -474,18 +403,6 @@ methods: description: A ContainerClient. types: - - examples: - - "Getting the container client to interact with a specific container.\n\n\n\n````python\n\n # Get a client to interact with a specific container\ - \ - though it may not yet exist\n container_client = blob_service_client.get_container_client(\"\ - containertest\")\n try:\n for blob in container_client.list_blobs():\n\ - \ print(\"Found blob: \", blob.name)\n except ResourceNotFoundError:\n\ - \ print(\"Container not found.\")\n\n ````\n" - uid: azure.storage.blob.BlobServiceClient.get_service_properties name: get_service_properties summary: 'Gets the properties of a storage account''s Blob service, including @@ -511,15 +428,6 @@ methods: analytics logging, hour/minute metrics, cors rules, etc.' types: - [, ] - examples: - - "Getting service properties for the blob service.\n\n\n\n````python\n\n properties = blob_service_client.get_service_properties()\n\ - \n ````\n" - uid: azure.storage.blob.BlobServiceClient.get_service_stats name: get_service_stats summary: 'Retrieves statistics related to replication for the Blob service. @@ -571,14 +479,6 @@ methods: description: The blob service stats. types: - [, ] - examples: - - "Getting service stats for the blob service.\n\n\n\n````python\n\ - \n stats = blob_service_client.get_service_stats()\n\n ````\n" - uid: azure.storage.blob.BlobServiceClient.get_user_delegation_key name: get_user_delegation_key summary: 'Obtain a user delegation key for the purpose of signing SAS tokens. @@ -675,18 +575,6 @@ methods: description: An iterable (auto-paging) of ContainerProperties. types: - [] - examples: - - "Listing the containers in the blob service.\n\n\n\n````python\n\ - \n # List all containers\n all_containers = blob_service_client.list_containers(include_metadata=True)\n\ - \ for container in all_containers:\n print(container['name'], container['metadata'])\n\ - \n # Filter results with name prefix\n test_containers = blob_service_client.list_containers(name_starts_with='test-')\n\ - \ for container in test_containers:\n print(container['name'], container['metadata'])\n\ - \n ````\n" - uid: azure.storage.blob.BlobServiceClient.set_service_properties name: set_service_properties summary: 'Sets the properties of a storage account''s Blob service, including @@ -768,23 +656,6 @@ methods: return: types: - - examples: - - "Setting service properties for the blob service.\n\n\n\n````python\n\n # Create service properties\n from azure.storage.blob\ - \ import BlobAnalyticsLogging, Metrics, CorsRule, RetentionPolicy\n\n # Create\ - \ logging settings\n logging = BlobAnalyticsLogging(read=True, write=True, delete=True,\ - \ retention_policy=RetentionPolicy(enabled=True, days=5))\n\n # Create metrics\ - \ for requests statistics\n hour_metrics = Metrics(enabled=True, include_apis=True,\ - \ retention_policy=RetentionPolicy(enabled=True, days=5))\n minute_metrics =\ - \ Metrics(enabled=True, include_apis=True,\n retention_policy=RetentionPolicy(enabled=True,\ - \ days=5))\n\n # Create CORS rules\n cors_rule = CorsRule(['www.xyz.com'],\ - \ ['GET'])\n cors = [cors_rule]\n\n # Set the service properties\n blob_service_client.set_service_properties(logging,\ - \ hour_metrics, minute_metrics, cors)\n\n ````\n" - uid: azure.storage.blob.BlobServiceClient.undelete_container name: undelete_container summary: 'Restores soft-deleted container. diff --git a/docs-ref-autogen/azure-storage-blob/azure.storage.blob.ContainerClient.yml b/docs-ref-autogen/azure-storage-blob/azure.storage.blob.ContainerClient.yml index 2831f4e90b67..311faa211075 100644 --- a/docs-ref-autogen/azure-storage-blob/azure.storage.blob.ContainerClient.yml +++ b/docs-ref-autogen/azure-storage-blob/azure.storage.blob.ContainerClient.yml @@ -119,25 +119,6 @@ constructor: or 4MB.' types: - -examples: -- "Get a ContainerClient from an existing BlobServiceClient.\n\n\n\n````python\n\n # Instantiate a BlobServiceClient using a connection string\n\ - \ from azure.storage.blob import BlobServiceClient\n blob_service_client = BlobServiceClient.from_connection_string(self.connection_string)\n\ - \n # Instantiate a ContainerClient\n container_client = blob_service_client.get_container_client(\"\ - mynewcontainer\")\n\n ````\n\nCreating the container client directly.\n\n\n\n````python\n\n from azure.storage.blob import ContainerClient\n\n sas_url\ - \ = \"https://account.blob.core.windows.net/mycontainer?sv=2015-04-05&st=2015-04-29T22%3A18%3A26Z&se=2015-04-30T02%3A23%3A26Z&sr=b&sp=rw&sip=168.1.5.60-168.1.5.70&spr=https&sig=Z%2FRHIX5Xcg0Mq2rqI3OlWTjEg2tYkboXr1P9ZUXDtkk%3D\"\ - \n container = ContainerClient.from_container_url(sas_url)\n\n ````\n" methods: - uid: azure.storage.blob.ContainerClient.acquire_lease name: acquire_lease @@ -218,16 +199,6 @@ methods: description: A BlobLeaseClient object, that can be run in a context manager. types: - - examples: - - "Acquiring a lease on the container.\n\n\n\n````python\n\ - \n # Acquire a lease on the container\n lease = container_client.acquire_lease()\n\ - \n # Delete container by passing in the lease\n container_client.delete_container(lease=lease)\n\ - \n ````\n" - uid: azure.storage.blob.ContainerClient.create_container name: create_container summary: 'Creates a new container under the specified account. If the container @@ -275,14 +246,6 @@ methods: description: A dictionary of response headers. types: - [, [, ]] - examples: - - "Creating a container to store blobs.\n\n\n\n````python\n\ - \n container_client.create_container()\n\n ````\n" - uid: azure.storage.blob.ContainerClient.delete_blob name: delete_blob summary: 'Marks the specified blob or snapshot for deletion. @@ -521,17 +484,6 @@ methods: description: An iterator of responses, one for each blob in order types: - [] - examples: - - "Deleting multiple blobs.\n\ - \n\n\n````python\n\n # Delete multiple\ - \ blobs in the container by name\n container_client.delete_blobs(\"my_blob1\"\ - , \"my_blob2\")\n\n # Delete multiple blobs by properties iterator\n my_blobs\ - \ = container_client.list_blobs(name_starts_with=\"my_blob\")\n container_client.delete_blobs(*my_blobs)\n\ - \n ````\n" - uid: azure.storage.blob.ContainerClient.delete_container name: delete_container summary: 'Marks the specified container for deletion. The container and any blobs @@ -598,14 +550,6 @@ methods: return: types: - - examples: - - "Delete a container.\n\ - \n\n\n````python\n\ - \n container_client.delete_container()\n\n ````\n" - uid: azure.storage.blob.ContainerClient.download_blob name: download_blob summary: 'Downloads a blob to the StorageStreamDownloader. The readall() method @@ -879,16 +823,6 @@ methods: description: A container client. types: - - examples: - - "Creating the ContainerClient from a connection string.\n\n\n\n````python\n\n from azure.storage.blob import ContainerClient\n\ - \ container_client = ContainerClient.from_connection_string(\n self.connection_string,\ - \ container_name=\"mycontainer\")\n\n ````\n" - uid: azure.storage.blob.ContainerClient.from_container_url name: from_container_url summary: Create ContainerClient from a container url. @@ -974,16 +908,6 @@ methods: description: A BlobClient. types: - - examples: - - "Get the blob client.\n\ - \n\n\n````python\n\ - \n # Get the BlobClient from the ContainerClient to interact with a specific\ - \ blob\n blob_client = container_client.get_blob_client(\"mynewblob\")\n\n \ - \ ````\n" - uid: azure.storage.blob.ContainerClient.get_container_access_policy name: get_container_access_policy summary: 'Gets the permissions for the specified container. @@ -1014,14 +938,6 @@ methods: description: Access policy information in a dict. types: - [, ] - examples: - - "Getting the access policy on the container.\n\n\n\n````python\n\ - \n policy = container_client.get_container_access_policy()\n\n ````\n" - uid: azure.storage.blob.ContainerClient.get_container_properties name: get_container_properties summary: 'Returns all user-defined metadata and system properties for the specified @@ -1052,14 +968,6 @@ methods: description: Properties for the specified container within a container object. types: - - examples: - - "Getting properties on the container.\n\n\n\n````python\n\ - \n properties = container_client.get_container_properties()\n\n ````\n" - uid: azure.storage.blob.ContainerClient.list_blob_names name: list_blob_names summary: 'Returns a generator to list the names of blobs under the specified container. @@ -1144,15 +1052,6 @@ methods: description: An iterable (auto-paging) response of BlobProperties. types: - [] - examples: - - "List the blobs in the container.\n\n\n\n````python\n\ - \n blobs_list = container_client.list_blobs()\n for blob in blobs_list:\n\ - \ print(blob.name + '\\n')\n\n ````\n" - uid: azure.storage.blob.ContainerClient.set_container_access_policy name: set_container_access_policy summary: 'Sets the permissions for the specified container or stored access @@ -1228,20 +1127,6 @@ methods: types: - [, - ] - examples: - - "Setting access policy on the container.\n\n\n\n````python\n\ - \n # Create access policy\n from azure.storage.blob import AccessPolicy, ContainerSasPermissions\n\ - \ access_policy = AccessPolicy(permission=ContainerSasPermissions(read=True),\n\ - \ expiry=datetime.utcnow() + timedelta(hours=1),\n\ - \ start=datetime.utcnow() - timedelta(minutes=1))\n\ - \n identifiers = {'test': access_policy}\n\n # Set the access policy on the\ - \ container\n container_client.set_container_access_policy(signed_identifiers=identifiers)\n\ - \n ````\n" - uid: azure.storage.blob.ContainerClient.set_container_metadata name: set_container_metadata summary: 'Sets one or more user-defined name-value pairs for the specified @@ -1317,16 +1202,6 @@ methods: types: - [, - ] - examples: - - "Setting metadata on the container.\n\n\n\n````python\n\ - \n # Create key, value pairs for metadata\n metadata = {'type': 'test'}\n\n\ - \ # Set metadata on the container\n container_client.set_container_metadata(metadata=metadata)\n\ - \n ````\n" - uid: azure.storage.blob.ContainerClient.set_premium_page_blob_tier_blobs name: set_premium_page_blob_tier_blobs summary: 'Sets the page blob tiers on all blobs. This API is only supported for @@ -1725,16 +1600,6 @@ methods: description: A BlobClient to interact with the newly uploaded blob. types: - - examples: - - "Upload blob to the container.\n\n\n\n````python\n\ - \n with open(SOURCE_FILE, \"rb\") as data:\n blob_client = container_client.upload_blob(name=\"\ - myblob\", data=data)\n\n properties = blob_client.get_blob_properties()\n\n\ - \ ````\n" - uid: azure.storage.blob.ContainerClient.walk_blobs name: walk_blobs summary: 'Returns a generator to list the blobs under the specified container. diff --git a/docs-ref-autogen/azure-storage-blob/azure.storage.blob.StorageStreamDownloader.yml b/docs-ref-autogen/azure-storage-blob/azure.storage.blob.StorageStreamDownloader.yml index 041e7e4c3bb9..6b53b20ee64c 100644 --- a/docs-ref-autogen/azure-storage-blob/azure.storage.blob.StorageStreamDownloader.yml +++ b/docs-ref-autogen/azure-storage-blob/azure.storage.blob.StorageStreamDownloader.yml @@ -64,19 +64,6 @@ methods: return: types: - [] - examples: - - "Download a blob using chunks().\n\n\n\n````python\n\ - \n # This returns a StorageStreamDownloader.\n stream = source_blob_client.download_blob()\n\ - \ block_list = []\n\n # Read data in chunks to avoid loading all into memory\ - \ at once\n for chunk in stream.chunks():\n # process your data (anything\ - \ can be done here really. `chunk` is a byte array).\n block_id = str(uuid.uuid4())\n\ - \ destination_blob_client.stage_block(block_id=block_id, data=chunk)\n \ - \ block_list.append(BlobBlock(block_id=block_id))\n\n\n ````\n" - uid: azure.storage.blob.StorageStreamDownloader.content_as_bytes name: content_as_bytes summary: 'DEPRECATED: Download the contents of this file. diff --git a/docs-ref-autogen/azure-storage-blob/azure.storage.blob.aio.BlobClient.yml b/docs-ref-autogen/azure-storage-blob/azure.storage.blob.aio.BlobClient.yml index 9558c1f0c097..4b54960cd61b 100644 --- a/docs-ref-autogen/azure-storage-blob/azure.storage.blob.aio.BlobClient.yml +++ b/docs-ref-autogen/azure-storage-blob/azure.storage.blob.aio.BlobClient.yml @@ -124,24 +124,6 @@ constructor: or 4MB.' types: - -examples: -- "Creating the BlobClient from a URL to a public blob (no auth needed).\n\n\n\n````python\n\n from azure.storage.blob.aio import\ - \ BlobClient\n blob_client = BlobClient.from_blob_url(blob_url=\"https://account.blob.core.windows.net/container/blob-name\"\ - )\n\n ````\n\nCreating the BlobClient from a SAS URL to a blob.\n\n\n\n````python\n\n from azure.storage.blob.aio import\ - \ BlobClient\n\n sas_url = \"https://account.blob.core.windows.net/container/blob-name?sv=2015-04-05&st=2015-04-29T22%3A18%3A26Z&se=2015-04-30T02%3A23%3A26Z&sr=b&sp=rw&sip=168.1.5.60-168.1.5.70&spr=https&sig=Z%2FRHIX5Xcg0Mq2rqI3OlWTjEg2tYkboXr1P9ZUXDtkk%3D\"\ - \n blob_client = BlobClient.from_blob_url(sas_url)\n\n ````\n" methods: - uid: azure.storage.blob.aio.BlobClient.abort_copy name: abort_copy @@ -165,17 +147,6 @@ methods: return: types: - - examples: - - "Abort copying a blob from URL.\n\n\n\n````python\n\ - \n # Passing in copy id to abort copy operation\n if props.copy.status !=\ - \ \"success\":\n await copied_blob.abort_copy(copy_id)\n\n # check copy\ - \ status\n props = await copied_blob.get_blob_properties()\n print(props.copy.status)\n\ - \n ````\n" - uid: azure.storage.blob.aio.BlobClient.acquire_lease name: acquire_lease summary: 'Requests a new lease. @@ -268,17 +239,6 @@ methods: description: A BlobLeaseClient object. types: - - examples: - - "Acquiring a lease on a blob.\n\n\n\n````python\n\ - \n # Get the blob client\n blob_client = blob_service_client.get_blob_client(\"\ - leasemyblobscontainerasync\", \"my_blob\")\n\n # Acquire a lease on the blob\n\ - \ lease = await blob_client.acquire_lease()\n\n # Delete blob by passing in\ - \ the lease\n await blob_client.delete_blob(lease=lease)\n\n ````\n" - uid: azure.storage.blob.aio.BlobClient.append_block name: append_block summary: Commits a new block of data to the end of the existing append blob. @@ -1352,17 +1312,6 @@ methods: description: Blob-updated property dict (Snapshot ID, Etag, and last modified). types: - [, ] - examples: - - "Create a snapshot of the blob.\n\n\n\n````python\n\ - \n # Create a read-only snapshot of the blob at this point in time\n snapshot_blob\ - \ = await blob_client.create_snapshot()\n\n # Get the snapshot ID\n print(snapshot_blob.get('snapshot'))\n\ - \n # Delete only the snapshot (blob itself is retained)\n await blob_client.delete_blob(delete_snapshots=\"\ - only\")\n\n ````\n" - uid: azure.storage.blob.aio.BlobClient.delete_blob name: delete_blob summary: 'Marks the specified blob for deletion. @@ -1481,14 +1430,6 @@ methods: return: types: - - examples: - - "Delete a blob.\n\n\n\n````python\n\ - \n await blob_client.delete_blob()\n\n ````\n" - uid: azure.storage.blob.aio.BlobClient.delete_immutability_policy name: delete_immutability_policy summary: 'The Delete Immutability Policy operation deletes the immutability policy @@ -1678,15 +1619,6 @@ methods: description: A streaming object (StorageStreamDownloader) types: - - examples: - - "Download a blob.\n\n\n\n````python\n\ - \n with open(DEST_FILE, \"wb\") as my_blob:\n stream = await blob_client.download_blob()\n\ - \ data = await stream.readall()\n my_blob.write(data)\n\n ````\n" - uid: azure.storage.blob.aio.BlobClient.exists name: exists summary: 'Returns True if a blob exists with the defined parameters, and returns @@ -1826,14 +1758,6 @@ methods: description: BlobProperties types: - - examples: - - "Getting the properties for a blob.\n\n\n\n````python\n\ - \n properties = await blob_client.get_blob_properties()\n\n ````\n" - uid: azure.storage.blob.aio.BlobClient.get_blob_tags name: get_blob_tags summary: 'The Get Tags operation enables users to get tags on a blob or specific @@ -3545,18 +3469,6 @@ methods: description: A dictionary of copy properties (etag, last_modified, copy_id, copy_status). types: - [, [, ]] - examples: - - "Copy a blob from a URL.\n\n\n\n````python\n\ - \n # Get the blob client with the source blob\n source_blob = \"https://www.gutenberg.org/files/59466/59466-0.txt\"\ - \n copied_blob = blob_service_client.get_blob_client(\"copyblobcontainerasync\"\ - , '59466-0.txt')\n\n # start copy and check copy status\n copy = await copied_blob.start_copy_from_url(source_blob)\n\ - \ props = await copied_blob.get_blob_properties()\n print(props.copy.status)\n\ - \n ````\n" - uid: azure.storage.blob.aio.BlobClient.undelete_blob name: undelete_blob summary: 'Restores soft-deleted blobs or snapshots. @@ -3590,15 +3502,6 @@ methods: return: types: - - examples: - - "Undeleting a blob.\n\ - \n\n\n````python\n\ - \n # Undelete the blob before the retention policy expires\n await blob_client.undelete_blob()\n\ - \n ````\n" - uid: azure.storage.blob.aio.BlobClient.upload_blob name: upload_blob summary: Creates a new blob from a data source with automatic chunking. @@ -3858,15 +3761,6 @@ methods: description: Blob-updated property dict (Etag and last modified) types: - [, ] - examples: - - "Upload a blob to the container.\n\n\n\n````python\n\ - \n # Upload content to block blob\n with open(SOURCE_FILE, \"rb\") as data:\n\ - \ await blob_client.upload_blob(data, blob_type=\"BlockBlob\")\n\n ````\n" - uid: azure.storage.blob.aio.BlobClient.upload_blob_from_url name: upload_blob_from_url summary: 'Creates a new Block Blob where the content of the blob is read from a diff --git a/docs-ref-autogen/azure-storage-blob/azure.storage.blob.aio.BlobServiceClient.yml b/docs-ref-autogen/azure-storage-blob/azure.storage.blob.aio.BlobServiceClient.yml index aed7394c15e8..34f6393fb633 100644 --- a/docs-ref-autogen/azure-storage-blob/azure.storage.blob.aio.BlobServiceClient.yml +++ b/docs-ref-autogen/azure-storage-blob/azure.storage.blob.aio.BlobServiceClient.yml @@ -113,28 +113,6 @@ constructor: or 4MB.' types: - -examples: -- "Creating the BlobServiceClient with account url and credential.\n\n\n\n````python\n\n from azure.storage.blob.aio import\ - \ BlobServiceClient\n blob_service_client = BlobServiceClient(account_url=self.url,\ - \ credential=self.shared_access_key)\n\n ````\n\nCreating the BlobServiceClient\ - \ with Azure Identity credentials.\n\n\n\n````python\n\n # Get a token\ - \ credential for authentication\n from azure.identity.aio import ClientSecretCredential\n\ - \ token_credential = ClientSecretCredential(\n self.active_directory_tenant_id,\n\ - \ self.active_directory_application_id,\n self.active_directory_application_secret\n\ - \ )\n\n # Instantiate a BlobServiceClient using a token credential\n from\ - \ azure.storage.blob.aio import BlobServiceClient\n blob_service_client = BlobServiceClient(account_url=self.oauth_url,\ - \ credential=token_credential)\n\n ````\n" methods: - uid: azure.storage.blob.aio.BlobServiceClient.create_container name: create_container @@ -193,17 +171,6 @@ methods: return: types: - - examples: - - "Creating a container in the blob service.\n\n\n\n````python\n\ - \n try:\n new_container = await blob_service_client.create_container(\"\ - containerfromblobserviceasync\")\n properties = await new_container.get_container_properties()\n\ - \ except ResourceExistsError:\n print(\"Container already exists.\")\n\ - \n ````\n" - uid: azure.storage.blob.aio.BlobServiceClient.delete_container name: delete_container summary: 'Marks the specified container for deletion. @@ -281,16 +248,6 @@ methods: return: types: - - examples: - - "Deleting a container in the blob service.\n\n\n\n````python\n\ - \n # Delete container if it exists\n try:\n await blob_service_client.delete_container(\"\ - containerfromblobserviceasync\")\n except ResourceNotFoundError:\n print(\"\ - Container already deleted.\")\n\n ````\n" - uid: azure.storage.blob.aio.BlobServiceClient.find_blobs_by_tags name: find_blobs_by_tags summary: 'The Filter Blobs operation enables callers to list blobs across all @@ -345,15 +302,6 @@ methods: description: A dict of account information (SKU and account type). types: - (, ) - examples: - - "Getting account information for the blob service.\n\n\n\n````python\n\n account_info = await blob_service_client.get_account_information()\n\ - \ print('Using Storage SKU: {}'.format(account_info['sku_name']))\n\n ````\n" - uid: azure.storage.blob.aio.BlobServiceClient.get_blob_client name: get_blob_client summary: 'Get a client to interact with the specified blob. @@ -396,16 +344,6 @@ methods: description: A BlobClient. types: - - examples: - - "Getting the blob client to interact with a specific blob.\n\n\n\n````python\n\n blob_client = blob_service_client.get_blob_client(container=\"\ - containertestasync\", blob=\"my_blob\")\n try:\n stream = await blob_client.download_blob()\n\ - \ except ResourceNotFoundError:\n print(\"No blob found.\")\n\n ````\n" - uid: azure.storage.blob.aio.BlobServiceClient.get_container_client name: get_container_client summary: 'Get a client to interact with the specified container. @@ -426,20 +364,6 @@ methods: description: A ContainerClient. types: - - examples: - - "Getting the container client to interact with a specific container.\n\n\n\n````python\n\n # Get a client to interact with a specific container\ - \ - though it may not yet exist\n container_client = blob_service_client.get_container_client(\"\ - containertestasync\")\n try:\n blobs_list = []\n async for blob\ - \ in container_client.list_blobs():\n blobs_list.append(blob)\n\n \ - \ for blob in blobs_list:\n print(\"Found blob: \", blob.name)\n\ - \ except ResourceNotFoundError:\n print(\"Container not found.\")\n\n\ - \ ````\n" - uid: azure.storage.blob.aio.BlobServiceClient.get_service_properties name: get_service_properties summary: 'Gets the properties of a storage account''s Blob service, including @@ -465,15 +389,6 @@ methods: analytics logging, hour/minute metrics, cors rules, etc.' types: - [, ] - examples: - - "Getting service properties for the blob service.\n\n\n\n````python\n\n properties = await blob_service_client.get_service_properties()\n\ - \n ````\n" - uid: azure.storage.blob.aio.BlobServiceClient.get_service_stats name: get_service_stats summary: 'Retrieves statistics related to replication for the Blob service. @@ -525,14 +440,6 @@ methods: description: The blob service stats. types: - [, ] - examples: - - "Getting service stats for the blob service.\n\n\n\n````python\n\ - \n stats = await blob_service_client.get_service_stats()\n\n ````\n" - uid: azure.storage.blob.aio.BlobServiceClient.get_user_delegation_key name: get_user_delegation_key summary: 'Obtain a user delegation key for the purpose of signing SAS tokens. @@ -629,20 +536,6 @@ methods: description: An iterable (auto-paging) of ContainerProperties. types: - [] - examples: - - "Listing the containers in the blob service.\n\n\n\n````python\n\ - \n # List all containers\n all_containers = []\n async for container in\ - \ blob_service_client.list_containers(include_metadata=True):\n all_containers.append(container)\n\ - \n for container in all_containers:\n print(container['name'], container['metadata'])\n\ - \n # Filter results with name prefix\n test_containers = []\n async for\ - \ name in blob_service_client.list_containers(name_starts_with='test-'):\n \ - \ test_containers.append(name)\n\n for container in test_containers:\n \ - \ print(container['name'], container['metadata'])\n\n ````\n" - uid: azure.storage.blob.aio.BlobServiceClient.set_service_properties name: set_service_properties summary: 'Sets the properties of a storage account''s Blob service, including @@ -724,24 +617,6 @@ methods: return: types: - - examples: - - "Setting service properties for the blob service.\n\n\n\n````python\n\n # Create service properties\n from azure.storage.blob\ - \ import BlobAnalyticsLogging, Metrics, CorsRule, RetentionPolicy\n\n # Create\ - \ logging settings\n logging = BlobAnalyticsLogging(read=True, write=True, delete=True,\ - \ retention_policy=RetentionPolicy(enabled=True, days=5))\n\n # Create metrics\ - \ for requests statistics\n hour_metrics = Metrics(enabled=True, include_apis=True,\ - \ retention_policy=RetentionPolicy(enabled=True, days=5))\n minute_metrics =\ - \ Metrics(enabled=True, include_apis=True,\n retention_policy=RetentionPolicy(enabled=True,\ - \ days=5))\n\n # Create CORS rules\n cors_rule = CorsRule(['www.xyz.com'],\ - \ ['GET'])\n cors = [cors_rule]\n\n # Set the service properties\n await\ - \ blob_service_client.set_service_properties(logging, hour_metrics, minute_metrics,\ - \ cors)\n\n ````\n" - uid: azure.storage.blob.aio.BlobServiceClient.undelete_container name: undelete_container summary: 'Restores soft-deleted container. diff --git a/docs-ref-autogen/azure-storage-blob/azure.storage.blob.aio.ContainerClient.yml b/docs-ref-autogen/azure-storage-blob/azure.storage.blob.aio.ContainerClient.yml index 42d88d913c71..f5df42f302e0 100644 --- a/docs-ref-autogen/azure-storage-blob/azure.storage.blob.aio.ContainerClient.yml +++ b/docs-ref-autogen/azure-storage-blob/azure.storage.blob.aio.ContainerClient.yml @@ -116,26 +116,6 @@ constructor: or 4MB.' types: - -examples: -- "Get a ContainerClient from an existing BlobServiceClient.\n\n\n\n````python\n\n # Instantiate a BlobServiceClient using a connection\ - \ string\n from azure.storage.blob.aio import BlobServiceClient\n blob_service_client\ - \ = BlobServiceClient.from_connection_string(self.connection_string)\n\n # Instantiate\ - \ a ContainerClient\n container_client = blob_service_client.get_container_client(\"\ - mynewcontainerasync\")\n\n ````\n\nCreating the container client directly.\n\n\n\n````python\n\n from azure.storage.blob.aio import ContainerClient\n\ - \n sas_url = sas_url = \"https://account.blob.core.windows.net/mycontainer?sv=2015-04-05&st=2015-04-29T22%3A18%3A26Z&se=2015-04-30T02%3A23%3A26Z&sr=b&sp=rw&sip=168.1.5.60-168.1.5.70&spr=https&sig=Z%2FRHIX5Xcg0Mq2rqI3OlWTjEg2tYkboXr1P9ZUXDtkk%3D\"\ - \n container = ContainerClient.from_container_url(sas_url)\n\n ````\n" methods: - uid: azure.storage.blob.aio.ContainerClient.acquire_lease name: acquire_lease @@ -216,16 +196,6 @@ methods: description: A BlobLeaseClient object, that can be run in a context manager. types: - - examples: - - "Acquiring a lease on the container.\n\n\n\n````python\n\ - \n # Acquire a lease on the container\n lease = await container_client.acquire_lease()\n\ - \n # Delete container by passing in the lease\n await container_client.delete_container(lease=lease)\n\ - \n ````\n" - uid: azure.storage.blob.aio.ContainerClient.create_container name: create_container summary: 'Creates a new container under the specified account. If the container @@ -273,14 +243,6 @@ methods: description: A dictionary of response headers. types: - [, [, ]] - examples: - - "Creating a container to store blobs.\n\n\n\n````python\n\ - \n await container_client.create_container()\n\n ````\n" - uid: azure.storage.blob.aio.ContainerClient.delete_blob name: delete_blob summary: 'Marks the specified blob or snapshot for deletion. @@ -519,18 +481,6 @@ methods: description: An async iterator of responses, one for each blob in order types: - [] - examples: - - "Deleting multiple blobs.\n\n\n\n````python\n\ - \n # Delete multiple blobs in the container by name\n await container_client.delete_blobs(\"\ - my_blob1\", \"my_blob2\")\n\n # Delete multiple blobs by properties iterator\n\ - \ my_blobs = container_client.list_blobs(name_starts_with=\"my_blob\")\n await\ - \ container_client.delete_blobs(*[b async for b in my_blobs]) # async for in\ - \ list comprehension after 3.6 only\n\n ````\n" - uid: azure.storage.blob.aio.ContainerClient.delete_container name: delete_container summary: 'Marks the specified container for deletion. The container and any blobs @@ -597,14 +547,6 @@ methods: return: types: - - examples: - - "Delete a container.\n\n\n\n````python\n\ - \n await container_client.delete_container()\n\n ````\n" - uid: azure.storage.blob.aio.ContainerClient.download_blob name: download_blob summary: 'Downloads a blob to the StorageStreamDownloader. The readall() method @@ -877,16 +819,6 @@ methods: description: A BlobClient. types: - - examples: - - "Get the blob client.\n\n\n\n````python\n\ - \n # Get the BlobClient from the ContainerClient to interact with a specific\ - \ blob\n blob_client = container_client.get_blob_client(\"mynewblob\")\n\n \ - \ ````\n" - uid: azure.storage.blob.aio.ContainerClient.get_container_access_policy name: get_container_access_policy summary: 'Gets the permissions for the specified container. @@ -917,14 +849,6 @@ methods: description: Access policy information in a dict. types: - [, ] - examples: - - "Getting the access policy on the container.\n\n\n\n````python\n\ - \n policy = await container_client.get_container_access_policy()\n\n ````\n" - uid: azure.storage.blob.aio.ContainerClient.get_container_properties name: get_container_properties summary: 'Returns all user-defined metadata and system properties for the specified @@ -955,14 +879,6 @@ methods: description: Properties for the specified container within a container object. types: - - examples: - - "Getting properties on the container.\n\n\n\n````python\n\ - \n properties = await container_client.get_container_properties()\n\n ````\n" - uid: azure.storage.blob.aio.ContainerClient.list_blob_names name: list_blob_names summary: 'Returns a generator to list the names of blobs under the specified container. @@ -1047,15 +963,6 @@ methods: description: An iterable (auto-paging) response of BlobProperties. types: - [] - examples: - - "List the blobs in the container.\n\n\n\n````python\n\ - \n blobs_list = []\n async for blob in container_client.list_blobs():\n \ - \ blobs_list.append(blob)\n\n ````\n" - uid: azure.storage.blob.aio.ContainerClient.set_container_access_policy name: set_container_access_policy summary: 'Sets the permissions for the specified container or stored access @@ -1131,20 +1038,6 @@ methods: types: - [, - ] - examples: - - "Setting access policy on the container.\n\n\n\n````python\n\ - \n # Create access policy\n from azure.storage.blob import AccessPolicy, ContainerSasPermissions\n\ - \ access_policy = AccessPolicy(permission=ContainerSasPermissions(read=True),\n\ - \ expiry=datetime.utcnow() + timedelta(hours=1),\n\ - \ start=datetime.utcnow() - timedelta(minutes=1))\n\ - \n identifiers = {'my-access-policy-id': access_policy}\n\n # Set the access\ - \ policy on the container\n await container_client.set_container_access_policy(signed_identifiers=identifiers)\n\ - \n ````\n" - uid: azure.storage.blob.aio.ContainerClient.set_container_metadata name: set_container_metadata summary: 'Sets one or more user-defined name-value pairs for the specified @@ -1198,16 +1091,6 @@ methods: - return: description: Container-updated property dict (Etag and last modified). - examples: - - "Setting metadata on the container.\n\n\n\n````python\n\ - \n # Create key, value pairs for metadata\n metadata = {'type': 'test'}\n\n\ - \ # Set metadata on the container\n await container_client.set_container_metadata(metadata=metadata)\n\ - \n ````\n" - uid: azure.storage.blob.aio.ContainerClient.set_premium_page_blob_tier_blobs name: set_premium_page_blob_tier_blobs summary: 'Sets the page blob tiers on the blobs. This API is only supported for @@ -1613,16 +1496,6 @@ methods: description: A BlobClient to interact with the newly uploaded blob. types: - - examples: - - "Upload blob to the container.\n\n\n\n````python\n\ - \n with open(SOURCE_FILE, \"rb\") as data:\n blob_client = await container_client.upload_blob(name=\"\ - myblob\", data=data)\n\n properties = await blob_client.get_blob_properties()\n\ - \n ````\n" - uid: azure.storage.blob.aio.ContainerClient.walk_blobs name: walk_blobs summary: 'Returns a generator to list the blobs under the specified container. diff --git a/docs-ref-autogen/azure-storage-blob/azure.storage.blob.aio.StorageStreamDownloader.yml b/docs-ref-autogen/azure-storage-blob/azure.storage.blob.aio.StorageStreamDownloader.yml index 57b50dc84b6d..d0b4a6f6ebdc 100644 --- a/docs-ref-autogen/azure-storage-blob/azure.storage.blob.aio.StorageStreamDownloader.yml +++ b/docs-ref-autogen/azure-storage-blob/azure.storage.blob.aio.StorageStreamDownloader.yml @@ -64,19 +64,6 @@ methods: return: types: - [] - examples: - - "Download a blob using chunks().\n\n\n\n````python\n\ - \n # This returns a StorageStreamDownloader.\n stream = await source_blob_client.download_blob()\n\ - \ block_list = []\n\n # Read data in chunks to avoid loading all into memory\ - \ at once\n async for chunk in stream.chunks():\n # process your data\ - \ (anything can be done here really. `chunk` is a byte array).\n block_id\ - \ = str(uuid.uuid4())\n await destination_blob_client.stage_block(block_id=block_id,\ - \ data=chunk)\n block_list.append(BlobBlock(block_id=block_id))\n\n ````\n" - uid: azure.storage.blob.aio.StorageStreamDownloader.content_as_bytes name: content_as_bytes summary: 'DEPRECATED: Download the contents of this file. diff --git a/docs-ref-autogen/azure-storage-blob/azure.storage.blob.yml b/docs-ref-autogen/azure-storage-blob/azure.storage.blob.yml index 02953d4a6447..fddd6fec444d 100644 --- a/docs-ref-autogen/azure-storage-blob/azure.storage.blob.yml +++ b/docs-ref-autogen/azure-storage-blob/azure.storage.blob.yml @@ -202,19 +202,6 @@ functions: description: A Shared Access Signature (sas) token. types: - - examples: - - "Generating a shared access signature.\n\n\n\n````python\n\ - \n # Create a SAS token to use to authenticate a new client\n from datetime\ - \ import datetime, timedelta\n from azure.storage.blob import ResourceTypes,\ - \ AccountSasPermissions, generate_account_sas\n\n sas_token = generate_account_sas(\n\ - \ blob_service_client.account_name,\n account_key=blob_service_client.credential.account_key,\n\ - \ resource_types=ResourceTypes(object=True),\n permission=AccountSasPermissions(read=True),\n\ - \ expiry=datetime.utcnow() + timedelta(hours=1)\n )\n\n ````\n" - uid: azure.storage.blob.generate_blob_sas name: generate_blob_sas summary: 'Generates a shared access signature for a blob. @@ -575,17 +562,6 @@ functions: description: A Shared Access Signature (sas) token. types: - - examples: - - "Generating a sas token.\n\n\n\n````python\n\ - \n # Use access policy to generate a sas token\n from azure.storage.blob import\ - \ generate_container_sas\n\n sas_token = generate_container_sas(\n container_client.account_name,\n\ - \ container_client.container_name,\n account_key=container_client.credential.account_key,\n\ - \ policy_id='my-access-policy-id'\n )\n\n ````\n" - uid: azure.storage.blob.upload_blob_to_url name: upload_blob_to_url summary: 'Upload data to a given URL diff --git a/docs-ref-autogen/azure-storage-file-datalake/azure.storage.filedatalake.DataLakeDirectoryClient.yml b/docs-ref-autogen/azure-storage-file-datalake/azure.storage.filedatalake.DataLakeDirectoryClient.yml index 1dd8d8e2b805..fa5ed657f473 100644 --- a/docs-ref-autogen/azure-storage-file-datalake/azure.storage.filedatalake.DataLakeDirectoryClient.yml +++ b/docs-ref-autogen/azure-storage-file-datalake/azure.storage.filedatalake.DataLakeDirectoryClient.yml @@ -78,16 +78,6 @@ variables: name: primary_hostname types: - -examples: -- "Creating the DataLakeServiceClient from connection string.\n\n\n\n````python\n\n from azure.storage.filedatalake\ - \ import DataLakeDirectoryClient\n DataLakeDirectoryClient.from_connection_string(connection_string,\ - \ \"myfilesystem\", \"mydirectory\")\n\n ````\n" methods: - uid: azure.storage.filedatalake.DataLakeDirectoryClient.create_directory name: create_directory @@ -240,14 +230,6 @@ methods: description: A dictionary of response headers. types: - [, [, ]] - examples: - - "Create directory.\n\ - \n\n\n````python\n\ - \n directory_client.create_directory()\n\n ````\n" - uid: azure.storage.filedatalake.DataLakeDirectoryClient.create_file name: create_file summary: Create a new file and return the file client to be interacted with. @@ -638,14 +620,6 @@ methods: - return: description: None - examples: - - "Delete directory.\n\ - \n\n\n````python\n\ - \n new_directory.delete_directory()\n\n ````\n" - uid: azure.storage.filedatalake.DataLakeDirectoryClient.delete_sub_directory name: delete_sub_directory summary: Marks the specified subdirectory for deletion. @@ -858,14 +832,6 @@ methods: return: types: - - examples: - - "Getting the properties for a file/directory.\n\n\n\n````python\n\ - \n props = new_directory.get_directory_properties()\n\n ````\n" - uid: azure.storage.filedatalake.DataLakeDirectoryClient.get_file_client name: get_file_client summary: 'Get a client to interact with the specified file. @@ -1023,14 +989,3 @@ methods: - return: description: DataLakeDirectoryClient - examples: - - "Rename the source directory.\n\n\n\n````python\n\ - \n new_dir_name = \"testdir2\"\n print(\"Renaming the directory named '{}'\ - \ to '{}'.\".format(dir_name, new_dir_name))\n new_directory = directory_client\\\ - \n .rename_directory(new_name=directory_client.file_system_name + '/' +\ - \ new_dir_name)\n\n ````\n" diff --git a/docs-ref-autogen/azure-storage-file-datalake/azure.storage.filedatalake.DataLakeFileClient.yml b/docs-ref-autogen/azure-storage-file-datalake/azure.storage.filedatalake.DataLakeFileClient.yml index 0ffdd4a5ad6c..0f40ba56215d 100644 --- a/docs-ref-autogen/azure-storage-file-datalake/azure.storage.filedatalake.DataLakeFileClient.yml +++ b/docs-ref-autogen/azure-storage-file-datalake/azure.storage.filedatalake.DataLakeFileClient.yml @@ -72,16 +72,6 @@ variables: name: primary_hostname types: - -examples: -- "Creating the DataLakeServiceClient from connection string.\n\n\n\n````python\n\n from azure.storage.filedatalake\ - \ import DataLakeFileClient\n DataLakeFileClient.from_connection_string(connection_string,\ - \ \"myfilesystem\", \"mydirectory\", \"myfile\")\n\n ````\n" methods: - uid: azure.storage.filedatalake.DataLakeFileClient.append_data name: append_data @@ -164,15 +154,6 @@ methods: - return: description: dict of the response header - examples: - - "Append data to the file.\n\n\n\n````python\n\ - \n file_client.append_data(data=file_content[2048:3072], offset=2048, length=1024)\n\ - \n ````\n" - uid: azure.storage.filedatalake.DataLakeFileClient.create_file name: create_file summary: Create a new file. @@ -342,15 +323,6 @@ methods: - return: description: response dict (Etag and last modified). - examples: - - "Create file.\n\n\n\n````python\n\ - \n file_client = filesystem_client.get_file_client(file_name)\n file_client.create_file()\n\ - \n ````\n" - uid: azure.storage.filedatalake.DataLakeFileClient.delete_file name: delete_file summary: Marks the specified file for deletion. @@ -413,14 +385,6 @@ methods: - return: description: None - examples: - - "Delete file.\n\n\n\n````python\n\ - \n new_client.delete_file()\n\n ````\n" - uid: azure.storage.filedatalake.DataLakeFileClient.download_file name: download_file summary: 'Downloads a file to the StorageStreamDownloader. The readall() method @@ -521,15 +485,6 @@ methods: description: A streaming object (StorageStreamDownloader) types: - - examples: - - "Return the downloaded data.\n\n\n\n````python\n\ - \n download = file_client.download_file()\n downloaded_bytes = download.readall()\n\ - \n ````\n" - uid: azure.storage.filedatalake.DataLakeFileClient.exists name: exists summary: Returns True if a file exists and returns False otherwise. @@ -693,16 +648,6 @@ methods: - return: description: response header in dict - examples: - - "Commit the previous appended data.\n\n\n\n````python\n\ - \n with open(SOURCE_FILE, \"rb\") as data:\n file_client = file_system_client.get_file_client(\"\ - myfile\")\n file_client.create_file()\n file_client.append_data(data,\ - \ 0)\n file_client.flush_data(data.tell())\n\n ````\n" - uid: azure.storage.filedatalake.DataLakeFileClient.from_connection_string name: from_connection_string summary: 'Create DataLakeFileClient from a Connection String. @@ -829,14 +774,6 @@ methods: return: types: - - examples: - - "Getting the properties for a file.\n\n\n\n````python\n\ - \n properties = file_client.get_file_properties()\n\n ````\n" - uid: azure.storage.filedatalake.DataLakeFileClient.query_file name: query_file summary: 'Enables users to select/project on datalake file data by providing simple @@ -960,21 +897,6 @@ methods: description: A streaming object (DataLakeFileQueryReader) types: - - examples: - - "select/project on datalake file data by providing simple query expressions.\n\n\n\n````python\n\n errors = []\n def on_error(error):\n\ - \ errors.append(error)\n\n # upload the csv file\n file_client = datalake_service_client.get_file_client(filesystem_name,\ - \ \"csvfile\")\n file_client.upload_data(CSV_DATA, overwrite=True)\n\n # select\ - \ the second column of the csv file\n query_expression = \"SELECT _2 from DataLakeStorage\"\ - \n input_format = DelimitedTextDialect(delimiter=',', quotechar='\"', lineterminator='\\\ - n', escapechar=\"\", has_header=False)\n output_format = DelimitedJsonDialect(delimiter='\\\ - n')\n reader = file_client.query_file(query_expression, on_error=on_error, file_format=input_format,\ - \ output_format=output_format)\n content = reader.readall()\n\n ````\n" - uid: azure.storage.filedatalake.DataLakeFileClient.rename_file name: rename_file summary: Rename the source file. @@ -1091,15 +1013,6 @@ methods: description: the renamed file client types: - - examples: - - "Rename the source file.\n\n\n\n````python\n\ - \n new_client = file_client.rename_file(file_client.file_system_name + '/' +\ - \ 'newname')\n\n ````\n" - uid: azure.storage.filedatalake.DataLakeFileClient.set_file_expiry name: set_file_expiry summary: Sets the time a file will expire and be deleted. diff --git a/docs-ref-autogen/azure-storage-file-datalake/azure.storage.filedatalake.DataLakeServiceClient.yml b/docs-ref-autogen/azure-storage-file-datalake/azure.storage.filedatalake.DataLakeServiceClient.yml index 2bfacfcff05e..2f130cde4245 100644 --- a/docs-ref-autogen/azure-storage-file-datalake/azure.storage.filedatalake.DataLakeServiceClient.yml +++ b/docs-ref-autogen/azure-storage-file-datalake/azure.storage.filedatalake.DataLakeServiceClient.yml @@ -74,27 +74,6 @@ variables: name: primary_hostname types: - -examples: -- "Creating the DataLakeServiceClient from connection string.\n\n\n\n````python\n\n from azure.storage.filedatalake import\ - \ DataLakeServiceClient\n datalake_service_client = DataLakeServiceClient.from_connection_string(self.connection_string)\n\ - \n ````\n\nCreating the DataLakeServiceClient with Azure Identity credentials.\n\n\n\n````python\n\n from azure.identity import ClientSecretCredential\n\ - \ token_credential = ClientSecretCredential(\n self.active_directory_tenant_id,\n\ - \ self.active_directory_application_id,\n self.active_directory_application_secret,\n\ - \ )\n datalake_service_client = DataLakeServiceClient(\"https://{}.dfs.core.windows.net\"\ - .format(self.account_name),\n \ - \ credential=token_credential)\n\n ````\n" methods: - uid: azure.storage.filedatalake.DataLakeServiceClient.close name: close @@ -159,15 +138,6 @@ methods: return: types: - - examples: - - "Creating a file system in the datalake service.\n\n\n\n````python\n\n datalake_service_client.create_file_system(\"\ - filesystem\")\n\n ````\n" - uid: azure.storage.filedatalake.DataLakeServiceClient.delete_file_system name: delete_file_system summary: 'Marks the specified file system for deletion. @@ -248,15 +218,6 @@ methods: return: types: - - examples: - - "Deleting a file system in the datalake service.\n\n\n\n````python\n\n datalake_service_client.delete_file_system(\"\ - filesystem\")\n\n ````\n" - uid: azure.storage.filedatalake.DataLakeServiceClient.from_connection_string name: from_connection_string summary: 'Create DataLakeServiceClient from a Connection String. @@ -290,16 +251,6 @@ methods: Credentials provided here will take precedence over those in the connection string.' defaultValue: None - examples: - - "Creating the DataLakeServiceClient from a connection string.\n\n\n\n````python\n\n from azure.storage.filedatalake\ - \ import DataLakeServiceClient\n datalake_service_client = DataLakeServiceClient.from_connection_string(self.connection_string)\n\ - \n ````\n" - uid: azure.storage.filedatalake.DataLakeServiceClient.get_directory_client name: get_directory_client summary: 'Get a client to interact with the specified directory. @@ -331,16 +282,6 @@ methods: description: A DataLakeDirectoryClient. types: - - examples: - - "Getting the directory client to interact with a specific directory.\n\n\n\n````python\n\n directory_client = datalake_service_client.get_directory_client(file_system_client.file_system_name,\n\ - \ \"mydirectory\"\ - )\n\n ````\n" - uid: azure.storage.filedatalake.DataLakeServiceClient.get_file_client name: get_file_client summary: 'Get a client to interact with the specified file. @@ -372,15 +313,6 @@ methods: description: A DataLakeFileClient. types: - - examples: - - "Getting the file client to interact with a specific file.\n\n\n\n````python\n\n file_client = datalake_service_client.get_file_client(file_system_client.file_system_name,\ - \ \"myfile\")\n\n ````\n" - uid: azure.storage.filedatalake.DataLakeServiceClient.get_file_system_client name: get_file_system_client summary: 'Get a client to interact with the specified file system. @@ -401,18 +333,6 @@ methods: description: A FileSystemClient. types: - - examples: - - "Getting the file system client to interact with a specific file system.\n\n\n\n````python\n\n # Instantiate a DataLakeServiceClient\ - \ using a connection string\n from azure.storage.filedatalake import DataLakeServiceClient\n\ - \ datalake_service_client = DataLakeServiceClient.from_connection_string(self.connection_string)\n\ - \n # Instantiate a FileSystemClient\n file_system_client = datalake_service_client.get_file_system_client(\"\ - mynewfilesystem\")\n\n ````\n" - uid: azure.storage.filedatalake.DataLakeServiceClient.get_service_properties name: get_service_properties summary: 'Gets the properties of a storage account''s datalake service, including @@ -475,17 +395,6 @@ methods: description: The user delegation key. types: - - examples: - - "Get user delegation key from datalake service client.\n\n\n\n````python\n\n from datetime import datetime, timedelta\n\ - \ user_delegation_key = datalake_service_client.get_user_delegation_key(datetime.utcnow(),\n\ - \ datetime.utcnow()\ - \ + timedelta(hours=1))\n\n ````\n" - uid: azure.storage.filedatalake.DataLakeServiceClient.list_file_systems name: list_file_systems summary: 'Returns a generator to list the file systems under the specified account. @@ -549,15 +458,6 @@ methods: description: An iterable (auto-paging) of FileSystemProperties. types: - [] - examples: - - "Listing the file systems in the datalake service.\n\n\n\n````python\n\n file_systems = datalake_service_client.list_file_systems()\n\ - \ for file_system in file_systems:\n print(file_system.name)\n\n ````\n" - uid: azure.storage.filedatalake.DataLakeServiceClient.set_service_properties name: set_service_properties summary: 'Sets the properties of a storage account''s Datalake service, including diff --git a/docs-ref-autogen/azure-storage-file-datalake/azure.storage.filedatalake.FileSystemClient.yml b/docs-ref-autogen/azure-storage-file-datalake/azure.storage.filedatalake.FileSystemClient.yml index 9ed9a5e1aea6..4a9f515714ae 100644 --- a/docs-ref-autogen/azure-storage-file-datalake/azure.storage.filedatalake.FileSystemClient.yml +++ b/docs-ref-autogen/azure-storage-file-datalake/azure.storage.filedatalake.FileSystemClient.yml @@ -73,18 +73,6 @@ variables: name: primary_hostname types: - -examples: -- "Get a FileSystemClient from an existing DataLakeServiceClient.\n\n\n\n````python\n\n # Instantiate a DataLakeServiceClient\ - \ using a connection string\n from azure.storage.filedatalake import DataLakeServiceClient\n\ - \ datalake_service_client = DataLakeServiceClient.from_connection_string(self.connection_string)\n\ - \n # Instantiate a FileSystemClient\n file_system_client = datalake_service_client.get_file_system_client(\"\ - mynewfilesystem\")\n\n ````\n" methods: - uid: azure.storage.filedatalake.FileSystemClient.acquire_lease name: acquire_lease @@ -166,16 +154,6 @@ methods: description: A DataLakeLeaseClient object, that can be run in a context manager. types: - - examples: - - "Acquiring a lease on the file system.\n\n\n\n````python\n\ - \n # Acquire a lease on the file system\n lease = file_system_client.acquire_lease()\n\ - \n # Delete file system by passing in the lease\n file_system_client.delete_file_system(lease=lease)\n\ - \n ````\n" - uid: azure.storage.filedatalake.FileSystemClient.close name: close summary: 'This method is to close the sockets opened by the client. @@ -334,15 +312,6 @@ methods: - return: description: DataLakeDirectoryClient - examples: - - "Create directory in the file system.\n\n\n\n````python\n\ - \n directory_client = file_system_client.create_directory(\"mydirectory\")\n\ - \n ````\n" - uid: azure.storage.filedatalake.FileSystemClient.create_file name: create_file summary: Create file @@ -510,14 +479,6 @@ methods: - return: description: DataLakeFileClient - examples: - - "Create file in the file system.\n\n\n\n````python\n\ - \n file_client = file_system_client.create_file(\"myfile\")\n\n ````\n" - uid: azure.storage.filedatalake.FileSystemClient.create_file_system name: create_file_system summary: 'Creates a new file system under the specified account. @@ -571,15 +532,6 @@ methods: description: A dictionary of response headers. types: - [, [, ]] - examples: - - "Creating a file system in the datalake service.\n\n\n\n````python\n\n file_system_client.create_file_system()\n\ - \n ````\n" - uid: azure.storage.filedatalake.FileSystemClient.delete_directory name: delete_directory summary: Marks the specified path for deletion. @@ -652,14 +604,6 @@ methods: - return: description: DataLakeDirectoryClient - examples: - - "Delete directory in the file system.\n\n\n\n````python\n\ - \n file_system_client.delete_directory(\"mydirectory\")\n\n ````\n" - uid: azure.storage.filedatalake.FileSystemClient.delete_file name: delete_file summary: Marks the specified file for deletion. @@ -731,14 +675,6 @@ methods: - return: description: DataLakeFileClient - examples: - - "Delete file in the file system.\n\n\n\n````python\n\ - \n file_system_client.delete_file(\"myfile\")\n\n ````\n" - uid: azure.storage.filedatalake.FileSystemClient.delete_file_system name: delete_file_system summary: 'Marks the specified file system for deletion. @@ -809,15 +745,6 @@ methods: return: types: - - examples: - - "Deleting a file system in the datalake service.\n\n\n\n````python\n\n file_system_client.delete_file_system()\n\ - \n ````\n" - uid: azure.storage.filedatalake.FileSystemClient.exists name: exists summary: Returns True if a file system exists and returns False otherwise. @@ -880,16 +807,6 @@ methods: should be the storage account key.' defaultValue: None - examples: - - "Create FileSystemClient from connection string\n\n\n\n````python\n\ - \n from azure.storage.filedatalake import FileSystemClient\n file_system_client\ - \ = FileSystemClient.from_connection_string(self.connection_string, \"filesystem\"\ - )\n\n ````\n" - uid: azure.storage.filedatalake.FileSystemClient.get_directory_client name: get_directory_client summary: 'Get a client to interact with the specified directory. @@ -911,16 +828,6 @@ methods: description: A DataLakeDirectoryClient. types: - - examples: - - "Getting the directory client to interact with a specific directory.\n\n\n\n````python\n\n # Get the DataLakeDirectoryClient\ - \ from the FileSystemClient to interact with a specific file\n directory_client\ - \ = file_system_client.get_directory_client(\"mynewdirectory\")\n\n ````\n" - uid: azure.storage.filedatalake.FileSystemClient.get_file_client name: get_file_client summary: 'Get a client to interact with the specified file. @@ -942,16 +849,6 @@ methods: description: A DataLakeFileClient. types: - - examples: - - "Getting the file client to interact with a specific file.\n\n\n\n````python\n\n # Get the FileClient from the\ - \ FileSystemClient to interact with a specific file\n file_client = file_system_client.get_file_client(\"\ - mynewfile\")\n\n ````\n" - uid: azure.storage.filedatalake.FileSystemClient.get_file_system_access_policy name: get_file_system_access_policy summary: 'Gets the permissions for the specified file system. @@ -1012,14 +909,6 @@ methods: description: Properties for the specified file system within a file system object. types: - - examples: - - "Getting properties on the file system.\n\n\n\n````python\n\ - \n properties = file_system_client.get_file_system_properties()\n\n ````\n" - uid: azure.storage.filedatalake.FileSystemClient.get_paths name: get_paths summary: 'Returns a generator to list the paths(could be files or directories) under @@ -1079,15 +968,6 @@ methods: description: An iterable (auto-paging) response of PathProperties. types: - [] - examples: - - "List the paths in the file system.\n\n\n\n````python\n\ - \n path_list = file_system_client.get_paths()\n for path in path_list:\n \ - \ print(path.name + '\\n')\n\n ````\n" - uid: azure.storage.filedatalake.FileSystemClient.list_deleted_paths name: list_deleted_paths summary: 'Returns a generator to list the deleted (file or directory) paths under @@ -1281,13 +1161,3 @@ methods: - return: description: filesystem-updated property dict (Etag and last modified). - examples: - - "Setting metadata on the file system.\n\n\n\n````python\n\ - \n # Create key, value pairs for metadata\n metadata = {'type': 'test'}\n\n\ - \ # Set metadata on the file system\n file_system_client.set_file_system_metadata(metadata=metadata)\n\ - \n ````\n" diff --git a/docs-ref-autogen/azure-storage-file-datalake/azure.storage.filedatalake.aio.DataLakeDirectoryClient.yml b/docs-ref-autogen/azure-storage-file-datalake/azure.storage.filedatalake.aio.DataLakeDirectoryClient.yml index c50b421f898e..735491ac1d2a 100644 --- a/docs-ref-autogen/azure-storage-file-datalake/azure.storage.filedatalake.aio.DataLakeDirectoryClient.yml +++ b/docs-ref-autogen/azure-storage-file-datalake/azure.storage.filedatalake.aio.DataLakeDirectoryClient.yml @@ -80,16 +80,6 @@ variables: name: primary_hostname types: - -examples: -- "Creating the DataLakeServiceClient from connection string.\n\n\n\n````python\n\n from azure.storage.filedatalake.aio\ - \ import DataLakeDirectoryClient\n DataLakeDirectoryClient.from_connection_string(connection_string,\ - \ \"myfilesystem\", \"mydirectory\")\n\n ````\n" methods: - uid: azure.storage.filedatalake.aio.DataLakeDirectoryClient.create_directory name: create_directory @@ -242,14 +232,6 @@ methods: description: A dictionary of response headers. types: - [, [, ]] - examples: - - "Create directory.\n\n\n\n````python\n\ - \n await directory_client.create_directory()\n\n ````\n" - uid: azure.storage.filedatalake.aio.DataLakeDirectoryClient.create_file name: create_file summary: Create a new file and return the file client to be interacted with. @@ -640,14 +622,6 @@ methods: - return: description: None - examples: - - "Delete directory.\n\n\n\n````python\n\ - \n await new_directory.delete_directory()\n\n ````\n" - uid: azure.storage.filedatalake.aio.DataLakeDirectoryClient.delete_sub_directory name: delete_sub_directory summary: Marks the specified subdirectory for deletion. @@ -812,14 +786,6 @@ methods: return: types: - - examples: - - "Getting the properties for a file/directory.\n\n\n\n````python\n\ - \n props = await new_directory.get_directory_properties()\n\n ````\n" - uid: azure.storage.filedatalake.aio.DataLakeDirectoryClient.get_file_client name: get_file_client summary: 'Get a client to interact with the specified file. @@ -977,14 +943,3 @@ methods: - return: description: DataLakeDirectoryClient - examples: - - "Rename the source directory.\n\n\n\n````python\n\ - \n new_dir_name = \"testdir2\"\n print(\"Renaming the directory named '{}'\ - \ to '{}'.\".format(dir_name, new_dir_name))\n new_directory = await directory_client\\\ - \n .rename_directory(new_name=directory_client.file_system_name + '/' +\ - \ new_dir_name)\n\n ````\n" diff --git a/docs-ref-autogen/azure-storage-file-datalake/azure.storage.filedatalake.aio.DataLakeFileClient.yml b/docs-ref-autogen/azure-storage-file-datalake/azure.storage.filedatalake.aio.DataLakeFileClient.yml index f8eb032a7cd3..0e0e2549951b 100644 --- a/docs-ref-autogen/azure-storage-file-datalake/azure.storage.filedatalake.aio.DataLakeFileClient.yml +++ b/docs-ref-autogen/azure-storage-file-datalake/azure.storage.filedatalake.aio.DataLakeFileClient.yml @@ -73,16 +73,6 @@ variables: name: primary_hostname types: - -examples: -- "Creating the DataLakeServiceClient from connection string.\n\n\n\n````python\n\n from azure.storage.filedatalake.aio\ - \ import DataLakeFileClient\n DataLakeFileClient.from_connection_string(connection_string,\ - \ \"myfilesystem\", \"mydirectory\", \"myfile\")\n\n ````\n" methods: - uid: azure.storage.filedatalake.aio.DataLakeFileClient.append_data name: append_data @@ -166,15 +156,6 @@ methods: - return: description: dict of the response header - examples: - - "Append data to the file.\n\n\n\n````python\n\ - \n await file_client.append_data(data=file_content[2048:3072], offset=2048,\ - \ length=1024)\n\n ````\n" - uid: azure.storage.filedatalake.aio.DataLakeFileClient.create_file name: create_file summary: Create a new file. @@ -344,15 +325,6 @@ methods: - return: description: response dict (Etag and last modified). - examples: - - "Create file.\n\n\n\n````python\n\ - \n file_client = filesystem_client.get_file_client(file_name)\n await file_client.create_file()\n\ - \n ````\n" - uid: azure.storage.filedatalake.aio.DataLakeFileClient.delete_file name: delete_file summary: Marks the specified file for deletion. @@ -415,14 +387,6 @@ methods: - return: description: None - examples: - - "Delete file.\n\n\n\n````python\n\ - \n await new_client.delete_file()\n\n ````\n" - uid: azure.storage.filedatalake.aio.DataLakeFileClient.download_file name: download_file summary: 'Downloads a file to the StorageStreamDownloader. The readall() method @@ -523,15 +487,6 @@ methods: description: A streaming object (StorageStreamDownloader) types: - - examples: - - "Return the downloaded data.\n\n\n\n````python\n\ - \n download = await file_client.download_file()\n downloaded_bytes = await\ - \ download.readall()\n\n ````\n" - uid: azure.storage.filedatalake.aio.DataLakeFileClient.exists name: exists summary: Returns True if a file exists and returns False otherwise. @@ -695,17 +650,6 @@ methods: - return: description: response header in dict - examples: - - "Commit the previous appended data.\n\n\n\n````python\n\ - \n file_client = file_system_client.get_file_client(\"myfile\")\n await file_client.create_file()\n\ - \ with open(SOURCE_FILE, \"rb\") as data:\n length = data.tell()\n \ - \ await file_client.append_data(data, 0)\n await file_client.flush_data(length)\n\ - \n ````\n" - uid: azure.storage.filedatalake.aio.DataLakeFileClient.get_file_properties name: get_file_properties summary: 'Returns all user-defined metadata, standard HTTP properties, and @@ -779,14 +723,6 @@ methods: return: types: - - examples: - - "Getting the properties for a file.\n\n\n\n````python\n\ - \n properties = await file_client.get_file_properties()\n\n ````\n" - uid: azure.storage.filedatalake.aio.DataLakeFileClient.rename_file name: rename_file summary: Rename the source file. @@ -906,15 +842,6 @@ methods: description: the renamed file client types: - - examples: - - "Rename the source file.\n\n\n\n````python\n\ - \n new_client = await file_client.rename_file(file_client.file_system_name +\ - \ '/' + 'newname')\n\n ````\n" - uid: azure.storage.filedatalake.aio.DataLakeFileClient.set_file_expiry name: set_file_expiry summary: Sets the time a file will expire and be deleted. diff --git a/docs-ref-autogen/azure-storage-file-datalake/azure.storage.filedatalake.aio.DataLakeServiceClient.yml b/docs-ref-autogen/azure-storage-file-datalake/azure.storage.filedatalake.aio.DataLakeServiceClient.yml index a17217135e47..66842eb575af 100644 --- a/docs-ref-autogen/azure-storage-file-datalake/azure.storage.filedatalake.aio.DataLakeServiceClient.yml +++ b/docs-ref-autogen/azure-storage-file-datalake/azure.storage.filedatalake.aio.DataLakeServiceClient.yml @@ -75,27 +75,6 @@ variables: name: primary_hostname types: - -examples: -- "Creating the DataLakeServiceClient from connection string.\n\n\n\n````python\n\n from azure.storage.filedatalake.aio\ - \ import DataLakeServiceClient\n datalake_service_client = DataLakeServiceClient.from_connection_string(connection_string)\n\ - \n ````\n\nCreating the DataLakeServiceClient with Azure Identity credentials.\n\n\n\n````python\n\n from azure.identity.aio import\ - \ ClientSecretCredential\n token_credential = ClientSecretCredential(\n \ - \ active_directory_tenant_id,\n active_directory_application_id,\n active_directory_application_secret,\n\ - \ )\n datalake_service_client = DataLakeServiceClient(\"https://{}.dfs.core.windows.net\"\ - .format(account_name),\n credential=token_credential)\n\ - \n ````\n" methods: - uid: azure.storage.filedatalake.aio.DataLakeServiceClient.close name: close @@ -160,15 +139,6 @@ methods: return: types: - - examples: - - "Creating a file system in the datalake service.\n\n\n\n````python\n\n await datalake_service_client.create_file_system(\"\ - filesystem\")\n\n ````\n" - uid: azure.storage.filedatalake.aio.DataLakeServiceClient.delete_file_system name: delete_file_system summary: 'Marks the specified file system for deletion. @@ -249,15 +219,6 @@ methods: return: types: - - examples: - - "Deleting a file system in the datalake service.\n\n\n\n````python\n\n await datalake_service_client.delete_file_system(\"\ - filesystem\")\n\n ````\n" - uid: azure.storage.filedatalake.aio.DataLakeServiceClient.get_directory_client name: get_directory_client summary: 'Get a client to interact with the specified directory. @@ -289,16 +250,6 @@ methods: description: A DataLakeDirectoryClient. types: - - examples: - - "Getting the directory client to interact with a specific directory.\n\n\n\n````python\n\n directory_client = datalake_service_client.get_directory_client(file_system_client.file_system_name,\n\ - \ \"mydirectory\"\ - )\n\n ````\n" - uid: azure.storage.filedatalake.aio.DataLakeServiceClient.get_file_client name: get_file_client summary: 'Get a client to interact with the specified file. @@ -330,15 +281,6 @@ methods: description: A DataLakeFileClient. types: - - examples: - - "Getting the file client to interact with a specific file.\n\n\n\n````python\n\n file_client = datalake_service_client.get_file_client(file_system_client.file_system_name,\ - \ \"myfile\")\n\n ````\n" - uid: azure.storage.filedatalake.aio.DataLakeServiceClient.get_file_system_client name: get_file_system_client summary: 'Get a client to interact with the specified file system. @@ -359,19 +301,6 @@ methods: description: A FileSystemClient. types: - - examples: - - "Getting the file system client to interact with a specific file system.\n\n\n\n````python\n\n # Instantiate a DataLakeServiceClient\ - \ using a connection string\n from azure.storage.filedatalake.aio import DataLakeServiceClient\n\ - \ datalake_service_client = DataLakeServiceClient.from_connection_string(self.connection_string)\n\ - \n async with datalake_service_client:\n # Instantiate a FileSystemClient\n\ - \ file_system_client = datalake_service_client.get_file_system_client(\"\ - mynewfilesystems\")\n\n ````\n" - uid: azure.storage.filedatalake.aio.DataLakeServiceClient.get_service_properties name: get_service_properties summary: 'Gets the properties of a storage account''s datalake service, including @@ -434,17 +363,6 @@ methods: description: The user delegation key. types: - - examples: - - "Get user delegation key from datalake service client.\n\n\n\n````python\n\n from datetime import datetime,\ - \ timedelta\n user_delegation_key = await datalake_service_client.get_user_delegation_key(datetime.utcnow(),\n\ - \ datetime.utcnow()\ - \ + timedelta(hours=1))\n\n ````\n" - uid: azure.storage.filedatalake.aio.DataLakeServiceClient.list_file_systems name: list_file_systems summary: 'Returns a generator to list the file systems under the specified account. @@ -508,16 +426,6 @@ methods: description: An iterable (auto-paging) of FileSystemProperties. types: - [] - examples: - - "Listing the file systems in the datalake service.\n\n\n\n````python\n\n file_systems = datalake_service_client.list_file_systems()\n\ - \ async for file_system in file_systems:\n print(file_system.name)\n\n\ - \ ````\n" - uid: azure.storage.filedatalake.aio.DataLakeServiceClient.set_service_properties name: set_service_properties summary: 'Sets the properties of a storage account''s Datalake service, including diff --git a/docs-ref-autogen/azure-storage-file-datalake/azure.storage.filedatalake.aio.FileSystemClient.yml b/docs-ref-autogen/azure-storage-file-datalake/azure.storage.filedatalake.aio.FileSystemClient.yml index af2cc6084377..dad07c3938e7 100644 --- a/docs-ref-autogen/azure-storage-file-datalake/azure.storage.filedatalake.aio.FileSystemClient.yml +++ b/docs-ref-autogen/azure-storage-file-datalake/azure.storage.filedatalake.aio.FileSystemClient.yml @@ -38,19 +38,6 @@ constructor: - name: file_system_name - name: credential defaultValue: None -examples: -- "Get a FileSystemClient from an existing DataLakeServiceClient.\n\n\n\n````python\n\n # Instantiate a DataLakeServiceClient\ - \ using a connection string\n from azure.storage.filedatalake.aio import DataLakeServiceClient\n\ - \ datalake_service_client = DataLakeServiceClient.from_connection_string(self.connection_string)\n\ - \n async with datalake_service_client:\n # Instantiate a FileSystemClient\n\ - \ file_system_client = datalake_service_client.get_file_system_client(\"mynewfilesystems\"\ - )\n\n ````\n" methods: - uid: azure.storage.filedatalake.aio.FileSystemClient.acquire_lease name: acquire_lease @@ -132,16 +119,6 @@ methods: description: A DataLakeLeaseClient object, that can be run in a context manager. types: - - examples: - - "Acquiring a lease on the file_system.\n\n\n\n````python\n\ - \n # Acquire a lease on the file system\n lease = await file_system_client.acquire_lease()\n\ - \n # Delete file system by passing in the lease\n await file_system_client.delete_file_system(lease=lease)\n\ - \n ````\n" - uid: azure.storage.filedatalake.aio.FileSystemClient.close name: close summary: 'This method is to close the sockets opened by the client. @@ -300,15 +277,6 @@ methods: - return: description: DataLakeDirectoryClient - examples: - - "Create directory in the file system.\n\n\n\n````python\n\ - \n directory_client = await file_system_client.create_directory(\"mydirectory\"\ - )\n\n ````\n" - uid: azure.storage.filedatalake.aio.FileSystemClient.create_file name: create_file summary: Create file @@ -476,14 +444,6 @@ methods: - return: description: DataLakeFileClient - examples: - - "Create file in the file system.\n\n\n\n````python\n\ - \n file_client = await file_system_client.create_file(\"myfile\")\n\n ````\n" - uid: azure.storage.filedatalake.aio.FileSystemClient.create_file_system name: create_file_system summary: 'Creates a new file system under the specified account. @@ -537,15 +497,6 @@ methods: description: A dictionary of response headers. types: - [, [, ]] - examples: - - "Creating a file system in the datalake service.\n\n\n\n````python\n\n await file_system_client.create_file_system()\n\ - \n ````\n" - uid: azure.storage.filedatalake.aio.FileSystemClient.delete_directory name: delete_directory summary: Marks the specified path for deletion. @@ -618,24 +569,9 @@ methods: - return: description: DataLakeDirectoryClient - examples: - - "Delete directory in the file system.\n\n\n\n````python\n\ - \n await file_system_client.delete_directory(\"mydirectory\")\n\n ````\n" - uid: azure.storage.filedatalake.aio.FileSystemClient.delete_file name: delete_file - summary: "Marks the specified file for deletion.\n\nDelete file in the file system.\n\n\n\n````python\n\n await file_system_client.delete_file(\"\ - myfile\")\n\n ````" + summary: Marks the specified file for deletion. signature: 'async delete_file(file: FileProperties | str, **kwargs) -> DataLakeFileClient' parameters: - name: file @@ -774,15 +710,6 @@ methods: return: types: - - examples: - - "Deleting a file system in the datalake service.\n\n\n\n````python\n\n await file_system_client.delete_file_system()\n\ - \n ````\n" - uid: azure.storage.filedatalake.aio.FileSystemClient.exists name: exists summary: Returns True if a file system exists and returns False otherwise. @@ -823,16 +750,6 @@ methods: description: A DataLakeDirectoryClient. types: - - examples: - - "Getting the directory client to interact with a specific directory.\n\n\n\n````python\n\n # Get the DataLakeDirectoryClient\ - \ from the FileSystemClient to interact with a specific file\n directory_client\ - \ = file_system_client.get_directory_client(\"mynewdirectory\")\n\n ````\n" - uid: azure.storage.filedatalake.aio.FileSystemClient.get_file_client name: get_file_client summary: 'Get a client to interact with the specified file. @@ -854,16 +771,6 @@ methods: description: A DataLakeFileClient. types: - - examples: - - "Getting the file client to interact with a specific file.\n\n\n\n````python\n\n # Get the FileClient from the\ - \ FileSystemClient to interact with a specific file\n file_client = file_system_client.get_file_client(\"\ - mynewfile\")\n\n ````\n" - uid: azure.storage.filedatalake.aio.FileSystemClient.get_file_system_access_policy name: get_file_system_access_policy summary: 'Gets the permissions for the specified file system. @@ -924,15 +831,6 @@ methods: description: Properties for the specified file system within a file system object. types: - - examples: - - "Getting properties on the file system.\n\n\n\n````python\n\ - \n properties = await file_system_client.get_file_system_properties()\n\n \ - \ ````\n" - uid: azure.storage.filedatalake.aio.FileSystemClient.get_paths name: get_paths summary: 'Returns a generator to list the paths(could be files or directories) under @@ -990,15 +888,6 @@ methods: description: An iterable (auto-paging) response of PathProperties. types: - [] - examples: - - "List the blobs in the file system.\n\n\n\n````python\n\ - \n path_list = file_system_client.get_paths()\n async for path in path_list:\n\ - \ print(path.name + '\\n')\n\n ````\n" - uid: azure.storage.filedatalake.aio.FileSystemClient.list_deleted_paths name: list_deleted_paths summary: 'Returns a generator to list the deleted (file or directory) paths under @@ -1192,13 +1081,3 @@ methods: - return: description: file system-updated property dict (Etag and last modified). - examples: - - "Setting metadata on the container.\n\n\n\n````python\n\ - \n # Create key, value pairs for metadata\n metadata = {'type': 'test'}\n\n\ - \ # Set metadata on the file system\n await file_system_client.set_file_system_metadata(metadata=metadata)\n\ - \n ````\n" diff --git a/docs-ref-autogen/azure-storage-file-share/azure.storage.fileshare.ShareClient.yml b/docs-ref-autogen/azure-storage-file-share/azure.storage.fileshare.ShareClient.yml index 3fb230fd7d1b..0816feb64781 100644 --- a/docs-ref-autogen/azure-storage-file-share/azure.storage.fileshare.ShareClient.yml +++ b/docs-ref-autogen/azure-storage-file-share/azure.storage.fileshare.ShareClient.yml @@ -152,15 +152,6 @@ methods: description: A ShareLeaseClient object. types: - - examples: - - "Acquiring a lease on a share.\n\n\n\n````python\n\ - \n share.create_directory(\"mydir\")\n lease = share.acquire_lease()\n share.get_share_properties(lease=lease)\n\ - \ share.delete_share(lease=lease)\n\n ````\n" - uid: azure.storage.fileshare.ShareClient.create_directory name: create_directory summary: 'Creates a directory in the share and returns a client to interact @@ -274,15 +265,6 @@ methods: description: Share-updated property dict (Etag and last modified). types: - [, ] - examples: - - "Creates a file share.\n\ - \n\n\n````python\n\ - \n # Create share with Access Tier set to Hot\n share.create_share(access_tier=ShareAccessTier(\"\ - Hot\"))\n\n ````\n" - uid: azure.storage.fileshare.ShareClient.create_snapshot name: create_snapshot summary: 'Creates a snapshot of the share. @@ -322,14 +304,6 @@ methods: description: Share-updated property dict (Snapshot ID, Etag, and last modified). types: - [, ] - examples: - - "Creates a snapshot of the file share.\n\n\n\n````python\n\ - \n share.create_snapshot()\n\n ````\n" - uid: azure.storage.fileshare.ShareClient.delete_directory name: delete_directory summary: 'Marks the directory for deletion. The directory is @@ -392,14 +366,6 @@ methods: see [here](https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/storage/azure-storage-file-share#other-client--per-operation-configuration).' types: - - examples: - - "Deletes the share and any snapshots.\n\n\n\n````python\n\ - \n share.delete_share(delete_snapshots=True)\n\n ````\n" - uid: azure.storage.fileshare.ShareClient.from_connection_string name: from_connection_string summary: Create ShareClient from a Connection String. @@ -451,15 +417,6 @@ methods: description: A share client. types: - - examples: - - "Gets the share client from connection string.\n\n\n\n````python\n\ - \n from azure.storage.fileshare import ShareClient\n share = ShareClient.from_connection_string(self.connection_string,\ - \ \"sharesamples2\")\n\n ````\n" - uid: azure.storage.fileshare.ShareClient.from_share_url name: from_share_url signature: 'from_share_url(share_url: str, snapshot: str | Dict[str, Any] | None @@ -636,14 +593,6 @@ methods: description: The share properties. types: - - examples: - - "Gets the share properties.\n\n\n\n````python\n\ - \n properties = share.get_share_properties()\n\n ````\n" - uid: azure.storage.fileshare.ShareClient.get_share_stats name: get_share_stats summary: 'Gets the approximate size of the data stored on the share in bytes. @@ -746,18 +695,6 @@ methods: - return: description: An auto-paging iterable of dict-like DirectoryProperties and FileProperties - examples: - - "List directories and files in the share.\n\n\n\n````python\n\ - \n # Create a directory in the share\n dir_client = share.create_directory(\"\ - mydir\")\n\n # Upload a file to the directory\n with open(SOURCE_FILE, \"\ - rb\") as source_file:\n dir_client.upload_file(file_name=\"sample\", data=source_file)\n\ - \n # List files in the directory\n my_files = list(share.list_directories_and_files(directory_name=\"\ - mydir\"))\n print(my_files)\n\n ````\n" - uid: azure.storage.fileshare.ShareClient.set_share_access_policy name: set_share_access_policy summary: 'Sets the permissions for the share, or stored access @@ -849,15 +786,6 @@ methods: description: Share-updated property dict (Etag and last modified). types: - (, ) - examples: - - "Sets the share metadata.\n\ - \n\n\n````python\n\ - \n data = {'category': 'test'}\n share.set_share_metadata(metadata=data)\n\ - \n ````\n" - uid: azure.storage.fileshare.ShareClient.set_share_properties name: set_share_properties summary: 'Sets the share properties. @@ -908,19 +836,6 @@ methods: description: Share-updated property dict (Etag and last modified). types: - (, ) - examples: - - "Sets the share properties.\n\n\n\n````python\n\ - \n # Set the tier for the first share to Hot\n share1.set_share_properties(access_tier=\"\ - Hot\")\n # Set the quota for the first share to 3\n share1.set_share_properties(quota=3)\n\ - \ # Set the tier for the second share to Cool and quota to 2\n share2.set_share_properties(access_tier=ShareAccessTier(\"\ - Cool\"), quota=2)\n\n # Get the shares' properties\n print(share1.get_share_properties().access_tier)\n\ - \ print(share1.get_share_properties().quota)\n print(share2.get_share_properties().access_tier)\n\ - \ print(share2.get_share_properties().quota)\n\n ````\n" - uid: azure.storage.fileshare.ShareClient.set_share_quota name: set_share_quota summary: Sets the quota for the share. @@ -960,12 +875,3 @@ methods: description: Share-updated property dict (Etag and last modified). types: - (, ) - examples: - - "Sets the share quota.\n\ - \n\n\n````python\n\ - \n # Set the quota for the share to 1GB\n share.set_share_quota(quota=1)\n\ - \n ````\n" diff --git a/docs-ref-autogen/azure-storage-file-share/azure.storage.fileshare.ShareDirectoryClient.yml b/docs-ref-autogen/azure-storage-file-share/azure.storage.fileshare.ShareDirectoryClient.yml index aa8e83801f80..6a438188e731 100644 --- a/docs-ref-autogen/azure-storage-file-share/azure.storage.fileshare.ShareDirectoryClient.yml +++ b/docs-ref-autogen/azure-storage-file-share/azure.storage.fileshare.ShareDirectoryClient.yml @@ -255,14 +255,6 @@ methods: description: Directory-updated property dict (Etag and last modified). types: - (, ) - examples: - - "Creates a directory.\n\ - \n\n\n````python\n\ - \n my_directory.create_directory()\n\n ````\n" - uid: azure.storage.fileshare.ShareDirectoryClient.create_subdirectory name: create_subdirectory summary: 'Creates a new subdirectory and returns a client to interact @@ -295,15 +287,6 @@ methods: description: ShareDirectoryClient types: - - examples: - - "Create a subdirectory.\n\n\n\n````python\n\ - \n # Create the directory\n parent_dir.create_directory()\n\n # Create a\ - \ subdirectory\n subdir = parent_dir.create_subdirectory(\"subdir\")\n\n ````\n" - uid: azure.storage.fileshare.ShareDirectoryClient.delete_directory name: delete_directory summary: 'Marks the directory for deletion. The directory is @@ -326,14 +309,6 @@ methods: return: types: - - examples: - - "Deletes a directory.\n\ - \n\n\n````python\n\ - \n my_directory.delete_directory()\n\n ````\n" - uid: azure.storage.fileshare.ShareDirectoryClient.delete_file name: delete_file summary: 'Marks the specified file for deletion. The file is later @@ -361,15 +336,6 @@ methods: return: types: - - examples: - - "Delete a file in a directory.\n\n\n\n````python\n\ - \n # Delete the file in the directory\n my_directory.delete_file(file_name=\"\ - sample\")\n\n ````\n" - uid: azure.storage.fileshare.ShareDirectoryClient.delete_subdirectory name: delete_subdirectory summary: Deletes a subdirectory. @@ -395,14 +361,6 @@ methods: return: types: - - examples: - - "Delete a subdirectory.\n\n\n\n````python\n\ - \n parent_dir.delete_subdirectory(\"subdir\")\n\n ````\n" - uid: azure.storage.fileshare.ShareDirectoryClient.exists name: exists summary: Returns True if a directory exists and returns False otherwise. @@ -576,17 +534,6 @@ methods: description: A Directory Client. types: - - examples: - - "Gets the subdirectory client.\n\n\n\n````python\n\ - \n # Get a directory client and create the directory\n parent = share.get_directory_client(\"\ - dir1\")\n parent.create_directory()\n\n # Get a subdirectory client and create\ - \ the subdirectory \"dir1/dir2\"\n subdirectory = parent.get_subdirectory_client(\"\ - dir2\")\n subdirectory.create_directory()\n\n ````\n" - uid: azure.storage.fileshare.ShareDirectoryClient.list_directories_and_files name: list_directories_and_files summary: Lists all the directories and files under the directory. @@ -639,15 +586,6 @@ methods: description: An auto-paging iterable of dict-like DirectoryProperties and FileProperties types: - [] - examples: - - "List directories and files.\n\n\n\n````python\n\ - \n # List the directories and files under the parent directory\n my_list =\ - \ list(parent_dir.list_directories_and_files())\n print(my_list)\n\n ````\n" - uid: azure.storage.fileshare.ShareDirectoryClient.list_handles name: list_handles summary: Lists opened handles on a directory or a file under the directory. @@ -902,12 +840,3 @@ methods: description: ShareFileClient types: - - examples: - - "Upload a file to a directory.\n\n\n\n````python\n\ - \n # Upload a file to the directory\n with open(SOURCE_FILE, \"rb\") as source:\n\ - \ my_directory.upload_file(file_name=\"sample\", data=source)\n\n ````\n" diff --git a/docs-ref-autogen/azure-storage-file-share/azure.storage.fileshare.ShareFileClient.yml b/docs-ref-autogen/azure-storage-file-share/azure.storage.fileshare.ShareFileClient.yml index 0c8ad1c95d14..56d98ebe863f 100644 --- a/docs-ref-autogen/azure-storage-file-share/azure.storage.fileshare.ShareFileClient.yml +++ b/docs-ref-autogen/azure-storage-file-share/azure.storage.fileshare.ShareFileClient.yml @@ -185,16 +185,6 @@ methods: description: A ShareLeaseClient object. types: - - examples: - - "Acquiring a lease on a file.\n\n\n\n````python\n\ - \n source_file.create_file(1024)\n lease = source_file.acquire_lease()\n \ - \ source_file.upload_file(b'hello world', lease=lease)\n\n lease.release()\n\ - \n ````\n" - uid: azure.storage.fileshare.ShareFileClient.clear_range name: clear_range summary: 'Clears the specified range and releases the space used in storage for @@ -418,15 +408,6 @@ methods: description: File-updated property dict (Etag and last modified). types: - (, ) - examples: - - "Create a file.\n\n\n\n````python\n\ - \n # Create and allocate bytes for the file (no content added yet)\n my_allocated_file.create_file(size=100)\n\ - \n ````\n" - uid: azure.storage.fileshare.ShareFileClient.delete_file name: delete_file summary: 'Marks the specified file for deletion. The file is @@ -460,14 +441,6 @@ methods: return: types: - - examples: - - "Delete a file.\n\n\n\n````python\n\ - \n my_file.delete_file()\n\n ````\n" - uid: azure.storage.fileshare.ShareFileClient.download_file name: download_file summary: 'Downloads a file to the StorageStreamDownloader. The readall() method @@ -554,15 +527,6 @@ methods: description: A streaming object (StorageStreamDownloader) types: - - examples: - - "Download a file.\n\n\ - \n\n````python\n\ - \n with open(DEST_FILE, \"wb\") as data:\n stream = my_file.download_file()\n\ - \ data.write(stream.readall())\n\n ````\n" - uid: azure.storage.fileshare.ShareFileClient.from_connection_string name: from_connection_string summary: Create ShareFileClient from a Connection String. @@ -620,16 +584,6 @@ methods: description: A File client. types: - - examples: - - "Creates the file client with connection string.\n\n\n\n````python\n\n from azure.storage.fileshare import\ - \ ShareFileClient\n file = ShareFileClient.from_connection_string(\n self.connection_string,\n\ - \ share_name=\"helloworld2\",\n file_path=\"myfile\")\n\n ````\n" - uid: azure.storage.fileshare.ShareFileClient.from_file_url name: from_file_url summary: A client to interact with a specific file, although that file may not yet @@ -1226,14 +1180,6 @@ methods: return: types: - (, ) - examples: - - "Copy a file from a URL\n\ - \n\n\n````python\n\ - \n destination_file.start_copy_from_url(source_url=source_url)\n\n ````\n" - uid: azure.storage.fileshare.ShareFileClient.upload_file name: upload_file summary: "Uploads a new file.\n\n param data:\n Content of the file.\n\n\ @@ -1291,14 +1237,7 @@ methods: \ network timesouts\n see [here](https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/storage/azure-storage-file-share#other-client--per-operation-configuration).\n\ \nkeyword str encoding:\n Defaults to UTF-8.\n\nreturns:\n File-updated\ \ property dict (Etag and last modified).\n\nrtype:\n dict(str, Any)\n\n\n\ - \n## Example:Upload a file.\n\n\n\n````python\n\ - \n with open(SOURCE_FILE, \"rb\") as source:\n my_file.upload_file(source)\n\ - \n ````" + \n## Example:" - uid: azure.storage.fileshare.ShareFileClient.upload_range name: upload_range summary: Upload a range of bytes to a file. diff --git a/docs-ref-autogen/azure-storage-file-share/azure.storage.fileshare.ShareServiceClient.yml b/docs-ref-autogen/azure-storage-file-share/azure.storage.fileshare.ShareServiceClient.yml index 371f0009ca8b..4effb668b994 100644 --- a/docs-ref-autogen/azure-storage-file-share/azure.storage.fileshare.ShareServiceClient.yml +++ b/docs-ref-autogen/azure-storage-file-share/azure.storage.fileshare.ShareServiceClient.yml @@ -93,16 +93,6 @@ constructor: description: The maximum range size used for a file upload. Defaults to 4*1024*1024. types: - -examples: -- "Create the share service client with url and credential.\n\n\n\n````python\n\n from azure.storage.fileshare import ShareServiceClient\n\ - \ share_service_client = ShareServiceClient(\n account_url=self.account_url,\n\ - \ credential=self.access_key\n )\n\n ````\n" methods: - uid: azure.storage.fileshare.ShareServiceClient.create_share name: create_share @@ -143,14 +133,6 @@ methods: return: types: - - examples: - - "Create a share in the file share service.\n\n\n\n````python\n\ - \n file_service.create_share(share_name=\"fileshare1\")\n\n ````\n" - uid: azure.storage.fileshare.ShareServiceClient.delete_share name: delete_share summary: 'Marks the specified share for deletion. The share is @@ -187,14 +169,6 @@ methods: return: types: - - examples: - - "Delete a share in the file share service.\n\n\n\n````python\n\ - \n file_service.delete_share(share_name=\"fileshare1\")\n\n ````\n" - uid: azure.storage.fileshare.ShareServiceClient.from_connection_string name: from_connection_string summary: Create ShareServiceClient from a Connection String. @@ -233,16 +207,6 @@ methods: description: A File Share service client. types: - - examples: - - "Create the share service client with connection string.\n\n\n\n````python\n\n from azure.storage.fileshare\ - \ import ShareServiceClient\n share_service_client = ShareServiceClient.from_connection_string(self.connection_string)\n\ - \n ````\n" - uid: azure.storage.fileshare.ShareServiceClient.get_service_properties name: get_service_properties summary: 'Gets the properties of a storage account''s File Share service, including @@ -268,14 +232,6 @@ methods: analytics logging, hour/minute metrics, cors rules, etc.' types: - [, ] - examples: - - "Get file share service properties.\n\n\n\n````python\n\ - \n properties = file_service.get_service_properties()\n\n ````\n" - uid: azure.storage.fileshare.ShareServiceClient.get_share_client name: get_share_client summary: 'Get a client to interact with the specified share. @@ -304,17 +260,6 @@ methods: description: A ShareClient. types: - - examples: - - "Gets the share client.\n\ - \n\n\n````python\n\ - \n from azure.storage.fileshare import ShareServiceClient\n file_service =\ - \ ShareServiceClient.from_connection_string(self.connection_string)\n\n # Get\ - \ a share client to interact with a specific share\n share = file_service.get_share_client(\"\ - fileshare2\")\n\n ````\n" - uid: azure.storage.fileshare.ShareServiceClient.list_shares name: list_shares summary: 'Returns auto-paging iterable of dict-like ShareProperties under the specified @@ -365,16 +310,6 @@ methods: description: An iterable (auto-paging) of ShareProperties. types: - [] - examples: - - "List shares in the file share service.\n\n\n\n````python\n\ - \n # List the shares in the file service\n my_shares = list(file_service.list_shares())\n\ - \n # Print the shares\n for share in my_shares:\n print(share)\n\n \ - \ ````\n" - uid: azure.storage.fileshare.ShareServiceClient.set_service_properties name: set_service_properties summary: 'Sets the properties of a storage account''s File Share service, including @@ -429,28 +364,6 @@ methods: return: types: - - examples: - - "Sets file share service properties.\n\n\n\n````python\n\ - \n # Create service properties\n from azure.storage.fileshare import Metrics,\ - \ CorsRule, RetentionPolicy\n\n # Create metrics for requests statistics\n \ - \ hour_metrics = Metrics(enabled=True, include_apis=True, retention_policy=RetentionPolicy(enabled=True,\ - \ days=5))\n minute_metrics = Metrics(enabled=True, include_apis=True,\n \ - \ retention_policy=RetentionPolicy(enabled=True, days=5))\n\ - \n # Create CORS rules\n cors_rule1 = CorsRule(['www.xyz.com'], ['GET'])\n\ - \ allowed_origins = ['www.xyz.com', \"www.ab.com\", \"www.bc.com\"]\n allowed_methods\ - \ = ['GET', 'PUT']\n max_age_in_seconds = 500\n exposed_headers = [\"x-ms-meta-data*\"\ - , \"x-ms-meta-source*\", \"x-ms-meta-abc\", \"x-ms-meta-bcd\"]\n allowed_headers\ - \ = [\"x-ms-meta-data*\", \"x-ms-meta-target*\", \"x-ms-meta-xyz\", \"x-ms-meta-foo\"\ - ]\n cors_rule2 = CorsRule(\n allowed_origins,\n allowed_methods,\n\ - \ max_age_in_seconds=max_age_in_seconds,\n exposed_headers=exposed_headers,\n\ - \ allowed_headers=allowed_headers)\n\n cors = [cors_rule1, cors_rule2]\n\ - \n # Set the service properties\n file_service.set_service_properties(hour_metrics,\ - \ minute_metrics, cors)\n\n ````\n" - uid: azure.storage.fileshare.ShareServiceClient.undelete_share name: undelete_share summary: 'Restores soft-deleted share. diff --git a/docs-ref-autogen/azure-storage-file-share/azure.storage.fileshare.aio.ShareClient.yml b/docs-ref-autogen/azure-storage-file-share/azure.storage.fileshare.aio.ShareClient.yml index 6595338f9a83..568e72b8d8bd 100644 --- a/docs-ref-autogen/azure-storage-file-share/azure.storage.fileshare.aio.ShareClient.yml +++ b/docs-ref-autogen/azure-storage-file-share/azure.storage.fileshare.aio.ShareClient.yml @@ -263,15 +263,6 @@ methods: description: Share-updated property dict (Etag and last modified). types: - [, ] - examples: - - "Creates a file share.\n\n\n\n````python\n\ - \n # Create share with Access Tier set to Hot\n await share.create_share(access_tier=ShareAccessTier(\"\ - Hot\"))\n\n ````\n" - uid: azure.storage.fileshare.aio.ShareClient.create_snapshot name: create_snapshot summary: 'Creates a snapshot of the share. @@ -311,14 +302,6 @@ methods: description: Share-updated property dict (Snapshot ID, Etag, and last modified). types: - [, ] - examples: - - "Creates a snapshot of the file share.\n\n\n\n````python\n\ - \n await share.create_snapshot()\n\n ````\n" - uid: azure.storage.fileshare.aio.ShareClient.delete_directory name: delete_directory summary: 'Marks the directory for deletion. The directory is @@ -382,14 +365,6 @@ methods: This keyword argument was introduced in API version ''2020-08-04''.' - examples: - - "Deletes the share and any snapshots.\n\n\n\n````python\n\ - \n await share.delete_share(delete_snapshots=True)\n\n ````\n" - uid: azure.storage.fileshare.aio.ShareClient.get_directory_client name: get_directory_client summary: 'Get a client to interact with the specified directory. @@ -522,14 +497,6 @@ methods: description: The share properties. types: - - examples: - - "Gets the share properties.\n\n\n\n````python\n\ - \n properties = await share.get_share_properties()\n\n ````\n" - uid: azure.storage.fileshare.aio.ShareClient.get_share_stats name: get_share_stats summary: 'Gets the approximate size of the data stored on the share in bytes. @@ -632,19 +599,6 @@ methods: - return: description: An auto-paging iterable of dict-like DirectoryProperties and FileProperties - examples: - - "List directories and files in the share.\n\n\n\n````python\n\ - \n # Create a directory in the share\n dir_client = await share.create_directory(\"\ - mydir\")\n\n # Upload a file to the directory\n with open(SOURCE_FILE, \"\ - rb\") as source_file:\n await dir_client.upload_file(file_name=\"sample\"\ - , data=source_file)\n\n # List files in the directory\n my_files = []\n \ - \ async for item in share.list_directories_and_files(directory_name=\"mydir\"\ - ):\n my_files.append(item)\n print(my_files)\n\n ````\n" - uid: azure.storage.fileshare.aio.ShareClient.set_share_access_policy name: set_share_access_policy summary: 'Sets the permissions for the share, or stored access @@ -736,15 +690,6 @@ methods: description: Share-updated property dict (Etag and last modified). types: - (, ) - examples: - - "Sets the share metadata.\n\n\n\n````python\n\ - \n data = {'category': 'test'}\n await share.set_share_metadata(metadata=data)\n\ - \n ````\n" - uid: azure.storage.fileshare.aio.ShareClient.set_share_properties name: set_share_properties summary: 'Sets the share properties. @@ -795,20 +740,6 @@ methods: description: Share-updated property dict (Etag and last modified). types: - (, ) - examples: - - "Sets the share properties.\n\n\n\n````python\n\ - \n # Set the tier for the first share to Hot\n await share1.set_share_properties(access_tier=\"\ - Hot\")\n # Set the quota for the first share to 3\n await share1.set_share_properties(quota=3)\n\ - \ # Set the tier for the second share to Cool and quota to 2\n await share2.set_share_properties(access_tier=ShareAccessTier(\"\ - Cool\"), quota=2)\n\n # Get the shares' properties\n props1 = await share1.get_share_properties()\n\ - \ props2 = await share2.get_share_properties()\n print(props1.access_tier)\n\ - \ print(props1.quota)\n print(props2.access_tier)\n print(props2.quota)\n\ - \n ````\n" - uid: azure.storage.fileshare.aio.ShareClient.set_share_quota name: set_share_quota summary: Sets the quota for the share. @@ -848,12 +779,3 @@ methods: description: Share-updated property dict (Etag and last modified). types: - (, ) - examples: - - "Sets the share quota.\n\n\n\n````python\n\ - \n # Set the quota for the share to 1GB\n await share.set_share_quota(quota=1)\n\ - \n ````\n" diff --git a/docs-ref-autogen/azure-storage-file-share/azure.storage.fileshare.aio.ShareDirectoryClient.yml b/docs-ref-autogen/azure-storage-file-share/azure.storage.fileshare.aio.ShareDirectoryClient.yml index 5bb36cfca011..26ec5cdeec68 100644 --- a/docs-ref-autogen/azure-storage-file-share/azure.storage.fileshare.aio.ShareDirectoryClient.yml +++ b/docs-ref-autogen/azure-storage-file-share/azure.storage.fileshare.aio.ShareDirectoryClient.yml @@ -251,14 +251,6 @@ methods: description: Directory-updated property dict (Etag and last modified). types: - (, ) - examples: - - "Creates a directory.\n\n\n\n````python\n\ - \n await directory.create_directory()\n\n ````\n" - uid: azure.storage.fileshare.aio.ShareDirectoryClient.create_subdirectory name: create_subdirectory summary: 'Creates a new subdirectory and returns a client to interact @@ -291,16 +283,6 @@ methods: description: ShareDirectoryClient types: - - examples: - - "Create a subdirectory.\n\n\n\n````python\n\ - \n # Create the directory\n await parent_dir.create_directory()\n\n # Create\ - \ a subdirectory\n subdir = await parent_dir.create_subdirectory(\"subdir\"\ - )\n\n ````\n" - uid: azure.storage.fileshare.aio.ShareDirectoryClient.delete_directory name: delete_directory summary: 'Marks the directory for deletion. The directory is @@ -323,14 +305,6 @@ methods: return: types: - - examples: - - "Deletes a directory.\n\n\n\n````python\n\ - \n await directory.delete_directory()\n\n ````\n" - uid: azure.storage.fileshare.aio.ShareDirectoryClient.delete_file name: delete_file summary: 'Marks the specified file for deletion. The file is later @@ -358,15 +332,6 @@ methods: return: types: - - examples: - - "Delete a file in a directory.\n\n\n\n````python\n\ - \n # Delete the file in the directory\n await directory.delete_file(file_name=\"\ - sample\")\n\n ````\n" - uid: azure.storage.fileshare.aio.ShareDirectoryClient.delete_subdirectory name: delete_subdirectory summary: Deletes a subdirectory. @@ -392,14 +357,6 @@ methods: return: types: - - examples: - - "Delete a subdirectory.\n\n\n\n````python\n\ - \n await parent_dir.delete_subdirectory(\"subdir\")\n\n ````\n" - uid: azure.storage.fileshare.aio.ShareDirectoryClient.exists name: exists summary: Returns True if a directory exists and returns False otherwise. @@ -480,17 +437,6 @@ methods: description: A Directory Client. types: - - examples: - - "Gets the subdirectory client.\n\n\n\n````python\n\ - \n # Get a directory client and create the directory\n parent = share.get_directory_client(\"\ - dir1\")\n await parent.create_directory()\n\n # Get a subdirectory client\ - \ and create the subdirectory \"dir1/dir2\"\n subdirectory = parent.get_subdirectory_client(\"\ - dir2\")\n await subdirectory.create_directory()\n\n ````\n" - uid: azure.storage.fileshare.aio.ShareDirectoryClient.list_directories_and_files name: list_directories_and_files summary: Lists all the directories and files under the directory. @@ -544,16 +490,6 @@ methods: types: - [] - examples: - - "List directories and files.\n\n\n\n````python\n\ - \n # List the directories and files under the parent directory\n my_list =\ - \ []\n async for item in parent_dir.list_directories_and_files():\n my_list.append(item)\n\ - \ print(my_list)\n\n ````\n" - uid: azure.storage.fileshare.aio.ShareDirectoryClient.list_handles name: list_handles summary: Lists opened handles on a directory or a file under the directory. @@ -808,12 +744,3 @@ methods: description: ShareFileClient types: - - examples: - - "Upload a file to a directory.\n\n\n\n````python\n\ - \n # Upload a file to the directory\n with open(SOURCE_FILE, \"rb\") as source:\n\ - \ await directory.upload_file(file_name=\"sample\", data=source)\n\n ````\n" diff --git a/docs-ref-autogen/azure-storage-file-share/azure.storage.fileshare.aio.ShareFileClient.yml b/docs-ref-autogen/azure-storage-file-share/azure.storage.fileshare.aio.ShareFileClient.yml index c833a93cca76..fe2c118a3867 100644 --- a/docs-ref-autogen/azure-storage-file-share/azure.storage.fileshare.aio.ShareFileClient.yml +++ b/docs-ref-autogen/azure-storage-file-share/azure.storage.fileshare.aio.ShareFileClient.yml @@ -405,15 +405,6 @@ methods: description: File-updated property dict (Etag and last modified). types: - (, ) - examples: - - "Create a file.\n\ - \n\n\n````python\n\ - \n # Create and allocate bytes for the file (no content added yet)\n await\ - \ my_allocated_file.create_file(size=100)\n\n ````\n" - uid: azure.storage.fileshare.aio.ShareFileClient.delete_file name: delete_file summary: 'Marks the specified file for deletion. The file is @@ -447,14 +438,6 @@ methods: return: types: - - examples: - - "Delete a file.\n\ - \n\n\n````python\n\ - \n await my_file.delete_file()\n\n ````\n" - uid: azure.storage.fileshare.aio.ShareFileClient.download_file name: download_file summary: 'Downloads a file to the StorageStreamDownloader. The readall() method @@ -541,15 +524,6 @@ methods: description: A streaming object (StorageStreamDownloader) types: - - examples: - - "Download a file.\n\ - \n\n\n````python\n\ - \n with open(DEST_FILE, \"wb\") as data:\n stream = await my_file.download_file()\n\ - \ data.write(await stream.readall())\n\n ````\n" - uid: azure.storage.fileshare.aio.ShareFileClient.get_file_properties name: get_file_properties summary: 'Returns all user-defined metadata, standard HTTP properties, and @@ -1099,14 +1073,6 @@ methods: return: types: - (, ) - examples: - - "Copy a file from a URL\n\n\n\n````python\n\ - \n await destination_file.start_copy_from_url(source_url=source_url)\n\n ````\n" - uid: azure.storage.fileshare.aio.ShareFileClient.upload_file name: upload_file summary: Uploads a new file. @@ -1257,15 +1223,6 @@ methods: description: File-updated property dict (Etag and last modified). types: - (, ) - examples: - - "Upload a file.\n\ - \n\n\n````python\n\ - \n with open(SOURCE_FILE, \"rb\") as source:\n await my_file.upload_file(source)\n\ - \n ````\n" - uid: azure.storage.fileshare.aio.ShareFileClient.upload_range name: upload_range summary: Upload a range of bytes to a file. diff --git a/docs-ref-autogen/azure-storage-file-share/azure.storage.fileshare.aio.ShareServiceClient.yml b/docs-ref-autogen/azure-storage-file-share/azure.storage.fileshare.aio.ShareServiceClient.yml index 300892e86caf..d49cf4a2d338 100644 --- a/docs-ref-autogen/azure-storage-file-share/azure.storage.fileshare.aio.ShareServiceClient.yml +++ b/docs-ref-autogen/azure-storage-file-share/azure.storage.fileshare.aio.ShareServiceClient.yml @@ -89,17 +89,6 @@ constructor: description: The maximum range size used for a file upload. Defaults to 4*1024*1024. types: - -examples: -- "Create the share service client with url and credential.\n\n\n\n````python\n\n from azure.storage.fileshare.aio\ - \ import ShareServiceClient\n share_service_client = ShareServiceClient(\n \ - \ account_url=self.account_url,\n credential=self.access_key\n )\n\n\ - \ ````\n" methods: - uid: azure.storage.fileshare.aio.ShareServiceClient.create_share name: create_share @@ -140,14 +129,6 @@ methods: return: types: - - examples: - - "Create a share in the file share service.\n\n\n\n````python\n\ - \n await file_service.create_share(share_name=\"fileshare1\")\n\n ````\n" - uid: azure.storage.fileshare.aio.ShareServiceClient.delete_share name: delete_share summary: 'Marks the specified share for deletion. The share is @@ -184,14 +165,6 @@ methods: return: types: - - examples: - - "Delete a share in the file share service.\n\n\n\n````python\n\ - \n await file_service.delete_share(share_name=\"fileshare1\")\n\n ````\n" - uid: azure.storage.fileshare.aio.ShareServiceClient.get_service_properties name: get_service_properties summary: 'Gets the properties of a storage account''s File Share service, including @@ -217,14 +190,6 @@ methods: analytics logging, hour/minute metrics, cors rules, etc.' types: - [, ] - examples: - - "Get file share service properties.\n\n\n\n````python\n\ - \n properties = await file_service.get_service_properties()\n\n ````\n" - uid: azure.storage.fileshare.aio.ShareServiceClient.get_share_client name: get_share_client summary: 'Get a client to interact with the specified share. @@ -253,17 +218,6 @@ methods: description: A ShareClient. types: - - examples: - - "Gets the share client.\n\n\n\n````python\n\ - \n from azure.storage.fileshare.aio import ShareServiceClient\n file_service\ - \ = ShareServiceClient.from_connection_string(self.connection_string)\n\n #\ - \ Get a share client to interact with a specific share\n share = file_service.get_share_client(\"\ - fileshare2\")\n\n ````\n" - uid: azure.storage.fileshare.aio.ShareServiceClient.list_shares name: list_shares summary: 'Returns auto-paging iterable of dict-like ShareProperties under the specified @@ -314,16 +268,6 @@ methods: description: An iterable (auto-paging) of ShareProperties. types: - [] - examples: - - "List shares in the file share service.\n\n\n\n````python\n\ - \n # List the shares in the file service\n my_shares = []\n async for s\ - \ in file_service.list_shares():\n my_shares.append(s)\n\n # Print the\ - \ shares\n for share in my_shares:\n print(share)\n\n ````\n" - uid: azure.storage.fileshare.aio.ShareServiceClient.set_service_properties name: set_service_properties summary: 'Sets the properties of a storage account''s File Share service, including @@ -376,29 +320,6 @@ methods: return: types: - - examples: - - "Sets file share service properties.\n\n\n\n````python\n\ - \n # Create service properties\n from azure.storage.fileshare import Metrics,\ - \ CorsRule, RetentionPolicy\n\n # Create metrics for requests statistics\n \ - \ hour_metrics = Metrics(enabled=True, include_apis=True, retention_policy=RetentionPolicy(enabled=True,\ - \ days=5))\n minute_metrics = Metrics(enabled=True, include_apis=True,\n \ - \ retention_policy=RetentionPolicy(enabled=True, days=5))\n\ - \n # Create CORS rules\n cors_rule1 = CorsRule(['www.xyz.com'], ['GET'])\n\ - \ allowed_origins = ['www.xyz.com', \"www.ab.com\", \"www.bc.com\"]\n allowed_methods\ - \ = ['GET', 'PUT']\n max_age_in_seconds = 500\n exposed_headers = [\"x-ms-meta-data*\"\ - , \"x-ms-meta-source*\", \"x-ms-meta-abc\", \"x-ms-meta-bcd\"]\n allowed_headers\ - \ = [\"x-ms-meta-data*\", \"x-ms-meta-target*\", \"x-ms-meta-xyz\", \"x-ms-meta-foo\"\ - ]\n cors_rule2 = CorsRule(\n allowed_origins,\n allowed_methods,\n\ - \ max_age_in_seconds=max_age_in_seconds,\n exposed_headers=exposed_headers,\n\ - \ allowed_headers=allowed_headers)\n\n cors = [cors_rule1, cors_rule2]\n\ - \n async with file_service:\n # Set the service properties\n await\ - \ file_service.set_service_properties(hour_metrics, minute_metrics, cors)\n\n\ - \ ````\n" - uid: azure.storage.fileshare.aio.ShareServiceClient.undelete_share name: undelete_share summary: 'Restores soft-deleted share. diff --git a/docs-ref-autogen/azure-storage-file-share/azure.storage.fileshare.yml b/docs-ref-autogen/azure-storage-file-share/azure.storage.fileshare.yml index 4c1cb039136f..6056c14f1bd0 100644 --- a/docs-ref-autogen/azure-storage-file-share/azure.storage.fileshare.yml +++ b/docs-ref-autogen/azure-storage-file-share/azure.storage.fileshare.yml @@ -100,20 +100,6 @@ functions: description: A Shared Access Signature (sas) token. types: - - examples: - - "Generate a sas token.\n\n\n\n````python\n\ - \n from azure.storage.fileshare import ShareServiceClient\n share_service_client\ - \ = ShareServiceClient.from_connection_string(self.connection_string)\n\n #\ - \ Create a SAS token to use to authenticate a new client\n from azure.storage.fileshare\ - \ import generate_account_sas, ResourceTypes, AccountSasPermissions\n\n sas_token\ - \ = generate_account_sas(\n self.account_name,\n self.access_key,\n\ - \ resource_types=ResourceTypes(service=True),\n permission=AccountSasPermissions(read=True),\n\ - \ expiry=datetime.utcnow() + timedelta(hours=1)\n )\n\n ````\n" - uid: azure.storage.fileshare.generate_file_sas name: generate_file_sas summary: 'Generates a shared access signature for a file. diff --git a/docs-ref-autogen/azure-storage-queue/azure.storage.queue.QueueClient.yml b/docs-ref-autogen/azure-storage-queue/azure.storage.queue.QueueClient.yml index 300d32f74e9b..713a337e2829 100644 --- a/docs-ref-autogen/azure-storage-queue/azure.storage.queue.QueueClient.yml +++ b/docs-ref-autogen/azure-storage-queue/azure.storage.queue.QueueClient.yml @@ -76,15 +76,6 @@ constructor: Default value is not to decode messages. Other options include , or *None*.' -examples: -- "Create the queue client with url and credential.\n\n\n\n````python\n\n token_auth_queue\ - \ = QueueClient.from_queue_url(\n queue_url=queue.url,\n credential=sas_token\n\ - \ )\n\n ````\n" methods: - uid: azure.storage.queue.QueueClient.clear_messages name: clear_messages @@ -103,14 +94,6 @@ methods: see [here](https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/storage/azure-storage-queue#other-client--per-operation-configuration).' types: - - examples: - - "Clears all messages.\n\ - \n\n\n````python\n\n queue.clear_messages()\n\ - \n ````\n" - uid: azure.storage.queue.QueueClient.create_queue name: create_queue summary: 'Creates a new queue in the storage account. @@ -147,14 +130,6 @@ methods: - exceptions: - type: StorageErrorException - examples: - - "Create a queue.\n\ - \n\n\n````python\n\ - \n queue.create_queue()\n\n ````\n" - uid: azure.storage.queue.QueueClient.delete_message name: delete_message summary: 'Deletes the specified message. @@ -209,15 +184,6 @@ methods: see [here](https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/storage/azure-storage-queue#other-client--per-operation-configuration).' types: - - examples: - - "Delete a message.\n\ - \n\n\n````python\n\n # Get the\ - \ message at the front of the queue\n msg = next(queue.receive_messages())\n\ - \n # Delete the specified message\n queue.delete_message(msg)\n\n ````\n" - uid: azure.storage.queue.QueueClient.delete_queue name: delete_queue summary: 'Deletes the specified queue and any messages it contains. @@ -252,14 +218,6 @@ methods: return: types: - - examples: - - "Delete a queue.\n\ - \n\n\n````python\n\ - \n queue.delete_queue()\n\n ````\n" - uid: azure.storage.queue.QueueClient.from_connection_string name: from_connection_string summary: Create QueueClient from a Connection String. @@ -302,16 +260,6 @@ methods: description: A queue client. types: - - examples: - - "Create the queue client from connection string.\n\n\n\n````python\n\n from azure.storage.queue import QueueClient\n\ - \ queue = QueueClient.from_connection_string(self.connection_string, \"myqueue1\"\ - )\n\n ````\n" - uid: azure.storage.queue.QueueClient.from_queue_url name: from_queue_url summary: A client to interact with a specific Queue. @@ -388,14 +336,6 @@ methods: description: User-defined metadata for the queue. types: - - examples: - - "Get the properties on the queue.\n\n\n\n````python\n\ - \n properties = queue.get_queue_properties().metadata\n\n ````\n" - uid: azure.storage.queue.QueueClient.peek_messages name: peek_messages summary: 'Retrieves one or more messages from the front of the queue, but does @@ -454,17 +394,6 @@ methods: not pop the message and can only retrieve already visible messages.' types: - () - examples: - - "Peek messages.\n\n\ - \n\n````python\n\n # Peek at\ - \ one message at the front of the queue\n msg = queue.peek_messages()\n\n \ - \ # Peek at the last 5 messages\n messages = queue.peek_messages(max_messages=5)\n\ - \n # Print the last 5 messages\n for message in messages:\n print(message.content)\n\ - \n ````\n" - uid: azure.storage.queue.QueueClient.receive_message name: receive_message summary: 'Removes one message from the front of the queue. @@ -517,17 +446,6 @@ methods: description: Returns a message from the Queue. types: - - examples: - - "Receive one message from the queue.\n\n\n\n````python\n\ - \n # Pop two messages from the front of the queue\n message1 = queue.receive_message()\n\ - \ message2 = queue.receive_message()\n # We should see message 3 if we peek\n\ - \ message3 = queue.peek_messages()[0]\n\n print(message1.content)\n print(message2.content)\n\ - \ print(message3.content)\n\n ````\n" - uid: azure.storage.queue.QueueClient.receive_messages name: receive_messages summary: 'Removes one or more messages from the front of the queue. @@ -589,18 +507,6 @@ methods: description: Returns a message iterator of dict-like Message objects. types: - [] - examples: - - "Receive messages from the queue.\n\n\n\n````python\n\ - \n # Receive messages one-by-one\n messages = queue.receive_messages()\n \ - \ for msg in messages:\n print(msg.content)\n\n # Receive messages by\ - \ batch\n messages = queue.receive_messages(messages_per_page=5)\n for msg_batch\ - \ in messages.by_page():\n for msg in msg_batch:\n print(msg.content)\n\ - \ queue.delete_message(msg)\n\n ````\n" - uid: azure.storage.queue.QueueClient.send_message name: send_message summary: 'Adds a new message to the back of the message queue. @@ -678,16 +584,6 @@ methods: returned from the service.' types: - - examples: - - "Send messages.\n\n\ - \n\n````python\n\n queue.send_message(\"\ - message1\")\n queue.send_message(\"message2\", visibility_timeout=30) # wait\ - \ 30s before becoming visible\n queue.send_message(\"message3\")\n queue.send_message(\"\ - message4\")\n queue.send_message(\"message5\")\n\n ````\n" - uid: azure.storage.queue.QueueClient.set_queue_access_policy name: set_queue_access_policy summary: 'Sets stored access policies for the queue that may be used with Shared @@ -738,19 +634,6 @@ methods: see [here](https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/storage/azure-storage-queue#other-client--per-operation-configuration).' types: - - examples: - - "Set an access policy on the queue.\n\n\n\n````python\n\ - \n # Create an access policy\n from azure.storage.queue import AccessPolicy,\ - \ QueueSasPermissions\n access_policy = AccessPolicy()\n access_policy.start\ - \ = datetime.utcnow() - timedelta(hours=1)\n access_policy.expiry = datetime.utcnow()\ - \ + timedelta(hours=1)\n access_policy.permission = QueueSasPermissions(read=True)\n\ - \ identifiers = {'my-access-policy-id': access_policy}\n\n # Set the access\ - \ policy\n queue.set_queue_access_policy(identifiers)\n\n ````\n" - uid: azure.storage.queue.QueueClient.set_queue_metadata name: set_queue_metadata summary: 'Sets user-defined metadata on the specified queue. @@ -779,15 +662,6 @@ methods: see [here](https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/storage/azure-storage-queue#other-client--per-operation-configuration).' types: - - examples: - - "Set metadata on the queue.\n\n\n\n````python\n\ - \n metadata = {'foo': 'val1', 'bar': 'val2', 'baz': 'val3'}\n queue.set_queue_metadata(metadata=metadata)\n\ - \n ````\n" - uid: azure.storage.queue.QueueClient.update_message name: update_message summary: 'Updates the visibility timeout of a message. You can also use this @@ -871,14 +745,3 @@ methods: by the service.' types: - - examples: - - "Update a message.\n\ - \n\n\n````python\n\n # Send a message\n\ - \ queue.send_message(\"update me\")\n\n # Receive the message\n messages\ - \ = queue.receive_messages()\n\n # Update the message\n list_result = next(messages)\n\ - \ message = queue.update_message(\n list_result.id,\n pop_receipt=list_result.pop_receipt,\n\ - \ visibility_timeout=0,\n content=\"updated\")\n\n ````\n" diff --git a/docs-ref-autogen/azure-storage-queue/azure.storage.queue.QueueServiceClient.yml b/docs-ref-autogen/azure-storage-queue/azure.storage.queue.QueueServiceClient.yml index c3add98115ac..795a23c5bc1c 100644 --- a/docs-ref-autogen/azure-storage-queue/azure.storage.queue.QueueServiceClient.yml +++ b/docs-ref-autogen/azure-storage-queue/azure.storage.queue.QueueServiceClient.yml @@ -70,28 +70,6 @@ constructor: description: The hostname of the secondary endpoint. types: - -examples: -- "Creating the QueueServiceClient with an account url and credential.\n\n\n\n````python\n\n from azure.storage.queue import QueueServiceClient\n\ - \ queue_service = QueueServiceClient(account_url=self.account_url, credential=self.access_key)\n\ - \n ````\n\nCreating the QueueServiceClient with Azure Identity credentials.\n\n\n\n````python\n\n # Get a token credential for authentication\n \ - \ from azure.identity import ClientSecretCredential\n token_credential = ClientSecretCredential(\n\ - \ self.active_directory_tenant_id,\n self.active_directory_application_id,\n\ - \ self.active_directory_application_secret\n )\n\n # Instantiate a QueueServiceClient\ - \ using a token credential\n from azure.storage.queue import QueueServiceClient\n\ - \ queue_service = QueueServiceClient(account_url=self.account_url, credential=token_credential)\n\ - \n ````\n" methods: - uid: azure.storage.queue.QueueServiceClient.create_queue name: create_queue @@ -123,14 +101,6 @@ methods: return: types: - - examples: - - "Create a queue in the service.\n\n\n\n````python\n\ - \n queue_service.create_queue(\"myqueue1\")\n\n ````\n" - uid: azure.storage.queue.QueueServiceClient.delete_queue name: delete_queue summary: 'Deletes the specified queue and any messages it contains. @@ -165,14 +135,6 @@ methods: return: types: - - examples: - - "Delete a queue in the service.\n\n\n\n````python\n\ - \n queue_service.delete_queue(\"myqueue1\")\n\n ````\n" - uid: azure.storage.queue.QueueServiceClient.from_connection_string name: from_connection_string summary: Create QueueServiceClient from a Connection String. @@ -210,16 +172,6 @@ methods: description: A Queue service client. types: - - examples: - - "Creating the QueueServiceClient with a connection string.\n\n\n\n````python\n\n from azure.storage.queue import QueueServiceClient\n\ - \ queue_service = QueueServiceClient.from_connection_string(conn_str=self.connection_string)\n\ - \n ````\n" - uid: azure.storage.queue.QueueServiceClient.get_queue_client name: get_queue_client summary: 'Get a client to interact with the specified queue. @@ -240,15 +192,6 @@ methods: description: A object. types: - - examples: - - "Get the queue client.\n\ - \n\n\n````python\n\n # Get the\ - \ queue client to interact with a specific queue\n queue = queue_service.get_queue_client(queue=\"\ - myqueue2\")\n\n ````\n" - uid: azure.storage.queue.QueueServiceClient.get_service_properties name: get_service_properties summary: 'Gets the properties of a storage account''s Queue service, including @@ -266,14 +209,6 @@ methods: analytics logging, hour/minute metrics, cors rules, etc.' types: - [, ] - examples: - - "Getting queue service properties.\n\n\n\n````python\n\ - \n properties = queue_service.get_service_properties()\n\n ````\n" - uid: azure.storage.queue.QueueServiceClient.get_service_stats name: get_service_stats summary: 'Retrieves statistics related to replication for the Queue service. @@ -367,17 +302,6 @@ methods: description: An iterable (auto-paging) of QueueProperties. types: - [] - examples: - - "List queues in the service.\n\n\n\n````python\n\ - \n # List all the queues in the service\n list_queues = queue_service.list_queues()\n\ - \ for queue in list_queues:\n print(queue)\n\n # List the queues in\ - \ the service that start with the name \"my\"\n list_my_queues = queue_service.list_queues(name_starts_with=\"\ - my\")\n for queue in list_my_queues:\n print(queue)\n\n ````\n" - uid: azure.storage.queue.QueueServiceClient.set_service_properties name: set_service_properties summary: 'Sets the properties of a storage account''s Queue service, including @@ -427,26 +351,3 @@ methods: return: types: - - examples: - - "Setting queue service properties.\n\n\n\n````python\n\ - \n # Create service properties\n from azure.storage.queue import QueueAnalyticsLogging,\ - \ Metrics, CorsRule, RetentionPolicy\n\n # Create logging settings\n logging\ - \ = QueueAnalyticsLogging(read=True, write=True, delete=True, retention_policy=RetentionPolicy(enabled=True,\ - \ days=5))\n\n # Create metrics for requests statistics\n hour_metrics = Metrics(enabled=True,\ - \ include_apis=True, retention_policy=RetentionPolicy(enabled=True, days=5))\n\ - \ minute_metrics = Metrics(enabled=True, include_apis=True, retention_policy=RetentionPolicy(enabled=True,\ - \ days=5))\n\n # Create CORS rules\n cors_rule1 = CorsRule(['www.xyz.com'],\ - \ ['GET'])\n allowed_origins = ['www.xyz.com', \"www.ab.com\", \"www.bc.com\"\ - ]\n allowed_methods = ['GET', 'PUT']\n max_age_in_seconds = 500\n exposed_headers\ - \ = [\"x-ms-meta-data*\", \"x-ms-meta-source*\", \"x-ms-meta-abc\", \"x-ms-meta-bcd\"\ - ]\n allowed_headers = [\"x-ms-meta-data*\", \"x-ms-meta-target*\", \"x-ms-meta-xyz\"\ - , \"x-ms-meta-foo\"]\n cors_rule2 = CorsRule(\n allowed_origins,\n \ - \ allowed_methods,\n max_age_in_seconds=max_age_in_seconds,\n exposed_headers=exposed_headers,\n\ - \ allowed_headers=allowed_headers\n )\n\n cors = [cors_rule1, cors_rule2]\n\ - \n # Set the service properties\n queue_service.set_service_properties(logging,\ - \ hour_metrics, minute_metrics, cors)\n\n ````\n" diff --git a/docs-ref-autogen/azure-storage-queue/azure.storage.queue.aio.QueueClient.yml b/docs-ref-autogen/azure-storage-queue/azure.storage.queue.aio.QueueClient.yml index d6e2b9e8bf68..cb7ecb90a7a9 100644 --- a/docs-ref-autogen/azure-storage-queue/azure.storage.queue.aio.QueueClient.yml +++ b/docs-ref-autogen/azure-storage-queue/azure.storage.queue.aio.QueueClient.yml @@ -72,23 +72,6 @@ constructor: Default value is not to decode messages. Other options include , or *None*.' -examples: -- "Create the queue client with url and credential.\n\n\n\n````python\n\n token_auth_queue\ - \ = QueueClient.from_queue_url(\n queue_url=queue.url,\n credential=sas_token\n\ - \ )\n\n ````\n\nCreate the queue client with a connection string.\n\n\n\n````python\n\n from azure.storage.queue.aio import QueueClient\n\ - \ queue = QueueClient.from_connection_string(self.connection_string, \"myqueue1\"\ - )\n\n ````\n" methods: - uid: azure.storage.queue.aio.QueueClient.clear_messages name: clear_messages @@ -107,14 +90,6 @@ methods: see [here](https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/storage/azure-storage-queue#other-client--per-operation-configuration).' types: - - examples: - - "Clears all messages.\n\n\n\n````python\n\ - \n await queue.clear_messages()\n\n ````\n" - uid: azure.storage.queue.aio.QueueClient.create_queue name: create_queue summary: 'Creates a new queue in the storage account. @@ -151,14 +126,6 @@ methods: - exceptions: - type: StorageErrorException - examples: - - "Create a queue.\n\n\n\n````python\n\ - \n await queue.create_queue()\n\n ````\n" - uid: azure.storage.queue.aio.QueueClient.delete_message name: delete_message summary: 'Deletes the specified message. @@ -213,16 +180,6 @@ methods: see [here](https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/storage/azure-storage-queue#other-client--per-operation-configuration).' types: - - examples: - - "Delete a message.\n\n\n\n````python\n\ - \n # Get the message at the front of the queue\n messages = queue.receive_messages()\n\ - \ async for msg in messages:\n # Delete the specified message\n \ - \ await queue.delete_message(msg)\n\n ````\n" - uid: azure.storage.queue.aio.QueueClient.delete_queue name: delete_queue summary: 'Deletes the specified queue and any messages it contains. @@ -257,14 +214,6 @@ methods: return: types: - - examples: - - "Delete a queue.\n\n\n\n````python\n\ - \n await queue.delete_queue()\n\n ````\n" - uid: azure.storage.queue.aio.QueueClient.get_queue_access_policy name: get_queue_access_policy summary: 'Returns details about any stored access policies specified on the @@ -304,14 +253,6 @@ methods: description: User-defined metadata for the queue. types: - - examples: - - "Get the properties on the queue.\n\n\n\n````python\n\ - \n properties = await queue.get_queue_properties()\n\n ````\n" - uid: azure.storage.queue.aio.QueueClient.peek_messages name: peek_messages summary: 'Retrieves one or more messages from the front of the queue, but does @@ -371,17 +312,6 @@ methods: not pop the message and can only retrieve already visible messages.' types: - () - examples: - - "Peek messages.\n\ - \n\n\n````python\n\ - \n # Peek at one message at the front of the queue\n msg = await queue.peek_messages()\n\ - \n # Peek at the last 5 messages\n messages = await queue.peek_messages(max_messages=5)\n\ - \n # Print the last 5 messages\n for message in messages:\n print(message.content)\n\ - \n ````\n" - uid: azure.storage.queue.aio.QueueClient.receive_message name: receive_message summary: 'Removes one message from the front of the queue. @@ -434,18 +364,6 @@ methods: description: Returns a message from the Queue. types: - - examples: - - "Receive one message from the queue.\n\n\n\n````python\n\ - \n # Pop two messages from the front of the queue\n message1 = await\ - \ queue.receive_message()\n message2 = await queue.receive_message()\n \ - \ # We should see message 3 if we peek\n message3 = await queue.peek_messages()\n\ - \n print(message1.content)\n print(message2.content)\n print(message3[0].content)\n\ - \n ````\n" - uid: azure.storage.queue.aio.QueueClient.receive_messages name: receive_messages summary: 'Removes one or more messages from the front of the queue. @@ -522,18 +440,6 @@ methods: description: Returns a message iterator of dict-like Message objects. types: - [] - examples: - - "Receive messages from the queue.\n\n\n\n````python\n\ - \n # Receive messages one-by-one\n messages = queue.receive_messages()\n \ - \ async for msg in messages:\n print(msg.content)\n\n # Receive messages\ - \ by batch\n messages = queue.receive_messages(messages_per_page=5)\n async\ - \ for msg_batch in messages.by_page():\n for msg in msg_batch:\n \ - \ print(msg.content)\n await queue.delete_message(msg)\n\n ````\n" - uid: azure.storage.queue.aio.QueueClient.send_message name: send_message summary: 'Adds a new message to the back of the message queue. @@ -611,17 +517,6 @@ methods: returned from the service.' types: - - examples: - - "Send messages.\n\ - \n\n\n````python\n\ - \n await asyncio.gather(\n queue.send_message(\"message1\"),\n queue.send_message(\"\ - message2\", visibility_timeout=30), # wait 30s before becoming visible\n \ - \ queue.send_message(\"message3\"),\n queue.send_message(\"message4\"\ - ),\n queue.send_message(\"message5\")\n )\n\n ````\n" - uid: azure.storage.queue.aio.QueueClient.set_queue_access_policy name: set_queue_access_policy summary: 'Sets stored access policies for the queue that may be used with Shared @@ -673,19 +568,6 @@ methods: see [here](https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/storage/azure-storage-queue#other-client--per-operation-configuration).' types: - - examples: - - "Set an access policy on the queue.\n\n\n\n````python\n\ - \n # Create an access policy\n from azure.storage.queue import AccessPolicy,\ - \ QueueSasPermissions\n access_policy = AccessPolicy()\n access_policy.start\ - \ = datetime.utcnow() - timedelta(hours=1)\n access_policy.expiry = datetime.utcnow()\ - \ + timedelta(hours=1)\n access_policy.permission = QueueSasPermissions(read=True)\n\ - \ identifiers = {'my-access-policy-id': access_policy}\n\n # Set the access\ - \ policy\n await queue.set_queue_access_policy(identifiers)\n\n ````\n" - uid: azure.storage.queue.aio.QueueClient.set_queue_metadata name: set_queue_metadata summary: 'Sets user-defined metadata on the specified queue. @@ -714,15 +596,6 @@ methods: see [here](https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/storage/azure-storage-queue#other-client--per-operation-configuration).' types: - - examples: - - "Set metadata on the queue.\n\n\n\n````python\n\ - \n metadata = {'foo': 'val1', 'bar': 'val2', 'baz': 'val3'}\n await queue.set_queue_metadata(metadata=metadata)\n\ - \n ````\n" - uid: azure.storage.queue.aio.QueueClient.update_message name: update_message summary: 'Updates the visibility timeout of a message. You can also use this @@ -806,15 +679,3 @@ methods: by the service.' types: - - examples: - - "Update a message.\n\n\n\n````python\n\ - \n # Send a message\n await queue.send_message(\"update me\")\n\n # Receive\ - \ the message\n messages = queue.receive_messages()\n\n # Update the message\n\ - \ async for message in messages:\n message = await queue.update_message(\n\ - \ message,\n visibility_timeout=0,\n content=\"\ - updated\")\n\n ````\n" diff --git a/docs-ref-autogen/azure-storage-queue/azure.storage.queue.aio.QueueServiceClient.yml b/docs-ref-autogen/azure-storage-queue/azure.storage.queue.aio.QueueServiceClient.yml index cbb49db6d50d..cc1269bda0c8 100644 --- a/docs-ref-autogen/azure-storage-queue/azure.storage.queue.aio.QueueServiceClient.yml +++ b/docs-ref-autogen/azure-storage-queue/azure.storage.queue.aio.QueueServiceClient.yml @@ -66,28 +66,6 @@ constructor: description: The hostname of the secondary endpoint. types: - -examples: -- "Creating the QueueServiceClient with an account url and credential.\n\n\n\n````python\n\n from azure.storage.queue.aio import\ - \ QueueServiceClient\n queue_service = QueueServiceClient(account_url=self.account_url,\ - \ credential=self.access_key)\n\n ````\n\nCreating the QueueServiceClient with\ - \ Azure Identity credentials.\n\n\n\n````python\n\n # Get a token\ - \ credential for authentication\n from azure.identity.aio import ClientSecretCredential\n\ - \ token_credential = ClientSecretCredential(\n self.active_directory_tenant_id,\n\ - \ self.active_directory_application_id,\n self.active_directory_application_secret\n\ - \ )\n\n # Instantiate a QueueServiceClient using a token credential\n from\ - \ azure.storage.queue.aio import QueueServiceClient\n queue_service = QueueServiceClient(account_url=self.account_url,\ - \ credential=token_credential)\n\n ````\n" methods: - uid: azure.storage.queue.aio.QueueServiceClient.create_queue name: create_queue @@ -119,14 +97,6 @@ methods: return: types: - - examples: - - "Create a queue in the service.\n\n\n\n````python\n\ - \n await queue_service.create_queue(\"myqueue1\")\n\n ````\n" - uid: azure.storage.queue.aio.QueueServiceClient.delete_queue name: delete_queue summary: 'Deletes the specified queue and any messages it contains. @@ -161,14 +131,6 @@ methods: return: types: - - examples: - - "Delete a queue in the service.\n\n\n\n````python\n\ - \n await queue_service.delete_queue(\"myqueue1\")\n\n ````\n" - uid: azure.storage.queue.aio.QueueServiceClient.get_queue_client name: get_queue_client summary: 'Get a client to interact with the specified queue. @@ -190,15 +152,6 @@ methods: description: A object. types: - - examples: - - "Get the queue client.\n\n\n\n````python\n\ - \n # Get the queue client to interact with a specific queue\n queue = queue_service.get_queue_client(queue=\"\ - myqueue2\")\n\n ````\n" - uid: azure.storage.queue.aio.QueueServiceClient.get_service_properties name: get_service_properties summary: 'Gets the properties of a storage account''s Queue service, including @@ -216,14 +169,6 @@ methods: analytics logging, hour/minute metrics, cors rules, etc.' types: - [, ] - examples: - - "Getting queue service properties.\n\n\n\n````python\n\ - \n properties = await queue_service.get_service_properties()\n\n ````\n" - uid: azure.storage.queue.aio.QueueServiceClient.get_service_stats name: get_service_stats summary: 'Retrieves statistics related to replication for the Queue service. @@ -317,17 +262,6 @@ methods: description: An iterable (auto-paging) of QueueProperties. types: - [] - examples: - - "List queues in the service.\n\n\n\n````python\n\ - \n # List all the queues in the service\n list_queues = queue_service.list_queues()\n\ - \ async for queue in list_queues:\n print(queue)\n\n # List the queues\ - \ in the service that start with the name \"my_\"\n list_my_queues = queue_service.list_queues(name_starts_with=\"\ - my_\")\n async for queue in list_my_queues:\n print(queue)\n\n ````\n" - uid: azure.storage.queue.aio.QueueServiceClient.set_service_properties name: set_service_properties summary: 'Sets the properties of a storage account''s Queue service, including @@ -377,26 +311,3 @@ methods: return: types: - - examples: - - "Setting queue service properties.\n\n\n\n````python\n\ - \n # Create service properties\n from azure.storage.queue import QueueAnalyticsLogging,\ - \ Metrics, CorsRule, RetentionPolicy\n\n # Create logging settings\n logging\ - \ = QueueAnalyticsLogging(read=True, write=True, delete=True, retention_policy=RetentionPolicy(enabled=True,\ - \ days=5))\n\n # Create metrics for requests statistics\n hour_metrics = Metrics(enabled=True,\ - \ include_apis=True, retention_policy=RetentionPolicy(enabled=True, days=5))\n\ - \ minute_metrics = Metrics(enabled=True, include_apis=True, retention_policy=RetentionPolicy(enabled=True,\ - \ days=5))\n\n # Create CORS rules\n cors_rule1 = CorsRule(['www.xyz.com'],\ - \ ['GET'])\n allowed_origins = ['www.xyz.com', \"www.ab.com\", \"www.bc.com\"\ - ]\n allowed_methods = ['GET', 'PUT']\n max_age_in_seconds = 500\n exposed_headers\ - \ = [\"x-ms-meta-data*\", \"x-ms-meta-source*\", \"x-ms-meta-abc\", \"x-ms-meta-bcd\"\ - ]\n allowed_headers = [\"x-ms-meta-data*\", \"x-ms-meta-target*\", \"x-ms-meta-xyz\"\ - , \"x-ms-meta-foo\"]\n cors_rule2 = CorsRule(\n allowed_origins,\n \ - \ allowed_methods,\n max_age_in_seconds=max_age_in_seconds,\n exposed_headers=exposed_headers,\n\ - \ allowed_headers=allowed_headers\n )\n\n cors = [cors_rule1, cors_rule2]\n\ - \n # Set the service properties\n await queue_service.set_service_properties(logging,\ - \ hour_metrics, minute_metrics, cors)\n\n ````\n" diff --git a/docs-ref-autogen/azure-storage-queue/azure.storage.queue.yml b/docs-ref-autogen/azure-storage-queue/azure.storage.queue.yml index 2d761f7c5fd9..fc5c521104d5 100644 --- a/docs-ref-autogen/azure-storage-queue/azure.storage.queue.yml +++ b/docs-ref-autogen/azure-storage-queue/azure.storage.queue.yml @@ -196,16 +196,6 @@ functions: description: A Shared Access Signature (sas) token. types: - - examples: - - "Generate a sas token.\n\ - \n\n\n````python\n\n from azure.storage.queue\ - \ import generate_queue_sas\n sas_token = generate_queue_sas(\n queue.account_name,\n\ - \ queue.queue_name,\n queue.credential.account_key,\n policy_id='my-access-policy-id'\n\ - \ )\n\n ````\n" classes: - azure.storage.queue.AccessPolicy - azure.storage.queue.AccountSasPermissions diff --git a/docs-ref-mapping/reference-preview.yml b/docs-ref-mapping/reference-preview.yml index 0d135a90bfc3..3cf506613904 100644 --- a/docs-ref-mapping/reference-preview.yml +++ b/docs-ref-mapping/reference-preview.yml @@ -12,7 +12,7 @@ href: ~/docs-ref-services/preview/mgmt-advisor-readme.md children: - azure-mgmt-advisor - - name: AgriFood + - name: Agrifood href: ~/docs-ref-services/preview/agrifood.md landingPageType: Service items: diff --git a/preview/docs-ref-autogen/azure-ai-formrecognizer/azure.ai.formrecognizer.DocumentAnalysisClient.yml b/preview/docs-ref-autogen/azure-ai-formrecognizer/azure.ai.formrecognizer.DocumentAnalysisClient.yml index 5d6e2de9573d..77c576fdbe3f 100644 --- a/preview/docs-ref-autogen/azure-ai-formrecognizer/azure.ai.formrecognizer.DocumentAnalysisClient.yml +++ b/preview/docs-ref-autogen/azure-ai-formrecognizer/azure.ai.formrecognizer.DocumentAnalysisClient.yml @@ -66,29 +66,6 @@ constructor: types: - - -examples: -- "Creating the DocumentAnalysisClient with an endpoint and API key.\n\n\n\n````python\n\n from azure.core.credentials import AzureKeyCredential\n\ - \ from azure.ai.formrecognizer import DocumentAnalysisClient\n\n endpoint =\ - \ os.environ[\"AZURE_FORM_RECOGNIZER_ENDPOINT\"]\n key = os.environ[\"AZURE_FORM_RECOGNIZER_KEY\"\ - ]\n\n document_analysis_client = DocumentAnalysisClient(endpoint, AzureKeyCredential(key))\n\ - \n ````\n\nCreating the DocumentAnalysisClient with a token credential.\n\n\n\n````python\n\n \"\"\"DefaultAzureCredential will use the values\ - \ from these environment\n variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, AZURE_CLIENT_SECRET\n\ - \ \"\"\"\n from azure.ai.formrecognizer import DocumentAnalysisClient\n from\ - \ azure.identity import DefaultAzureCredential\n\n endpoint = os.environ[\"AZURE_FORM_RECOGNIZER_ENDPOINT\"\ - ]\n credential = DefaultAzureCredential()\n\n document_analysis_client = DocumentAnalysisClient(endpoint,\ - \ credential)\n\n ````\n" methods: - uid: azure.ai.formrecognizer.DocumentAnalysisClient.begin_analyze_document name: begin_analyze_document @@ -148,184 +125,6 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Analyze an invoice. For more samples see the *samples* folder.\n\n\n\n````python\n\n from azure.core.credentials\ - \ import AzureKeyCredential\n from azure.ai.formrecognizer import DocumentAnalysisClient\n\ - \n endpoint = os.environ[\"AZURE_FORM_RECOGNIZER_ENDPOINT\"]\n key = os.environ[\"\ - AZURE_FORM_RECOGNIZER_KEY\"]\n\n document_analysis_client = DocumentAnalysisClient(\n\ - \ endpoint=endpoint, credential=AzureKeyCredential(key)\n )\n with open(path_to_sample_documents,\ - \ \"rb\") as f:\n poller = document_analysis_client.begin_analyze_document(\n\ - \ \"prebuilt-invoice\", document=f, locale=\"en-US\"\n )\n invoices\ - \ = poller.result()\n\n for idx, invoice in enumerate(invoices.documents):\n\ - \ print(\"--------Analyzing invoice #{}--------\".format(idx + 1))\n \ - \ vendor_name = invoice.fields.get(\"VendorName\")\n if vendor_name:\n\ - \ print(\n \"Vendor Name: {} has confidence: {}\".format(\n\ - \ vendor_name.value, vendor_name.confidence\n \ - \ )\n )\n vendor_address = invoice.fields.get(\"VendorAddress\"\ - )\n if vendor_address:\n print(\n \"Vendor Address:\ - \ {} has confidence: {}\".format(\n vendor_address.value, vendor_address.confidence\n\ - \ )\n )\n vendor_address_recipient = invoice.fields.get(\"\ - VendorAddressRecipient\")\n if vendor_address_recipient:\n print(\n\ - \ \"Vendor Address Recipient: {} has confidence: {}\".format(\n\ - \ vendor_address_recipient.value, vendor_address_recipient.confidence\n\ - \ )\n )\n customer_name = invoice.fields.get(\"\ - CustomerName\")\n if customer_name:\n print(\n \"\ - Customer Name: {} has confidence: {}\".format(\n customer_name.value,\ - \ customer_name.confidence\n )\n )\n customer_id\ - \ = invoice.fields.get(\"CustomerId\")\n if customer_id:\n print(\n\ - \ \"Customer Id: {} has confidence: {}\".format(\n \ - \ customer_id.value, customer_id.confidence\n )\n \ - \ )\n customer_address = invoice.fields.get(\"CustomerAddress\")\n \ - \ if customer_address:\n print(\n \"Customer Address:\ - \ {} has confidence: {}\".format(\n customer_address.value,\ - \ customer_address.confidence\n )\n )\n customer_address_recipient\ - \ = invoice.fields.get(\"CustomerAddressRecipient\")\n if customer_address_recipient:\n\ - \ print(\n \"Customer Address Recipient: {} has confidence:\ - \ {}\".format(\n customer_address_recipient.value,\n \ - \ customer_address_recipient.confidence,\n )\n \ - \ )\n invoice_id = invoice.fields.get(\"InvoiceId\")\n if invoice_id:\n\ - \ print(\n \"Invoice Id: {} has confidence: {}\".format(\n\ - \ invoice_id.value, invoice_id.confidence\n )\n\ - \ )\n invoice_date = invoice.fields.get(\"InvoiceDate\")\n \ - \ if invoice_date:\n print(\n \"Invoice Date: {} has\ - \ confidence: {}\".format(\n invoice_date.value, invoice_date.confidence\n\ - \ )\n )\n invoice_total = invoice.fields.get(\"\ - InvoiceTotal\")\n if invoice_total:\n print(\n \"\ - Invoice Total: {} has confidence: {}\".format(\n invoice_total.value,\ - \ invoice_total.confidence\n )\n )\n due_date =\ - \ invoice.fields.get(\"DueDate\")\n if due_date:\n print(\n \ - \ \"Due Date: {} has confidence: {}\".format(\n \ - \ due_date.value, due_date.confidence\n )\n )\n \ - \ purchase_order = invoice.fields.get(\"PurchaseOrder\")\n if purchase_order:\n\ - \ print(\n \"Purchase Order: {} has confidence: {}\".format(\n\ - \ purchase_order.value, purchase_order.confidence\n \ - \ )\n )\n billing_address = invoice.fields.get(\"BillingAddress\"\ - )\n if billing_address:\n print(\n \"Billing Address:\ - \ {} has confidence: {}\".format(\n billing_address.value, billing_address.confidence\n\ - \ )\n )\n billing_address_recipient = invoice.fields.get(\"\ - BillingAddressRecipient\")\n if billing_address_recipient:\n print(\n\ - \ \"Billing Address Recipient: {} has confidence: {}\".format(\n\ - \ billing_address_recipient.value,\n billing_address_recipient.confidence,\n\ - \ )\n )\n shipping_address = invoice.fields.get(\"\ - ShippingAddress\")\n if shipping_address:\n print(\n \ - \ \"Shipping Address: {} has confidence: {}\".format(\n \ - \ shipping_address.value, shipping_address.confidence\n )\n \ - \ )\n shipping_address_recipient = invoice.fields.get(\"ShippingAddressRecipient\"\ - )\n if shipping_address_recipient:\n print(\n \"\ - Shipping Address Recipient: {} has confidence: {}\".format(\n \ - \ shipping_address_recipient.value,\n shipping_address_recipient.confidence,\n\ - \ )\n )\n print(\"Invoice items:\")\n for\ - \ idx, item in enumerate(invoice.fields.get(\"Items\").value):\n print(\"\ - ...Item #{}\".format(idx + 1))\n item_description = item.value.get(\"\ - Description\")\n if item_description:\n print(\n \ - \ \"......Description: {} has confidence: {}\".format(\n \ - \ item_description.value, item_description.confidence\n \ - \ )\n )\n item_quantity = item.value.get(\"\ - Quantity\")\n if item_quantity:\n print(\n \ - \ \"......Quantity: {} has confidence: {}\".format(\n \ - \ item_quantity.value, item_quantity.confidence\n )\n \ - \ )\n unit = item.value.get(\"Unit\")\n if unit:\n\ - \ print(\n \"......Unit: {} has confidence: {}\"\ - .format(\n unit.value, unit.confidence\n \ - \ )\n )\n unit_price = item.value.get(\"UnitPrice\"\ - )\n if unit_price:\n print(\n \"......Unit\ - \ Price: {}{} has confidence: {}\".format(\n unit_price.value,\ - \ unit_price.value.code if unit_price.value.code else \"\", unit_price.confidence\n\ - \ )\n )\n product_code = item.value.get(\"\ - ProductCode\")\n if product_code:\n print(\n \ - \ \"......Product Code: {} has confidence: {}\".format(\n \ - \ product_code.value, product_code.confidence\n )\n\ - \ )\n item_date = item.value.get(\"Date\")\n \ - \ if item_date:\n print(\n \"......Date: {} has\ - \ confidence: {}\".format(\n item_date.value, item_date.confidence\n\ - \ )\n )\n tax = item.value.get(\"Tax\"\ - )\n if tax:\n print(\n \"......Tax:\ - \ {} has confidence: {}\".format(tax.value, tax.confidence)\n )\n\ - \ amount = item.value.get(\"Amount\")\n if amount:\n \ - \ print(\n \"......Amount: {} has confidence: {}\"\ - .format(\n amount.value, amount.confidence\n \ - \ )\n )\n subtotal = invoice.fields.get(\"SubTotal\"\ - )\n if subtotal:\n print(\n \"Subtotal: {} has confidence:\ - \ {}\".format(\n subtotal.value, subtotal.confidence\n \ - \ )\n )\n total_tax = invoice.fields.get(\"TotalTax\"\ - )\n if total_tax:\n print(\n \"Total Tax: {} has\ - \ confidence: {}\".format(\n total_tax.value, total_tax.confidence\n\ - \ )\n )\n previous_unpaid_balance = invoice.fields.get(\"\ - PreviousUnpaidBalance\")\n if previous_unpaid_balance:\n print(\n\ - \ \"Previous Unpaid Balance: {} has confidence: {}\".format(\n \ - \ previous_unpaid_balance.value, previous_unpaid_balance.confidence\n\ - \ )\n )\n amount_due = invoice.fields.get(\"AmountDue\"\ - )\n if amount_due:\n print(\n \"Amount Due: {} has\ - \ confidence: {}\".format(\n amount_due.value, amount_due.confidence\n\ - \ )\n )\n service_start_date = invoice.fields.get(\"\ - ServiceStartDate\")\n if service_start_date:\n print(\n \ - \ \"Service Start Date: {} has confidence: {}\".format(\n \ - \ service_start_date.value, service_start_date.confidence\n \ - \ )\n )\n service_end_date = invoice.fields.get(\"ServiceEndDate\"\ - )\n if service_end_date:\n print(\n \"Service End\ - \ Date: {} has confidence: {}\".format(\n service_end_date.value,\ - \ service_end_date.confidence\n )\n )\n service_address\ - \ = invoice.fields.get(\"ServiceAddress\")\n if service_address:\n \ - \ print(\n \"Service Address: {} has confidence: {}\".format(\n\ - \ service_address.value, service_address.confidence\n \ - \ )\n )\n service_address_recipient = invoice.fields.get(\"\ - ServiceAddressRecipient\")\n if service_address_recipient:\n print(\n\ - \ \"Service Address Recipient: {} has confidence: {}\".format(\n\ - \ service_address_recipient.value,\n service_address_recipient.confidence,\n\ - \ )\n )\n remittance_address = invoice.fields.get(\"\ - RemittanceAddress\")\n if remittance_address:\n print(\n \ - \ \"Remittance Address: {} has confidence: {}\".format(\n \ - \ remittance_address.value, remittance_address.confidence\n \ - \ )\n )\n remittance_address_recipient = invoice.fields.get(\"\ - RemittanceAddressRecipient\")\n if remittance_address_recipient:\n \ - \ print(\n \"Remittance Address Recipient: {} has confidence:\ - \ {}\".format(\n remittance_address_recipient.value,\n \ - \ remittance_address_recipient.confidence,\n )\n \ - \ )\n\n ````\n\nAnalyze a custom document. For more samples see the\ - \ *samples* folder.\n\n\n\n````python\n\ - \n from azure.core.credentials import AzureKeyCredential\n from azure.ai.formrecognizer\ - \ import DocumentAnalysisClient\n\n endpoint = os.environ[\"AZURE_FORM_RECOGNIZER_ENDPOINT\"\ - ]\n key = os.environ[\"AZURE_FORM_RECOGNIZER_KEY\"]\n model_id = os.getenv(\"\ - CUSTOM_BUILT_MODEL_ID\", custom_model_id)\n\n document_analysis_client = DocumentAnalysisClient(\n\ - \ endpoint=endpoint, credential=AzureKeyCredential(key)\n )\n\n # Make\ - \ sure your document's type is included in the list of document types the custom\ - \ model can analyze\n with open(path_to_sample_documents, \"rb\") as f:\n \ - \ poller = document_analysis_client.begin_analyze_document(\n model_id=model_id,\ - \ document=f\n )\n result = poller.result()\n\n for idx, document in\ - \ enumerate(result.documents):\n print(\"--------Analyzing document #{}--------\"\ - .format(idx + 1))\n print(\"Document has type {}\".format(document.doc_type))\n\ - \ print(\"Document has confidence {}\".format(document.confidence))\n \ - \ print(\"Document was analyzed by model with ID {}\".format(result.model_id))\n\ - \ for name, field in document.fields.items():\n field_value =\ - \ field.value if field.value else field.content\n print(\"......found\ - \ field of type '{}' with value '{}' and with confidence {}\".format(field.value_type,\ - \ field_value, field.confidence))\n\n\n # iterate over tables, lines, and selection\ - \ marks on each page\n for page in result.pages:\n print(\"\\nLines found\ - \ on page {}\".format(page.page_number))\n for line in page.lines:\n \ - \ print(\"...Line '{}'\".format(line.content))\n for word in page.words:\n\ - \ print(\n \"...Word '{}' has a confidence of {}\".format(\n\ - \ word.content, word.confidence\n )\n \ - \ )\n for selection_mark in page.selection_marks:\n print(\n\ - \ \"...Selection mark is '{}' and has a confidence of {}\".format(\n\ - \ selection_mark.state, selection_mark.confidence\n \ - \ )\n )\n\n for i, table in enumerate(result.tables):\n \ - \ print(\"\\nTable {} can be found on page:\".format(i + 1))\n for region\ - \ in table.bounding_regions:\n print(\"...{}\".format(region.page_number))\n\ - \ for cell in table.cells:\n print(\n \"...Cell[{}][{}]\ - \ has content '{}'\".format(\n cell.row_index, cell.column_index,\ - \ cell.content\n )\n )\n print(\"-----------------------------------\"\ - )\n\n ````\n" - uid: azure.ai.formrecognizer.DocumentAnalysisClient.begin_analyze_document_from_url name: begin_analyze_document_from_url summary: 'Analyze field text and semantic values from a given document. @@ -388,59 +187,6 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Analyze a receipt. For more samples see the *samples* folder.\n\n\n\n````python\n\n from azure.core.credentials\ - \ import AzureKeyCredential\n from azure.ai.formrecognizer import DocumentAnalysisClient\n\ - \n endpoint = os.environ[\"AZURE_FORM_RECOGNIZER_ENDPOINT\"]\n key = os.environ[\"\ - AZURE_FORM_RECOGNIZER_KEY\"]\n\n document_analysis_client = DocumentAnalysisClient(\n\ - \ endpoint=endpoint, credential=AzureKeyCredential(key)\n )\n url =\ - \ \"https://raw.githubusercontent.com/Azure/azure-sdk-for-python/main/sdk/formrecognizer/azure-ai-formrecognizer/tests/sample_forms/receipt/contoso-receipt.png\"\ - \n poller = document_analysis_client.begin_analyze_document_from_url(\n \ - \ \"prebuilt-receipt\", document_url=url\n )\n receipts = poller.result()\n\ - \n for idx, receipt in enumerate(receipts.documents):\n print(\"--------Analysis\ - \ of receipt #{}--------\".format(idx + 1))\n print(\"Receipt type: {}\"\ - .format(receipt.doc_type or \"N/A\"))\n merchant_name = receipt.fields.get(\"\ - MerchantName\")\n if merchant_name:\n print(\n \"\ - Merchant Name: {} has confidence: {}\".format(\n merchant_name.value,\ - \ merchant_name.confidence\n )\n )\n transaction_date\ - \ = receipt.fields.get(\"TransactionDate\")\n if transaction_date:\n \ - \ print(\n \"Transaction Date: {} has confidence: {}\".format(\n\ - \ transaction_date.value, transaction_date.confidence\n \ - \ )\n )\n if receipt.fields.get(\"Items\"):\n \ - \ print(\"Receipt items:\")\n for idx, item in enumerate(receipt.fields.get(\"\ - Items\").value):\n print(\"...Item #{}\".format(idx + 1))\n \ - \ item_description = item.value.get(\"Description\")\n \ - \ if item_description:\n print(\n \"\ - ......Item Description: {} has confidence: {}\".format(\n \ - \ item_description.value, item_description.confidence\n \ - \ )\n )\n item_quantity = item.value.get(\"\ - Quantity\")\n if item_quantity:\n print(\n \ - \ \"......Item Quantity: {} has confidence: {}\".format(\n\ - \ item_quantity.value, item_quantity.confidence\n \ - \ )\n )\n item_price = item.value.get(\"\ - Price\")\n if item_price:\n print(\n \ - \ \"......Individual Item Price: {} has confidence: {}\".format(\n\ - \ item_price.value, item_price.confidence\n \ - \ )\n )\n item_total_price = item.value.get(\"\ - TotalPrice\")\n if item_total_price:\n print(\n\ - \ \"......Total Item Price: {} has confidence: {}\".format(\n\ - \ item_total_price.value, item_total_price.confidence\n\ - \ )\n )\n subtotal = receipt.fields.get(\"\ - Subtotal\")\n if subtotal:\n print(\n \"Subtotal:\ - \ {} has confidence: {}\".format(\n subtotal.value, subtotal.confidence\n\ - \ )\n )\n tax = receipt.fields.get(\"TotalTax\"\ - )\n if tax:\n print(\"Total tax: {} has confidence: {}\".format(tax.value,\ - \ tax.confidence))\n tip = receipt.fields.get(\"Tip\")\n if tip:\n\ - \ print(\"Tip: {} has confidence: {}\".format(tip.value, tip.confidence))\n\ - \ total = receipt.fields.get(\"Total\")\n if total:\n print(\"\ - Total: {} has confidence: {}\".format(total.value, total.confidence))\n \ - \ print(\"--------------------------------------\")\n\n ````\n" - uid: azure.ai.formrecognizer.DocumentAnalysisClient.begin_classify_document name: begin_classify_document summary: 'Classify a document using a document classifier. For more information @@ -474,25 +220,6 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Classify a document. For more samples see the *samples* folder.\n\n\n\n````python\n\n from azure.core.credentials\ - \ import AzureKeyCredential\n from azure.ai.formrecognizer import DocumentAnalysisClient\n\ - \n endpoint = os.environ[\"AZURE_FORM_RECOGNIZER_ENDPOINT\"]\n key = os.environ[\"\ - AZURE_FORM_RECOGNIZER_KEY\"]\n classifier_id = os.getenv(\"CLASSIFIER_ID\",\ - \ classifier_id)\n\n document_analysis_client = DocumentAnalysisClient(\n \ - \ endpoint=endpoint, credential=AzureKeyCredential(key)\n )\n with open(path_to_sample_documents,\ - \ \"rb\") as f:\n poller = document_analysis_client.begin_classify_document(\n\ - \ classifier_id, document=f\n )\n result = poller.result()\n\ - \n print(\"----Classified documents----\")\n for doc in result.documents:\n\ - \ print(f\"Found document of type '{doc.doc_type or 'N/A'}' with a confidence\ - \ of {doc.confidence} contained on \"\n f\"the following pages: {[region.page_number\ - \ for region in doc.bounding_regions]}\")\n\n ````\n" - uid: azure.ai.formrecognizer.DocumentAnalysisClient.begin_classify_document_from_url name: begin_classify_document_from_url summary: 'Classify a given document with a document classifier. For more information @@ -532,26 +259,6 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Classify a document. For more samples see the *samples* folder.\n\n\n\n````python\n\n from azure.core.credentials\ - \ import AzureKeyCredential\n from azure.ai.formrecognizer import DocumentAnalysisClient\n\ - \n endpoint = os.environ[\"AZURE_FORM_RECOGNIZER_ENDPOINT\"]\n key = os.environ[\"\ - AZURE_FORM_RECOGNIZER_KEY\"]\n classifier_id = os.getenv(\"CLASSIFIER_ID\",\ - \ classifier_id)\n\n document_analysis_client = DocumentAnalysisClient(\n \ - \ endpoint=endpoint, credential=AzureKeyCredential(key)\n )\n\n url =\ - \ \"https://raw.githubusercontent.com/Azure/azure-sdk-for-python/main/sdk/formrecognizer/azure-ai-formrecognizer/tests/sample_forms/forms/IRS-1040.pdf\"\ - \n\n poller = document_analysis_client.begin_classify_document_from_url(\n \ - \ classifier_id, document_url=url\n )\n result = poller.result()\n\n\ - \ print(\"----Classified documents----\")\n for doc in result.documents:\n\ - \ print(f\"Found document of type '{doc.doc_type or 'N/A'}' with a confidence\ - \ of {doc.confidence} contained on \"\n f\"the following pages: {[region.page_number\ - \ for region in doc.bounding_regions]}\")\n\n ````\n" - uid: azure.ai.formrecognizer.DocumentAnalysisClient.close name: close summary: Close the session. diff --git a/preview/docs-ref-autogen/azure-ai-formrecognizer/azure.ai.formrecognizer.DocumentModelAdministrationClient.yml b/preview/docs-ref-autogen/azure-ai-formrecognizer/azure.ai.formrecognizer.DocumentModelAdministrationClient.yml index d4dfc8be5b96..08c26e18e988 100644 --- a/preview/docs-ref-autogen/azure-ai-formrecognizer/azure.ai.formrecognizer.DocumentModelAdministrationClient.yml +++ b/preview/docs-ref-autogen/azure-ai-formrecognizer/azure.ai.formrecognizer.DocumentModelAdministrationClient.yml @@ -65,30 +65,6 @@ constructor: types: - - -examples: -- "Creating the DocumentModelAdministrationClient with an endpoint and API key.\n\n\n\n````python\n\n from azure.core.credentials import AzureKeyCredential\n\ - \ from azure.ai.formrecognizer import DocumentModelAdministrationClient\n\n \ - \ endpoint = os.environ[\"AZURE_FORM_RECOGNIZER_ENDPOINT\"]\n key = os.environ[\"\ - AZURE_FORM_RECOGNIZER_KEY\"]\n\n document_model_admin_client = DocumentModelAdministrationClient(endpoint,\ - \ AzureKeyCredential(key))\n\n ````\n\nCreating the DocumentModelAdministrationClient\ - \ with a token credential.\n\n\n\n````python\n\n \"\"\"DefaultAzureCredential\ - \ will use the values from these environment\n variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,\ - \ AZURE_CLIENT_SECRET\n \"\"\"\n from azure.ai.formrecognizer import DocumentModelAdministrationClient\n\ - \ from azure.identity import DefaultAzureCredential\n\n endpoint = os.environ[\"\ - AZURE_FORM_RECOGNIZER_ENDPOINT\"]\n credential = DefaultAzureCredential()\n\n\ - \ document_model_admin_client = DocumentModelAdministrationClient(endpoint, credential)\n\ - \n ````\n" methods: - uid: azure.ai.formrecognizer.DocumentModelAdministrationClient.begin_build_document_classifier name: begin_build_document_classifier @@ -126,36 +102,6 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Build a document classifier.\n\n\n\n````python\n\ - \n import os\n from azure.ai.formrecognizer import (\n DocumentModelAdministrationClient,\n\ - \ ClassifierDocumentTypeDetails,\n AzureBlobContentSource,\n \ - \ AzureBlobFileListSource\n )\n from azure.core.credentials import AzureKeyCredential\n\ - \n endpoint = os.environ[\"AZURE_FORM_RECOGNIZER_ENDPOINT\"]\n key = os.environ[\"\ - AZURE_FORM_RECOGNIZER_KEY\"]\n container_sas_url = os.environ[\"CLASSIFIER_CONTAINER_SAS_URL\"\ - ]\n\n document_model_admin_client = DocumentModelAdministrationClient(endpoint=endpoint,\ - \ credential=AzureKeyCredential(key))\n\n # pass either a azure_blob_source\ - \ or azure_blob_file_list_source\n poller = document_model_admin_client.begin_build_document_classifier(\n\ - \ doc_types={\n \"IRS-1040-A\": ClassifierDocumentTypeDetails(\n\ - \ azure_blob_source=AzureBlobContentSource(\n \ - \ container_url=container_sas_url,\n prefix=\"IRS-1040-A/train\"\ - \n )\n ),\n \"IRS-1040-D\": ClassifierDocumentTypeDetails(\n\ - \ azure_blob_file_list_source=AzureBlobFileListSource(\n \ - \ container_url=container_sas_url,\n file_list=\"\ - IRS-1040-D.jsonl\"\n )\n ),\n },\n description=\"\ - IRS document classifier\"\n )\n result = poller.result()\n print(f\"Classifier\ - \ ID: {result.classifier_id}\")\n print(f\"API version used to build the classifier\ - \ model: {result.api_version}\")\n print(f\"Classifier description: {result.description}\"\ - )\n print(f\"Document classes used for training the model:\")\n for doc_type,\ - \ source in result.doc_types.items():\n print(f\"Document type: {doc_type}\"\ - )\n blob_source = source.azure_blob_source if source.azure_blob_source else\ - \ source.azure_blob_file_list_source\n print(f\"Container source: {blob_source.container_url}\\\ - n\")\n\n ````\n" - uid: azure.ai.formrecognizer.DocumentModelAdministrationClient.begin_build_document_model name: begin_build_document_model summary: 'Build a custom document model. @@ -245,30 +191,6 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Building a model from training files.\n\n\n\n````python\n\ - \n from azure.ai.formrecognizer import DocumentModelAdministrationClient, ModelBuildMode\n\ - \ from azure.core.credentials import AzureKeyCredential\n\n endpoint = os.environ[\"\ - AZURE_FORM_RECOGNIZER_ENDPOINT\"]\n key = os.environ[\"AZURE_FORM_RECOGNIZER_KEY\"\ - ]\n container_sas_url = os.environ[\"CONTAINER_SAS_URL\"]\n\n document_model_admin_client\ - \ = DocumentModelAdministrationClient(endpoint, AzureKeyCredential(key))\n poller\ - \ = document_model_admin_client.begin_build_document_model(\n ModelBuildMode.TEMPLATE,\ - \ blob_container_url=container_sas_url, description=\"my model description\"\n\ - \ )\n model = poller.result()\n\n print(\"Model ID: {}\".format(model.model_id))\n\ - \ print(\"Description: {}\".format(model.description))\n print(\"Model created\ - \ on: {}\\n\".format(model.created_on))\n print(\"Model expires on: {}\\n\"\ - .format(model.expires_on))\n print(\"Doc types the model can recognize:\")\n\ - \ for name, doc_type in model.doc_types.items():\n print(\"\\nDoc Type:\ - \ '{}' built with '{}' mode which has the following fields:\".format(name, doc_type.build_mode))\n\ - \ for field_name, field in doc_type.field_schema.items():\n print(\"\ - Field: '{}' has type '{}' and confidence score {}\".format(\n field_name,\ - \ field[\"type\"], doc_type.field_confidence[field_name]\n ))\n\n \ - \ ````\n" - uid: azure.ai.formrecognizer.DocumentModelAdministrationClient.begin_compose_document_model name: begin_compose_document_model summary: 'Creates a composed document model from a collection of existing models. @@ -313,46 +235,6 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Creating a composed model with existing models.\n\n\n\n````python\n\n from azure.core.credentials\ - \ import AzureKeyCredential\n from azure.ai.formrecognizer import DocumentModelAdministrationClient,\ - \ ModelBuildMode\n\n endpoint = os.environ[\"AZURE_FORM_RECOGNIZER_ENDPOINT\"\ - ]\n key = os.environ[\"AZURE_FORM_RECOGNIZER_KEY\"]\n po_supplies = os.environ['PURCHASE_ORDER_OFFICE_SUPPLIES_SAS_URL']\n\ - \ po_equipment = os.environ['PURCHASE_ORDER_OFFICE_EQUIPMENT_SAS_URL']\n po_furniture\ - \ = os.environ['PURCHASE_ORDER_OFFICE_FURNITURE_SAS_URL']\n po_cleaning_supplies\ - \ = os.environ['PURCHASE_ORDER_OFFICE_CLEANING_SUPPLIES_SAS_URL']\n\n document_model_admin_client\ - \ = DocumentModelAdministrationClient(endpoint=endpoint, credential=AzureKeyCredential(key))\n\ - \ supplies_poller = document_model_admin_client.begin_build_document_model(\n\ - \ ModelBuildMode.TEMPLATE, blob_container_url=po_supplies, description=\"\ - Purchase order-Office supplies\"\n )\n equipment_poller = document_model_admin_client.begin_build_document_model(\n\ - \ ModelBuildMode.TEMPLATE, blob_container_url=po_equipment, description=\"\ - Purchase order-Office Equipment\"\n )\n furniture_poller = document_model_admin_client.begin_build_document_model(\n\ - \ ModelBuildMode.TEMPLATE, blob_container_url=po_furniture, description=\"\ - Purchase order-Furniture\"\n )\n cleaning_supplies_poller = document_model_admin_client.begin_build_document_model(\n\ - \ ModelBuildMode.TEMPLATE, blob_container_url=po_cleaning_supplies, description=\"\ - Purchase order-Cleaning Supplies\"\n )\n supplies_model = supplies_poller.result()\n\ - \ equipment_model = equipment_poller.result()\n furniture_model = furniture_poller.result()\n\ - \ cleaning_supplies_model = cleaning_supplies_poller.result()\n\n purchase_order_models\ - \ = [\n supplies_model.model_id,\n equipment_model.model_id,\n \ - \ furniture_model.model_id,\n cleaning_supplies_model.model_id\n ]\n\ - \n poller = document_model_admin_client.begin_compose_document_model(\n \ - \ purchase_order_models, description=\"Office Supplies Composed Model\"\n \ - \ )\n model = poller.result()\n\n print(\"Office Supplies Composed Model Info:\"\ - )\n print(\"Model ID: {}\".format(model.model_id))\n print(\"Description:\ - \ {}\".format(model.description))\n print(\"Model created on: {}\\n\".format(model.created_on))\n\ - \ print(\"Model expires on: {}\\n\".format(model.expires_on))\n print(\"Doc\ - \ types the model can recognize:\")\n for name, doc_type in model.doc_types.items():\n\ - \ print(\"\\nDoc Type: '{}' which has the following fields:\".format(name))\n\ - \ for field_name, field in doc_type.field_schema.items():\n print(\"\ - Field: '{}' has type '{}' and confidence score {}\".format(\n field_name,\ - \ field[\"type\"], doc_type.field_confidence[field_name]\n ))\n\n \ - \ ````\n" - uid: azure.ai.formrecognizer.DocumentModelAdministrationClient.begin_copy_document_model_to name: begin_copy_document_model_to summary: 'Copy a document model stored in this resource (the source) to the user @@ -393,35 +275,6 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Copy a model from the source resource to the target resource\n\n\n\n````python\n\n from azure.core.credentials\ - \ import AzureKeyCredential\n from azure.ai.formrecognizer import DocumentModelAdministrationClient\n\ - \n source_endpoint = os.environ[\"AZURE_FORM_RECOGNIZER_SOURCE_ENDPOINT\"]\n\ - \ source_key = os.environ[\"AZURE_FORM_RECOGNIZER_SOURCE_KEY\"]\n target_endpoint\ - \ = os.environ[\"AZURE_FORM_RECOGNIZER_TARGET_ENDPOINT\"]\n target_key = os.environ[\"\ - AZURE_FORM_RECOGNIZER_TARGET_KEY\"]\n source_model_id = os.getenv(\"AZURE_SOURCE_MODEL_ID\"\ - , custom_model_id)\n\n target_client = DocumentModelAdministrationClient(endpoint=target_endpoint,\ - \ credential=AzureKeyCredential(target_key))\n\n target = target_client.get_copy_authorization(\n\ - \ description=\"model copied from other resource\"\n )\n\n source_client\ - \ = DocumentModelAdministrationClient(endpoint=source_endpoint, credential=AzureKeyCredential(source_key))\n\ - \ poller = source_client.begin_copy_document_model_to(\n model_id=source_model_id,\n\ - \ target=target # output from target client's call to get_copy_authorization()\n\ - \ )\n copied_over_model = poller.result()\n\n print(\"Model ID: {}\".format(copied_over_model.model_id))\n\ - \ print(\"Description: {}\".format(copied_over_model.description))\n print(\"\ - Model created on: {}\\n\".format(copied_over_model.created_on))\n print(\"Model\ - \ expires on: {}\\n\".format(copied_over_model.expires_on))\n print(\"Doc types\ - \ the model can recognize:\")\n for name, doc_type in copied_over_model.doc_types.items():\n\ - \ print(\"\\nDoc Type: '{}' which has the following fields:\".format(name))\n\ - \ for field_name, field in doc_type.field_schema.items():\n print(\"\ - Field: '{}' has type '{}' and confidence score {}\".format(\n field_name,\ - \ field[\"type\"], doc_type.field_confidence[field_name]\n ))\n\n \ - \ ````\n" - uid: azure.ai.formrecognizer.DocumentModelAdministrationClient.close name: close summary: Close the @@ -446,17 +299,6 @@ methods: exceptions: - type: azure.core.exceptions.HttpResponseError - type: azure.core.exceptions.ResourceNotFoundError - examples: - - "Delete a classifier.\n\n\n\n````python\n\ - \n document_model_admin_client.delete_document_classifier(classifier_id=my_classifier.classifier_id)\n\ - \n try:\n document_model_admin_client.get_document_classifier(classifier_id=my_classifier.classifier_id)\n\ - \ except ResourceNotFoundError:\n print(\"Successfully deleted classifier\ - \ with ID {}\".format(my_classifier.classifier_id))\n\n ````\n" - uid: azure.ai.formrecognizer.DocumentModelAdministrationClient.delete_document_model name: delete_document_model summary: Delete a custom document model. @@ -473,17 +315,6 @@ methods: exceptions: - type: azure.core.exceptions.HttpResponseError - type: azure.core.exceptions.ResourceNotFoundError - examples: - - "Delete a model.\n\ - \n\n\n````python\n\ - \n document_model_admin_client.delete_document_model(model_id=my_model.model_id)\n\ - \n try:\n document_model_admin_client.get_document_model(model_id=my_model.model_id)\n\ - \ except ResourceNotFoundError:\n print(\"Successfully deleted model with\ - \ ID {}\".format(my_model.model_id))\n\n ````\n" - uid: azure.ai.formrecognizer.DocumentModelAdministrationClient.get_copy_authorization name: get_copy_authorization summary: 'Generate authorization for copying a custom model into the target Form @@ -544,17 +375,6 @@ methods: exceptions: - type: azure.core.exceptions.HttpResponseError - type: azure.core.exceptions.ResourceNotFoundError - examples: - - "Get a classifier by its ID.\n\n\n\n````python\n\ - \n my_classifier = document_model_admin_client.get_document_classifier(classifier_id=classifier_model.classifier_id)\n\ - \ print(\"\\nClassifier ID: {}\".format(my_classifier.classifier_id))\n print(\"\ - Description: {}\".format(my_classifier.description))\n print(\"Classifier created\ - \ on: {}\".format(my_classifier.created_on))\n\n ````\n" - uid: azure.ai.formrecognizer.DocumentModelAdministrationClient.get_document_model name: get_document_model summary: Get a document model by its ID. @@ -572,17 +392,6 @@ methods: exceptions: - type: azure.core.exceptions.HttpResponseError - type: azure.core.exceptions.ResourceNotFoundError - examples: - - "Get a model by its ID.\n\n\n\n````python\n\ - \n my_model = document_model_admin_client.get_document_model(model_id=model.model_id)\n\ - \ print(\"\\nModel ID: {}\".format(my_model.model_id))\n print(\"Description:\ - \ {}\".format(my_model.description))\n print(\"Model created on: {}\".format(my_model.created_on))\n\ - \ print(\"Model expires on: {}\".format(my_model.expires_on))\n\n ````\n" - uid: azure.ai.formrecognizer.DocumentModelAdministrationClient.get_operation name: get_operation summary: 'Get an operation by its ID. @@ -609,27 +418,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Get a document model operation by its ID.\n\n\n\n````python\n\n # Get an operation by ID\n \ - \ if operations:\n print(\"\\nGetting operation info by ID: {}\".format(operations[0].operation_id))\n\ - \ operation_info = document_model_admin_client.get_operation(operations[0].operation_id)\n\ - \ if operation_info.status == \"succeeded\":\n print(\"My {} operation\ - \ is completed.\".format(operation_info.kind))\n result = operation_info.result\n\ - \ if result is not None:\n if operation_info.kind == \"\ - documentClassifierBuild\":\n print(f\"Classifier ID: {result.classifier_id}\"\ - )\n else:\n print(\"Model ID: {}\".format(result.model_id))\n\ - \ elif operation_info.status == \"failed\":\n print(\"My {} operation\ - \ failed.\".format(operation_info.kind))\n error = operation_info.error\n\ - \ if error is not None:\n print(\"{}: {}\".format(error.code,\ - \ error.message))\n else:\n print(\"My operation status is {}\"\ - .format(operation_info.status))\n else:\n print(\"No operations found.\"\ - )\n\n ````\n" - uid: azure.ai.formrecognizer.DocumentModelAdministrationClient.get_resource_details name: get_resource_details summary: Get information about the models under the Form Recognizer resource. @@ -640,22 +428,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Get model counts and limits under the Form Recognizer resource.\n\n\n\n````python\n\n document_model_admin_client\ - \ = DocumentModelAdministrationClient(endpoint=endpoint, credential=AzureKeyCredential(key))\n\ - \n account_details = document_model_admin_client.get_resource_details()\n \ - \ print(\"Our resource has {} custom models, and we can have at most {} custom\ - \ models\".format(\n account_details.custom_document_models.count, account_details.custom_document_models.limit\n\ - \ ))\n neural_models = account_details.custom_neural_document_model_builds\n\ - \ print(f\"The quota limit for custom neural document models is {neural_models.quota}\ - \ and the resource has\"\n f\"used {neural_models.used}. The resource\ - \ quota will reset on {neural_models.quota_resets_on}\")\n\n ````\n" - uid: azure.ai.formrecognizer.DocumentModelAdministrationClient.list_document_classifiers name: list_document_classifiers summary: 'List information for each document classifier, including its classifier @@ -672,17 +444,6 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "List all classifiers that were built successfully under the Form Recognizer resource.\n\n\n\n````python\n\n classifiers = document_model_admin_client.list_document_classifiers()\n\ - \n print(\"We have the following 'ready' models with IDs and descriptions:\"\ - )\n for classifier in classifiers:\n print(\"{} | {}\".format(classifier.classifier_id,\ - \ classifier.description))\n\n ````\n" - uid: azure.ai.formrecognizer.DocumentModelAdministrationClient.list_document_models name: list_document_models summary: 'List information for each model, including its model ID, @@ -695,17 +456,6 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "List all models that were built successfully under the Form Recognizer resource.\n\n\n\n````python\n\n models = document_model_admin_client.list_document_models()\n\ - \n print(\"We have the following 'ready' models with IDs and descriptions:\"\ - )\n for model in models:\n print(\"{} | {}\".format(model.model_id, model.description))\n\ - \n ````\n" - uid: azure.ai.formrecognizer.DocumentModelAdministrationClient.list_operations name: list_operations summary: 'List information for each operation. @@ -726,24 +476,3 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "List all document model operations in the past 24 hours.\n\n\n\n````python\n\n from azure.core.credentials\ - \ import AzureKeyCredential\n from azure.ai.formrecognizer import DocumentModelAdministrationClient\n\ - \n endpoint = os.environ[\"AZURE_FORM_RECOGNIZER_ENDPOINT\"]\n key = os.environ[\"\ - AZURE_FORM_RECOGNIZER_KEY\"]\n\n document_model_admin_client = DocumentModelAdministrationClient(endpoint=endpoint,\ - \ credential=AzureKeyCredential(key))\n\n operations = list(document_model_admin_client.list_operations())\n\ - \n print(\"The following document model operations exist under my resource:\"\ - )\n for operation in operations:\n print(\"\\nOperation ID: {}\".format(operation.operation_id))\n\ - \ print(\"Operation kind: {}\".format(operation.kind))\n print(\"\ - Operation status: {}\".format(operation.status))\n print(\"Operation percent\ - \ completed: {}\".format(operation.percent_completed))\n print(\"Operation\ - \ created on: {}\".format(operation.created_on))\n print(\"Operation last\ - \ updated on: {}\".format(operation.last_updated_on))\n print(\"Resource\ - \ location of successful operation: {}\".format(operation.resource_location))\n\ - \n ````\n" diff --git a/preview/docs-ref-autogen/azure-ai-formrecognizer/azure.ai.formrecognizer.FormRecognizerClient.yml b/preview/docs-ref-autogen/azure-ai-formrecognizer/azure.ai.formrecognizer.FormRecognizerClient.yml index 4a0f5347bae1..602f2d38f943 100644 --- a/preview/docs-ref-autogen/azure-ai-formrecognizer/azure.ai.formrecognizer.FormRecognizerClient.yml +++ b/preview/docs-ref-autogen/azure-ai-formrecognizer/azure.ai.formrecognizer.FormRecognizerClient.yml @@ -61,29 +61,6 @@ constructor: types: - - -examples: -- "Creating the FormRecognizerClient with an endpoint and API key.\n\n\n\n````python\n\n from azure.core.credentials import\ - \ AzureKeyCredential\n from azure.ai.formrecognizer import FormRecognizerClient\n\ - \ endpoint = os.environ[\"AZURE_FORM_RECOGNIZER_ENDPOINT\"]\n key = os.environ[\"\ - AZURE_FORM_RECOGNIZER_KEY\"]\n\n form_recognizer_client = FormRecognizerClient(endpoint,\ - \ AzureKeyCredential(key))\n\n ````\n\nCreating the FormRecognizerClient with\ - \ a token credential.\n\n\n\n````python\n\n \"\"\"DefaultAzureCredential\ - \ will use the values from these environment\n variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,\ - \ AZURE_CLIENT_SECRET\n \"\"\"\n from azure.ai.formrecognizer import FormRecognizerClient\n\ - \ from azure.identity import DefaultAzureCredential\n\n endpoint = os.environ[\"\ - AZURE_FORM_RECOGNIZER_ENDPOINT\"]\n credential = DefaultAzureCredential()\n\n\ - \ form_recognizer_client = FormRecognizerClient(endpoint, credential)\n\n ````\n" methods: - uid: azure.ai.formrecognizer.FormRecognizerClient.begin_recognize_business_cards name: begin_recognize_business_cards @@ -154,57 +131,6 @@ methods: - [[]] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Recognize business cards from a file.\n\n\n\n````python\n\ - \n from azure.core.credentials import AzureKeyCredential\n from azure.ai.formrecognizer\ - \ import FormRecognizerClient\n\n endpoint = os.environ[\"AZURE_FORM_RECOGNIZER_ENDPOINT\"\ - ]\n key = os.environ[\"AZURE_FORM_RECOGNIZER_KEY\"]\n\n form_recognizer_client\ - \ = FormRecognizerClient(\n endpoint=endpoint, credential=AzureKeyCredential(key)\n\ - \ )\n with open(path_to_sample_forms, \"rb\") as f:\n poller = form_recognizer_client.begin_recognize_business_cards(business_card=f,\ - \ locale=\"en-US\")\n business_cards = poller.result()\n\n for idx, business_card\ - \ in enumerate(business_cards):\n print(\"--------Recognizing business card\ - \ #{}--------\".format(idx+1))\n contact_names = business_card.fields.get(\"\ - ContactNames\")\n if contact_names:\n for contact_name in contact_names.value:\n\ - \ print(\"Contact First Name: {} has confidence: {}\".format(\n\ - \ contact_name.value[\"FirstName\"].value, contact_name.value[\"\ - FirstName\"].confidence\n ))\n print(\"Contact Last\ - \ Name: {} has confidence: {}\".format(\n contact_name.value[\"\ - LastName\"].value, contact_name.value[\"LastName\"].confidence\n \ - \ ))\n company_names = business_card.fields.get(\"CompanyNames\")\n \ - \ if company_names:\n for company_name in company_names.value:\n\ - \ print(\"Company Name: {} has confidence: {}\".format(company_name.value,\ - \ company_name.confidence))\n departments = business_card.fields.get(\"\ - Departments\")\n if departments:\n for department in departments.value:\n\ - \ print(\"Department: {} has confidence: {}\".format(department.value,\ - \ department.confidence))\n job_titles = business_card.fields.get(\"JobTitles\"\ - )\n if job_titles:\n for job_title in job_titles.value:\n \ - \ print(\"Job Title: {} has confidence: {}\".format(job_title.value,\ - \ job_title.confidence))\n emails = business_card.fields.get(\"Emails\"\ - )\n if emails:\n for email in emails.value:\n print(\"\ - Email: {} has confidence: {}\".format(email.value, email.confidence))\n \ - \ websites = business_card.fields.get(\"Websites\")\n if websites:\n \ - \ for website in websites.value:\n print(\"Website: {} has\ - \ confidence: {}\".format(website.value, website.confidence))\n addresses\ - \ = business_card.fields.get(\"Addresses\")\n if addresses:\n \ - \ for address in addresses.value:\n print(\"Address: {} has confidence:\ - \ {}\".format(address.value, address.confidence))\n mobile_phones = business_card.fields.get(\"\ - MobilePhones\")\n if mobile_phones:\n for phone in mobile_phones.value:\n\ - \ print(\"Mobile phone number: {} has confidence: {}\".format(phone.value,\ - \ phone.confidence))\n faxes = business_card.fields.get(\"Faxes\")\n \ - \ if faxes:\n for fax in faxes.value:\n print(\"Fax\ - \ number: {} has confidence: {}\".format(fax.value, fax.confidence))\n work_phones\ - \ = business_card.fields.get(\"WorkPhones\")\n if work_phones:\n \ - \ for work_phone in work_phones.value:\n print(\"Work phone number:\ - \ {} has confidence: {}\".format(work_phone.value, work_phone.confidence))\n \ - \ other_phones = business_card.fields.get(\"OtherPhones\")\n if other_phones:\n\ - \ for other_phone in other_phones.value:\n print(\"Other\ - \ phone number: {} has confidence: {}\".format(other_phone.value, other_phone.confidence))\n\ - \n ````\n" - uid: azure.ai.formrecognizer.FormRecognizerClient.begin_recognize_business_cards_from_url name: begin_recognize_business_cards_from_url summary: 'Extract field text and semantic values from a given business card. @@ -343,44 +269,6 @@ methods: - [[]] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Recognize text and content/layout information from a form.\n\n\n\n````python\n\n from azure.core.credentials\ - \ import AzureKeyCredential\n from azure.ai.formrecognizer import FormRecognizerClient\n\ - \n endpoint = os.environ[\"AZURE_FORM_RECOGNIZER_ENDPOINT\"]\n key = os.environ[\"\ - AZURE_FORM_RECOGNIZER_KEY\"]\n\n form_recognizer_client = FormRecognizerClient(endpoint=endpoint,\ - \ credential=AzureKeyCredential(key))\n with open(path_to_sample_forms, \"rb\"\ - ) as f:\n poller = form_recognizer_client.begin_recognize_content(form=f)\n\ - \ form_pages = poller.result()\n\n for idx, content in enumerate(form_pages):\n\ - \ print(\"----Recognizing content from page #{}----\".format(idx+1))\n \ - \ print(\"Page has width: {} and height: {}, measured with unit: {}\".format(\n\ - \ content.width,\n content.height,\n content.unit\n\ - \ ))\n for table_idx, table in enumerate(content.tables):\n \ - \ print(\"Table # {} has {} rows and {} columns\".format(table_idx, table.row_count,\ - \ table.column_count))\n print(\"Table # {} location on page: {}\".format(table_idx,\ - \ format_bounding_box(table.bounding_box)))\n for cell in table.cells:\n\ - \ print(\"...Cell[{}][{}] has text '{}' within bounding box '{}'\"\ - .format(\n cell.row_index,\n cell.column_index,\n\ - \ cell.text,\n format_bounding_box(cell.bounding_box)\n\ - \ ))\n\n for line_idx, line in enumerate(content.lines):\n\ - \ print(\"Line # {} has word count '{}' and text '{}' within bounding\ - \ box '{}'\".format(\n line_idx,\n len(line.words),\n\ - \ line.text,\n format_bounding_box(line.bounding_box)\n\ - \ ))\n if line.appearance:\n if line.appearance.style_name\ - \ == \"handwriting\" and line.appearance.style_confidence > 0.8:\n \ - \ print(\"Text line '{}' is handwritten and might be a signature.\".format(line.text))\n\ - \ for word in line.words:\n print(\"...Word '{}' has a\ - \ confidence of {}\".format(word.text, word.confidence))\n\n for selection_mark\ - \ in content.selection_marks:\n print(\"Selection mark is '{}' within\ - \ bounding box '{}' and has a confidence of {}\".format(\n selection_mark.state,\n\ - \ format_bounding_box(selection_mark.bounding_box),\n \ - \ selection_mark.confidence\n ))\n print(\"----------------------------------------\"\ - )\n\n\n ````\n" - uid: azure.ai.formrecognizer.FormRecognizerClient.begin_recognize_content_from_url name: begin_recognize_content_from_url summary: 'Extract text and layout information from a given document. @@ -513,53 +401,6 @@ methods: - [[]] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Recognize fields and values from a custom form.\n\n\n\n````python\n\n from azure.core.credentials\ - \ import AzureKeyCredential\n from azure.ai.formrecognizer import FormRecognizerClient\n\ - \n endpoint = os.environ[\"AZURE_FORM_RECOGNIZER_ENDPOINT\"]\n key = os.environ[\"\ - AZURE_FORM_RECOGNIZER_KEY\"]\n model_id = os.getenv(\"CUSTOM_TRAINED_MODEL_ID\"\ - , custom_model_id)\n\n form_recognizer_client = FormRecognizerClient(\n \ - \ endpoint=endpoint, credential=AzureKeyCredential(key)\n )\n\n # Make sure\ - \ your form's type is included in the list of form types the custom model can\ - \ recognize\n with open(path_to_sample_forms, \"rb\") as f:\n poller =\ - \ form_recognizer_client.begin_recognize_custom_forms(\n model_id=model_id,\ - \ form=f, include_field_elements=True\n )\n forms = poller.result()\n\n\ - \ for idx, form in enumerate(forms):\n print(\"--------Recognizing Form\ - \ #{}--------\".format(idx+1))\n print(\"Form has type {}\".format(form.form_type))\n\ - \ print(\"Form has form type confidence {}\".format(form.form_type_confidence))\n\ - \ print(\"Form was analyzed with model with ID {}\".format(form.model_id))\n\ - \ for name, field in form.fields.items():\n # each field is of\ - \ type FormField\n # label_data is populated if you are using a model\ - \ trained without labels,\n # since the service needs to make predictions\ - \ for labels if not explicitly given to it.\n if field.label_data:\n\ - \ print(\"...Field '{}' has label '{}' with a confidence score of\ - \ {}\".format(\n name,\n field.label_data.text,\n\ - \ field.confidence\n ))\n\n print(\"\ - ...Label '{}' has value '{}' with a confidence score of {}\".format(\n \ - \ field.label_data.text if field.label_data else name, field.value, field.confidence\n\ - \ ))\n\n # iterate over tables, lines, and selection marks on\ - \ each page\n for page in form.pages:\n for i, table in enumerate(page.tables):\n\ - \ print(\"\\nTable {} on page {}\".format(i+1, table.page_number))\n\ - \ for cell in table.cells:\n print(\"...Cell[{}][{}]\ - \ has text '{}' with confidence {}\".format(\n cell.row_index,\ - \ cell.column_index, cell.text, cell.confidence\n ))\n \ - \ print(\"\\nLines found on page {}\".format(page.page_number))\n \ - \ for line in page.lines:\n print(\"...Line '{}' is made up of\ - \ the following words: \".format(line.text))\n for word in line.words:\n\ - \ print(\"......Word '{}' has a confidence of {}\".format(\n\ - \ word.text,\n word.confidence\n \ - \ ))\n if page.selection_marks:\n print(\"\ - \\nSelection marks found on page {}\".format(page.page_number))\n \ - \ for selection_mark in page.selection_marks:\n print(\"......Selection\ - \ mark is '{}' and has a confidence of {}\".format(\n selection_mark.state,\n\ - \ selection_mark.confidence\n ))\n\n \ - \ print(\"-----------------------------------\")\n\n ````\n" - uid: azure.ai.formrecognizer.FormRecognizerClient.begin_recognize_custom_forms_from_url name: begin_recognize_custom_forms_from_url summary: 'Analyze a custom form with a model trained with or without labels. The @@ -676,40 +517,6 @@ methods: - [[]] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Recognize identity document fields.\n\n\n\n````python\n\ - \n from azure.core.credentials import AzureKeyCredential\n from azure.ai.formrecognizer\ - \ import FormRecognizerClient\n\n endpoint = os.environ[\"AZURE_FORM_RECOGNIZER_ENDPOINT\"\ - ]\n key = os.environ[\"AZURE_FORM_RECOGNIZER_KEY\"]\n\n form_recognizer_client\ - \ = FormRecognizerClient(\n endpoint=endpoint, credential=AzureKeyCredential(key)\n\ - \ )\n with open(path_to_sample_forms, \"rb\") as f:\n poller = form_recognizer_client.begin_recognize_identity_documents(identity_document=f)\n\ - \ id_documents = poller.result()\n\n for idx, id_document in enumerate(id_documents):\n\ - \ print(\"--------Recognizing ID document #{}--------\".format(idx+1))\n\ - \ first_name = id_document.fields.get(\"FirstName\")\n if first_name:\n\ - \ print(\"First Name: {} has confidence: {}\".format(first_name.value,\ - \ first_name.confidence))\n last_name = id_document.fields.get(\"LastName\"\ - )\n if last_name:\n print(\"Last Name: {} has confidence: {}\"\ - .format(last_name.value, last_name.confidence))\n document_number = id_document.fields.get(\"\ - DocumentNumber\")\n if document_number:\n print(\"Document Number:\ - \ {} has confidence: {}\".format(document_number.value, document_number.confidence))\n\ - \ dob = id_document.fields.get(\"DateOfBirth\")\n if dob:\n \ - \ print(\"Date of Birth: {} has confidence: {}\".format(dob.value, dob.confidence))\n\ - \ doe = id_document.fields.get(\"DateOfExpiration\")\n if doe:\n \ - \ print(\"Date of Expiration: {} has confidence: {}\".format(doe.value,\ - \ doe.confidence))\n sex = id_document.fields.get(\"Sex\")\n if sex:\n\ - \ print(\"Sex: {} has confidence: {}\".format(sex.value, sex.confidence))\n\ - \ address = id_document.fields.get(\"Address\")\n if address:\n \ - \ print(\"Address: {} has confidence: {}\".format(address.value, address.confidence))\n\ - \ country_region = id_document.fields.get(\"CountryRegion\")\n if\ - \ country_region:\n print(\"Country/Region: {} has confidence: {}\"\ - .format(country_region.value, country_region.confidence))\n region = id_document.fields.get(\"\ - Region\")\n if region:\n print(\"Region: {} has confidence: {}\"\ - .format(region.value, region.confidence))\n\n ````\n" - uid: azure.ai.formrecognizer.FormRecognizerClient.begin_recognize_identity_documents_from_url name: begin_recognize_identity_documents_from_url summary: 'Extract field text and semantic values from a given identity document. @@ -830,108 +637,6 @@ methods: - [[]] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Recognize invoices from a file.\n\n\n\n````python\n\ - \n from azure.core.credentials import AzureKeyCredential\n from azure.ai.formrecognizer\ - \ import FormRecognizerClient\n\n endpoint = os.environ[\"AZURE_FORM_RECOGNIZER_ENDPOINT\"\ - ]\n key = os.environ[\"AZURE_FORM_RECOGNIZER_KEY\"]\n\n form_recognizer_client\ - \ = FormRecognizerClient(\n endpoint=endpoint, credential=AzureKeyCredential(key)\n\ - \ )\n with open(path_to_sample_forms, \"rb\") as f:\n poller = form_recognizer_client.begin_recognize_invoices(invoice=f,\ - \ locale=\"en-US\")\n invoices = poller.result()\n\n for idx, invoice in enumerate(invoices):\n\ - \ print(\"--------Recognizing invoice #{}--------\".format(idx+1))\n \ - \ vendor_name = invoice.fields.get(\"VendorName\")\n if vendor_name:\n\ - \ print(\"Vendor Name: {} has confidence: {}\".format(vendor_name.value,\ - \ vendor_name.confidence))\n vendor_address = invoice.fields.get(\"VendorAddress\"\ - )\n if vendor_address:\n print(\"Vendor Address: {} has confidence:\ - \ {}\".format(vendor_address.value, vendor_address.confidence))\n vendor_address_recipient\ - \ = invoice.fields.get(\"VendorAddressRecipient\")\n if vendor_address_recipient:\n\ - \ print(\"Vendor Address Recipient: {} has confidence: {}\".format(vendor_address_recipient.value,\ - \ vendor_address_recipient.confidence))\n customer_name = invoice.fields.get(\"\ - CustomerName\")\n if customer_name:\n print(\"Customer Name: {}\ - \ has confidence: {}\".format(customer_name.value, customer_name.confidence))\n\ - \ customer_id = invoice.fields.get(\"CustomerId\")\n if customer_id:\n\ - \ print(\"Customer Id: {} has confidence: {}\".format(customer_id.value,\ - \ customer_id.confidence))\n customer_address = invoice.fields.get(\"CustomerAddress\"\ - )\n if customer_address:\n print(\"Customer Address: {} has confidence:\ - \ {}\".format(customer_address.value, customer_address.confidence))\n customer_address_recipient\ - \ = invoice.fields.get(\"CustomerAddressRecipient\")\n if customer_address_recipient:\n\ - \ print(\"Customer Address Recipient: {} has confidence: {}\".format(customer_address_recipient.value,\ - \ customer_address_recipient.confidence))\n invoice_id = invoice.fields.get(\"\ - InvoiceId\")\n if invoice_id:\n print(\"Invoice Id: {} has confidence:\ - \ {}\".format(invoice_id.value, invoice_id.confidence))\n invoice_date =\ - \ invoice.fields.get(\"InvoiceDate\")\n if invoice_date:\n print(\"\ - Invoice Date: {} has confidence: {}\".format(invoice_date.value, invoice_date.confidence))\n\ - \ invoice_total = invoice.fields.get(\"InvoiceTotal\")\n if invoice_total:\n\ - \ print(\"Invoice Total: {} has confidence: {}\".format(invoice_total.value,\ - \ invoice_total.confidence))\n due_date = invoice.fields.get(\"DueDate\"\ - )\n if due_date:\n print(\"Due Date: {} has confidence: {}\".format(due_date.value,\ - \ due_date.confidence))\n purchase_order = invoice.fields.get(\"PurchaseOrder\"\ - )\n if purchase_order:\n print(\"Purchase Order: {} has confidence:\ - \ {}\".format(purchase_order.value, purchase_order.confidence))\n billing_address\ - \ = invoice.fields.get(\"BillingAddress\")\n if billing_address:\n \ - \ print(\"Billing Address: {} has confidence: {}\".format(billing_address.value,\ - \ billing_address.confidence))\n billing_address_recipient = invoice.fields.get(\"\ - BillingAddressRecipient\")\n if billing_address_recipient:\n print(\"\ - Billing Address Recipient: {} has confidence: {}\".format(billing_address_recipient.value,\ - \ billing_address_recipient.confidence))\n shipping_address = invoice.fields.get(\"\ - ShippingAddress\")\n if shipping_address:\n print(\"Shipping Address:\ - \ {} has confidence: {}\".format(shipping_address.value, shipping_address.confidence))\n\ - \ shipping_address_recipient = invoice.fields.get(\"ShippingAddressRecipient\"\ - )\n if shipping_address_recipient:\n print(\"Shipping Address\ - \ Recipient: {} has confidence: {}\".format(shipping_address_recipient.value,\ - \ shipping_address_recipient.confidence))\n print(\"Invoice items:\")\n\ - \ for idx, item in enumerate(invoice.fields.get(\"Items\").value):\n \ - \ print(\"...Item #{}\".format(idx+1))\n item_description = item.value.get(\"\ - Description\")\n if item_description:\n print(\"......Description:\ - \ {} has confidence: {}\".format(item_description.value, item_description.confidence))\n\ - \ item_quantity = item.value.get(\"Quantity\")\n if item_quantity:\n\ - \ print(\"......Quantity: {} has confidence: {}\".format(item_quantity.value,\ - \ item_quantity.confidence))\n unit = item.value.get(\"Unit\")\n \ - \ if unit:\n print(\"......Unit: {} has confidence: {}\"\ - .format(unit.value, unit.confidence))\n unit_price = item.value.get(\"\ - UnitPrice\")\n if unit_price:\n print(\"......Unit Price:\ - \ {} has confidence: {}\".format(unit_price.value, unit_price.confidence))\n \ - \ product_code = item.value.get(\"ProductCode\")\n if product_code:\n\ - \ print(\"......Product Code: {} has confidence: {}\".format(product_code.value,\ - \ product_code.confidence))\n item_date = item.value.get(\"Date\")\n\ - \ if item_date:\n print(\"......Date: {} has confidence:\ - \ {}\".format(item_date.value, item_date.confidence))\n tax = item.value.get(\"\ - Tax\")\n if tax:\n print(\"......Tax: {} has confidence:\ - \ {}\".format(tax.value, tax.confidence))\n amount = item.value.get(\"\ - Amount\")\n if amount:\n print(\"......Amount: {} has\ - \ confidence: {}\".format(amount.value, amount.confidence))\n subtotal =\ - \ invoice.fields.get(\"SubTotal\")\n if subtotal:\n print(\"Subtotal:\ - \ {} has confidence: {}\".format(subtotal.value, subtotal.confidence))\n \ - \ total_tax = invoice.fields.get(\"TotalTax\")\n if total_tax:\n \ - \ print(\"Total Tax: {} has confidence: {}\".format(total_tax.value, total_tax.confidence))\n\ - \ previous_unpaid_balance = invoice.fields.get(\"PreviousUnpaidBalance\"\ - )\n if previous_unpaid_balance:\n print(\"Previous Unpaid Balance:\ - \ {} has confidence: {}\".format(previous_unpaid_balance.value, previous_unpaid_balance.confidence))\n\ - \ amount_due = invoice.fields.get(\"AmountDue\")\n if amount_due:\n\ - \ print(\"Amount Due: {} has confidence: {}\".format(amount_due.value,\ - \ amount_due.confidence))\n service_start_date = invoice.fields.get(\"ServiceStartDate\"\ - )\n if service_start_date:\n print(\"Service Start Date: {} has\ - \ confidence: {}\".format(service_start_date.value, service_start_date.confidence))\n\ - \ service_end_date = invoice.fields.get(\"ServiceEndDate\")\n if service_end_date:\n\ - \ print(\"Service End Date: {} has confidence: {}\".format(service_end_date.value,\ - \ service_end_date.confidence))\n service_address = invoice.fields.get(\"\ - ServiceAddress\")\n if service_address:\n print(\"Service Address:\ - \ {} has confidence: {}\".format(service_address.value, service_address.confidence))\n\ - \ service_address_recipient = invoice.fields.get(\"ServiceAddressRecipient\"\ - )\n if service_address_recipient:\n print(\"Service Address Recipient:\ - \ {} has confidence: {}\".format(service_address_recipient.value, service_address_recipient.confidence))\n\ - \ remittance_address = invoice.fields.get(\"RemittanceAddress\")\n \ - \ if remittance_address:\n print(\"Remittance Address: {} has confidence:\ - \ {}\".format(remittance_address.value, remittance_address.confidence))\n \ - \ remittance_address_recipient = invoice.fields.get(\"RemittanceAddressRecipient\"\ - )\n if remittance_address_recipient:\n print(\"Remittance Address\ - \ Recipient: {} has confidence: {}\".format(remittance_address_recipient.value,\ - \ remittance_address_recipient.confidence))\n\n ````\n" - uid: azure.ai.formrecognizer.FormRecognizerClient.begin_recognize_invoices_from_url name: begin_recognize_invoices_from_url summary: 'Extract field text and semantic values from a given invoice. @@ -1059,49 +764,6 @@ methods: - [[]] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Recognize sales receipt fields.\n\n\n\n````python\n\ - \n from azure.core.credentials import AzureKeyCredential\n from azure.ai.formrecognizer\ - \ import FormRecognizerClient\n\n endpoint = os.environ[\"AZURE_FORM_RECOGNIZER_ENDPOINT\"\ - ]\n key = os.environ[\"AZURE_FORM_RECOGNIZER_KEY\"]\n\n form_recognizer_client\ - \ = FormRecognizerClient(\n endpoint=endpoint, credential=AzureKeyCredential(key)\n\ - \ )\n with open(path_to_sample_forms, \"rb\") as f:\n poller = form_recognizer_client.begin_recognize_receipts(receipt=f,\ - \ locale=\"en-US\")\n receipts = poller.result()\n\n for idx, receipt in enumerate(receipts):\n\ - \ print(\"--------Recognizing receipt #{}--------\".format(idx+1))\n \ - \ receipt_type = receipt.fields.get(\"ReceiptType\")\n if receipt_type:\n\ - \ print(\"Receipt Type: {} has confidence: {}\".format(receipt_type.value,\ - \ receipt_type.confidence))\n merchant_name = receipt.fields.get(\"MerchantName\"\ - )\n if merchant_name:\n print(\"Merchant Name: {} has confidence:\ - \ {}\".format(merchant_name.value, merchant_name.confidence))\n transaction_date\ - \ = receipt.fields.get(\"TransactionDate\")\n if transaction_date:\n \ - \ print(\"Transaction Date: {} has confidence: {}\".format(transaction_date.value,\ - \ transaction_date.confidence))\n if receipt.fields.get(\"Items\"):\n \ - \ print(\"Receipt items:\")\n for idx, item in enumerate(receipt.fields.get(\"\ - Items\").value):\n print(\"...Item #{}\".format(idx+1))\n \ - \ item_name = item.value.get(\"Name\")\n if item_name:\n\ - \ print(\"......Item Name: {} has confidence: {}\".format(item_name.value,\ - \ item_name.confidence))\n item_quantity = item.value.get(\"Quantity\"\ - )\n if item_quantity:\n print(\"......Item Quantity:\ - \ {} has confidence: {}\".format(item_quantity.value, item_quantity.confidence))\n\ - \ item_price = item.value.get(\"Price\")\n if item_price:\n\ - \ print(\"......Individual Item Price: {} has confidence: {}\"\ - .format(item_price.value, item_price.confidence))\n item_total_price\ - \ = item.value.get(\"TotalPrice\")\n if item_total_price:\n \ - \ print(\"......Total Item Price: {} has confidence: {}\".format(item_total_price.value,\ - \ item_total_price.confidence))\n subtotal = receipt.fields.get(\"Subtotal\"\ - )\n if subtotal:\n print(\"Subtotal: {} has confidence: {}\".format(subtotal.value,\ - \ subtotal.confidence))\n tax = receipt.fields.get(\"Tax\")\n if tax:\n\ - \ print(\"Tax: {} has confidence: {}\".format(tax.value, tax.confidence))\n\ - \ tip = receipt.fields.get(\"Tip\")\n if tip:\n print(\"\ - Tip: {} has confidence: {}\".format(tip.value, tip.confidence))\n total\ - \ = receipt.fields.get(\"Total\")\n if total:\n print(\"Total:\ - \ {} has confidence: {}\".format(total.value, total.confidence))\n print(\"\ - --------------------------------------\")\n\n ````\n" - uid: azure.ai.formrecognizer.FormRecognizerClient.begin_recognize_receipts_from_url name: begin_recognize_receipts_from_url summary: 'Extract field text and semantic values from a given sales receipt. @@ -1163,51 +825,6 @@ methods: - [[]] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Recognize sales receipt fields from a URL.\n\n\n\n````python\n\n from azure.core.credentials\ - \ import AzureKeyCredential\n from azure.ai.formrecognizer import FormRecognizerClient\n\ - \n endpoint = os.environ[\"AZURE_FORM_RECOGNIZER_ENDPOINT\"]\n key = os.environ[\"\ - AZURE_FORM_RECOGNIZER_KEY\"]\n\n form_recognizer_client = FormRecognizerClient(\n\ - \ endpoint=endpoint, credential=AzureKeyCredential(key)\n )\n url =\ - \ \"https://raw.githubusercontent.com/Azure/azure-sdk-for-python/main/sdk/formrecognizer/azure-ai-formrecognizer/tests/sample_forms/receipt/contoso-receipt.png\"\ - \n poller = form_recognizer_client.begin_recognize_receipts_from_url(receipt_url=url)\n\ - \ receipts = poller.result()\n\n for idx, receipt in enumerate(receipts):\n\ - \ print(\"--------Recognizing receipt #{}--------\".format(idx+1))\n \ - \ receipt_type = receipt.fields.get(\"ReceiptType\")\n if receipt_type:\n\ - \ print(\"Receipt Type: {} has confidence: {}\".format(receipt_type.value,\ - \ receipt_type.confidence))\n merchant_name = receipt.fields.get(\"MerchantName\"\ - )\n if merchant_name:\n print(\"Merchant Name: {} has confidence:\ - \ {}\".format(merchant_name.value, merchant_name.confidence))\n transaction_date\ - \ = receipt.fields.get(\"TransactionDate\")\n if transaction_date:\n \ - \ print(\"Transaction Date: {} has confidence: {}\".format(transaction_date.value,\ - \ transaction_date.confidence))\n if receipt.fields.get(\"Items\"):\n \ - \ print(\"Receipt items:\")\n for idx, item in enumerate(receipt.fields.get(\"\ - Items\").value):\n print(\"...Item #{}\".format(idx+1))\n \ - \ item_name = item.value.get(\"Name\")\n if item_name:\n\ - \ print(\"......Item Name: {} has confidence: {}\".format(item_name.value,\ - \ item_name.confidence))\n item_quantity = item.value.get(\"Quantity\"\ - )\n if item_quantity:\n print(\"......Item Quantity:\ - \ {} has confidence: {}\".format(item_quantity.value, item_quantity.confidence))\n\ - \ item_price = item.value.get(\"Price\")\n if item_price:\n\ - \ print(\"......Individual Item Price: {} has confidence: {}\"\ - .format(item_price.value, item_price.confidence))\n item_total_price\ - \ = item.value.get(\"TotalPrice\")\n if item_total_price:\n \ - \ print(\"......Total Item Price: {} has confidence: {}\".format(item_total_price.value,\ - \ item_total_price.confidence))\n subtotal = receipt.fields.get(\"Subtotal\"\ - )\n if subtotal:\n print(\"Subtotal: {} has confidence: {}\".format(subtotal.value,\ - \ subtotal.confidence))\n tax = receipt.fields.get(\"Tax\")\n if tax:\n\ - \ print(\"Tax: {} has confidence: {}\".format(tax.value, tax.confidence))\n\ - \ tip = receipt.fields.get(\"Tip\")\n if tip:\n print(\"\ - Tip: {} has confidence: {}\".format(tip.value, tip.confidence))\n total\ - \ = receipt.fields.get(\"Total\")\n if total:\n print(\"Total:\ - \ {} has confidence: {}\".format(total.value, total.confidence))\n print(\"\ - --------------------------------------\")\n\n ````\n" - uid: azure.ai.formrecognizer.FormRecognizerClient.close name: close summary: Close the session. diff --git a/preview/docs-ref-autogen/azure-ai-formrecognizer/azure.ai.formrecognizer.FormTrainingClient.yml b/preview/docs-ref-autogen/azure-ai-formrecognizer/azure.ai.formrecognizer.FormTrainingClient.yml index 8ee6ee95a179..8b96f6e04fca 100644 --- a/preview/docs-ref-autogen/azure-ai-formrecognizer/azure.ai.formrecognizer.FormTrainingClient.yml +++ b/preview/docs-ref-autogen/azure-ai-formrecognizer/azure.ai.formrecognizer.FormTrainingClient.yml @@ -58,29 +58,6 @@ constructor: types: - - -examples: -- "Creating the FormTrainingClient with an endpoint and API key.\n\n\n\n````python\n\n from azure.core.credentials import\ - \ AzureKeyCredential\n from azure.ai.formrecognizer import FormTrainingClient\n\ - \ endpoint = os.environ[\"AZURE_FORM_RECOGNIZER_ENDPOINT\"]\n key = os.environ[\"\ - AZURE_FORM_RECOGNIZER_KEY\"]\n\n form_training_client = FormTrainingClient(endpoint,\ - \ AzureKeyCredential(key))\n\n ````\n\nCreating the FormTrainingClient with a\ - \ token credential.\n\n\n\n````python\n\n \"\"\"DefaultAzureCredential\ - \ will use the values from these environment\n variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,\ - \ AZURE_CLIENT_SECRET\n \"\"\"\n from azure.ai.formrecognizer import FormTrainingClient\n\ - \ from azure.identity import DefaultAzureCredential\n\n endpoint = os.environ[\"\ - AZURE_FORM_RECOGNIZER_ENDPOINT\"]\n credential = DefaultAzureCredential()\n\n\ - \ form_training_client = FormTrainingClient(endpoint, credential)\n\n ````\n" methods: - uid: azure.ai.formrecognizer.FormTrainingClient.begin_copy_model name: begin_copy_model @@ -122,19 +99,6 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Copy a model from the source resource to the target resource\n\n\n\n````python\n\n source_client = FormTrainingClient(endpoint=source_endpoint,\ - \ credential=AzureKeyCredential(source_key))\n\n poller = source_client.begin_copy_model(\n\ - \ model_id=source_model_id,\n target=target # output from target\ - \ client's call to get_copy_authorization()\n )\n copied_over_model = poller.result()\n\ - \n print(\"Model ID: {}\".format(copied_over_model.model_id))\n print(\"Status:\ - \ {}\".format(copied_over_model.status))\n\n ````\n" - uid: azure.ai.formrecognizer.FormTrainingClient.begin_create_composed_model name: begin_create_composed_model summary: 'Creates a composed model from a collection of existing models that were @@ -175,41 +139,6 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Create a composed model\n\n\n\n````python\n\ - \n from azure.core.credentials import AzureKeyCredential\n from azure.ai.formrecognizer\ - \ import FormTrainingClient\n\n endpoint = os.environ[\"AZURE_FORM_RECOGNIZER_ENDPOINT\"\ - ]\n key = os.environ[\"AZURE_FORM_RECOGNIZER_KEY\"]\n po_supplies = os.environ['PURCHASE_ORDER_OFFICE_SUPPLIES_SAS_URL_V2']\n\ - \ po_equipment = os.environ['PURCHASE_ORDER_OFFICE_EQUIPMENT_SAS_URL_V2']\n\ - \ po_furniture = os.environ['PURCHASE_ORDER_OFFICE_FURNITURE_SAS_URL_V2']\n\ - \ po_cleaning_supplies = os.environ['PURCHASE_ORDER_OFFICE_CLEANING_SUPPLIES_SAS_URL_V2']\n\ - \n form_training_client = FormTrainingClient(endpoint=endpoint, credential=AzureKeyCredential(key))\n\ - \ supplies_poller = form_training_client.begin_training(\n po_supplies,\ - \ use_training_labels=True, model_name=\"Purchase order - Office supplies\"\n\ - \ )\n equipment_poller = form_training_client.begin_training(\n po_equipment,\ - \ use_training_labels=True, model_name=\"Purchase order - Office Equipment\"\n\ - \ )\n furniture_poller = form_training_client.begin_training(\n po_furniture,\ - \ use_training_labels=True, model_name=\"Purchase order - Furniture\"\n )\n\ - \ cleaning_supplies_poller = form_training_client.begin_training(\n po_cleaning_supplies,\ - \ use_training_labels=True, model_name=\"Purchase order - Cleaning Supplies\"\n\ - \ )\n supplies_model = supplies_poller.result()\n equipment_model = equipment_poller.result()\n\ - \ furniture_model = furniture_poller.result()\n cleaning_supplies_model =\ - \ cleaning_supplies_poller.result()\n\n models_trained_with_labels = [\n \ - \ supplies_model.model_id,\n equipment_model.model_id,\n furniture_model.model_id,\n\ - \ cleaning_supplies_model.model_id\n ]\n\n poller = form_training_client.begin_create_composed_model(\n\ - \ models_trained_with_labels, model_name=\"Office Supplies Composed Model\"\ - \n )\n model = poller.result()\n\n print(\"Office Supplies Composed Model\ - \ Info:\")\n print(\"Model ID: {}\".format(model.model_id))\n print(\"Model\ - \ name: {}\".format(model.model_name))\n print(\"Is this a composed model?:\ - \ {}\".format(model.properties.is_composed_model))\n print(\"Status: {}\".format(model.status))\n\ - \ print(\"Composed model creation started on: {}\".format(model.training_started_on))\n\ - \ print(\"Creation completed on: {}\".format(model.training_completed_on))\n\ - \n\n ````\n" - uid: azure.ai.formrecognizer.FormTrainingClient.begin_training name: begin_training summary: 'Create and train a custom model. The request must include a *training_files_url* @@ -295,29 +224,6 @@ methods: "invalid" status is still created. You can delete this model by calling' - type: azure.ai.formrecognizer.FormTrainingClient.delete_model - examples: - - "Training a model (without labels) with your custom forms.\n\n\n\n````python\n\n from azure.ai.formrecognizer\ - \ import FormTrainingClient\n from azure.core.credentials import AzureKeyCredential\n\ - \n endpoint = os.environ[\"AZURE_FORM_RECOGNIZER_ENDPOINT\"]\n key = os.environ[\"\ - AZURE_FORM_RECOGNIZER_KEY\"]\n container_sas_url = os.environ[\"CONTAINER_SAS_URL_V2\"\ - ]\n\n form_training_client = FormTrainingClient(endpoint, AzureKeyCredential(key))\n\ - \ poller = form_training_client.begin_training(container_sas_url, use_training_labels=False)\n\ - \ model = poller.result()\n\n # Custom model information\n print(\"Model\ - \ ID: {}\".format(model.model_id))\n print(\"Status: {}\".format(model.status))\n\ - \ print(\"Model name: {}\".format(model.model_name))\n print(\"Training started\ - \ on: {}\".format(model.training_started_on))\n print(\"Training completed on:\ - \ {}\".format(model.training_completed_on))\n\n print(\"Recognized fields:\"\ - )\n # Looping through the submodels, which contains the fields they were trained\ - \ on\n for submodel in model.submodels:\n print(\"...The submodel has\ - \ form type '{}'\".format(submodel.form_type))\n for name, field in submodel.fields.items():\n\ - \ print(\"...The model found field '{}' to have label '{}'\".format(\n\ - \ name, field.label\n ))\n\n ````\n" - uid: azure.ai.formrecognizer.FormTrainingClient.close name: close summary: Close the session. @@ -340,17 +246,6 @@ methods: exceptions: - type: azure.core.exceptions.HttpResponseError - type: azure.core.exceptions.ResourceNotFoundError - examples: - - "Delete a custom model.\n\n\n\n````python\n\ - \n form_training_client.delete_model(model_id=custom_model.model_id)\n\n try:\n\ - \ form_training_client.get_custom_model(model_id=custom_model.model_id)\n\ - \ except ResourceNotFoundError:\n print(\"Successfully deleted model with\ - \ id {}\".format(custom_model.model_id))\n\n ````\n" - uid: azure.ai.formrecognizer.FormTrainingClient.get_account_properties name: get_account_properties summary: Get information about the models on the form recognizer account. @@ -363,19 +258,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Get properties for the form recognizer account.\n\n\n\n````python\n\n form_training_client = FormTrainingClient(endpoint=endpoint,\ - \ credential=AzureKeyCredential(key))\n # First, we see how many custom models\ - \ we have, and what our limit is\n account_properties = form_training_client.get_account_properties()\n\ - \ print(\"Our account has {} custom models, and we can have at most {} custom\ - \ models\\n\".format(\n account_properties.custom_model_count, account_properties.custom_model_limit\n\ - \ ))\n\n ````\n" - uid: azure.ai.formrecognizer.FormTrainingClient.get_copy_authorization name: get_copy_authorization summary: 'Generate authorization for copying a custom model into the target Form @@ -414,18 +296,6 @@ methods: - [, [, ]] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Authorize the target resource to receive the copied model\n\n\n\n````python\n\n target_client = FormTrainingClient(endpoint=target_endpoint,\ - \ credential=AzureKeyCredential(target_key))\n\n target = target_client.get_copy_authorization(\n\ - \ resource_region=target_region,\n resource_id=target_resource_id\n\ - \ )\n # model ID that target client will use to access the model once copy\ - \ is complete\n print(\"Model ID: {}\".format(target[\"modelId\"]))\n\n ````\n" - uid: azure.ai.formrecognizer.FormTrainingClient.get_custom_model name: get_custom_model summary: 'Get a description of a custom model, including the types of forms @@ -445,20 +315,6 @@ methods: exceptions: - type: azure.core.exceptions.HttpResponseError - type: azure.core.exceptions.ResourceNotFoundError - examples: - - "Get a custom model with a model ID.\n\n\n\n````python\n\ - \n custom_model = form_training_client.get_custom_model(model_id=model.model_id)\n\ - \ print(\"\\nModel ID: {}\".format(custom_model.model_id))\n print(\"Status:\ - \ {}\".format(custom_model.status))\n print(\"Model name: {}\".format(custom_model.model_name))\n\ - \ print(\"Is this a composed model?: {}\".format(custom_model.properties.is_composed_model))\n\ - \ print(\"Training started on: {}\".format(custom_model.training_started_on))\n\ - \ print(\"Training completed on: {}\".format(custom_model.training_completed_on))\n\ - \n ````\n" - uid: azure.ai.formrecognizer.FormTrainingClient.get_form_recognizer_client name: get_form_recognizer_client summary: Get an instance of a FormRecognizerClient from FormTrainingClient. @@ -479,13 +335,3 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "List model information for each model on the account.\n\n\n\n````python\n\n custom_models = form_training_client.list_custom_models()\n\ - \n print(\"We have models with the following IDs:\")\n for model_info in custom_models:\n\ - \ print(model_info.model_id)\n\n ````\n" diff --git a/preview/docs-ref-autogen/azure-ai-formrecognizer/azure.ai.formrecognizer.aio.DocumentAnalysisClient.yml b/preview/docs-ref-autogen/azure-ai-formrecognizer/azure.ai.formrecognizer.aio.DocumentAnalysisClient.yml index a8668fbbbfd9..271d3955dddf 100644 --- a/preview/docs-ref-autogen/azure-ai-formrecognizer/azure.ai.formrecognizer.aio.DocumentAnalysisClient.yml +++ b/preview/docs-ref-autogen/azure-ai-formrecognizer/azure.ai.formrecognizer.aio.DocumentAnalysisClient.yml @@ -66,30 +66,6 @@ constructor: types: - - -examples: -- "Creating the DocumentAnalysisClient with an endpoint and API key.\n\n\n\n````python\n\n from azure.core.credentials\ - \ import AzureKeyCredential\n from azure.ai.formrecognizer.aio import DocumentAnalysisClient\n\ - \n endpoint = os.environ[\"AZURE_FORM_RECOGNIZER_ENDPOINT\"]\n key = os.environ[\"\ - AZURE_FORM_RECOGNIZER_KEY\"]\n\n document_analysis_client = DocumentAnalysisClient(endpoint,\ - \ AzureKeyCredential(key))\n\n ````\n\nCreating the DocumentAnalysisClient with\ - \ a token credential.\n\n\n\n````python\n\n \"\"\"DefaultAzureCredential\ - \ will use the values from these environment\n variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,\ - \ AZURE_CLIENT_SECRET\n \"\"\"\n from azure.ai.formrecognizer.aio import DocumentAnalysisClient\n\ - \ from azure.identity.aio import DefaultAzureCredential\n\n endpoint = os.environ[\"\ - AZURE_FORM_RECOGNIZER_ENDPOINT\"]\n credential = DefaultAzureCredential()\n\n\ - \ document_analysis_client = DocumentAnalysisClient(endpoint, credential)\n\n\ - \ ````\n" methods: - uid: azure.ai.formrecognizer.aio.DocumentAnalysisClient.begin_analyze_document name: begin_analyze_document @@ -149,189 +125,6 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Analyze an invoice. For more samples see the *samples* folder.\n\n\n\n````python\n\n from azure.core.credentials\ - \ import AzureKeyCredential\n from azure.ai.formrecognizer.aio import DocumentAnalysisClient\n\ - \n endpoint = os.environ[\"AZURE_FORM_RECOGNIZER_ENDPOINT\"]\n key = os.environ[\"\ - AZURE_FORM_RECOGNIZER_KEY\"]\n\n document_analysis_client = DocumentAnalysisClient(\n\ - \ endpoint=endpoint, credential=AzureKeyCredential(key)\n )\n async\ - \ with document_analysis_client:\n with open(path_to_sample_documents, \"\ - rb\") as f:\n poller = await document_analysis_client.begin_analyze_document(\n\ - \ \"prebuilt-invoice\", document=f, locale=\"en-US\"\n \ - \ )\n invoices = await poller.result()\n\n for idx, invoice in enumerate(invoices.documents):\n\ - \ print(\"--------Analyzing invoice #{}--------\".format(idx + 1))\n \ - \ vendor_name = invoice.fields.get(\"VendorName\")\n if vendor_name:\n\ - \ print(\n \"Vendor Name: {} has confidence: {}\".format(\n\ - \ vendor_name.value, vendor_name.confidence\n \ - \ )\n )\n vendor_address = invoice.fields.get(\"VendorAddress\"\ - )\n if vendor_address:\n print(\n \"Vendor Address:\ - \ {} has confidence: {}\".format(\n vendor_address.value, vendor_address.confidence\n\ - \ )\n )\n vendor_address_recipient = invoice.fields.get(\"\ - VendorAddressRecipient\")\n if vendor_address_recipient:\n print(\n\ - \ \"Vendor Address Recipient: {} has confidence: {}\".format(\n\ - \ vendor_address_recipient.value,\n vendor_address_recipient.confidence,\n\ - \ )\n )\n customer_name = invoice.fields.get(\"\ - CustomerName\")\n if customer_name:\n print(\n \"\ - Customer Name: {} has confidence: {}\".format(\n customer_name.value,\ - \ customer_name.confidence\n )\n )\n customer_id\ - \ = invoice.fields.get(\"CustomerId\")\n if customer_id:\n print(\n\ - \ \"Customer Id: {} has confidence: {}\".format(\n \ - \ customer_id.value, customer_id.confidence\n )\n \ - \ )\n customer_address = invoice.fields.get(\"CustomerAddress\")\n \ - \ if customer_address:\n print(\n \"Customer Address:\ - \ {} has confidence: {}\".format(\n customer_address.value,\ - \ customer_address.confidence\n )\n )\n customer_address_recipient\ - \ = invoice.fields.get(\"CustomerAddressRecipient\")\n if customer_address_recipient:\n\ - \ print(\n \"Customer Address Recipient: {} has confidence:\ - \ {}\".format(\n customer_address_recipient.value,\n \ - \ customer_address_recipient.confidence,\n )\n \ - \ )\n invoice_id = invoice.fields.get(\"InvoiceId\")\n if invoice_id:\n\ - \ print(\n \"Invoice Id: {} has confidence: {}\".format(\n\ - \ invoice_id.value, invoice_id.confidence\n )\n\ - \ )\n invoice_date = invoice.fields.get(\"InvoiceDate\")\n \ - \ if invoice_date:\n print(\n \"Invoice Date: {} has\ - \ confidence: {}\".format(\n invoice_date.value, invoice_date.confidence\n\ - \ )\n )\n invoice_total = invoice.fields.get(\"\ - InvoiceTotal\")\n if invoice_total:\n print(\n \"\ - Invoice Total: {} has confidence: {}\".format(\n invoice_total.value,\ - \ invoice_total.confidence\n )\n )\n due_date =\ - \ invoice.fields.get(\"DueDate\")\n if due_date:\n print(\n \ - \ \"Due Date: {} has confidence: {}\".format(\n \ - \ due_date.value, due_date.confidence\n )\n )\n \ - \ purchase_order = invoice.fields.get(\"PurchaseOrder\")\n if purchase_order:\n\ - \ print(\n \"Purchase Order: {} has confidence: {}\".format(\n\ - \ purchase_order.value, purchase_order.confidence\n \ - \ )\n )\n billing_address = invoice.fields.get(\"BillingAddress\"\ - )\n if billing_address:\n print(\n \"Billing Address:\ - \ {} has confidence: {}\".format(\n billing_address.value, billing_address.confidence\n\ - \ )\n )\n billing_address_recipient = invoice.fields.get(\"\ - BillingAddressRecipient\")\n if billing_address_recipient:\n print(\n\ - \ \"Billing Address Recipient: {} has confidence: {}\".format(\n\ - \ billing_address_recipient.value,\n billing_address_recipient.confidence,\n\ - \ )\n )\n shipping_address = invoice.fields.get(\"\ - ShippingAddress\")\n if shipping_address:\n print(\n \ - \ \"Shipping Address: {} has confidence: {}\".format(\n \ - \ shipping_address.value, shipping_address.confidence\n )\n \ - \ )\n shipping_address_recipient = invoice.fields.get(\"ShippingAddressRecipient\"\ - )\n if shipping_address_recipient:\n print(\n \"\ - Shipping Address Recipient: {} has confidence: {}\".format(\n \ - \ shipping_address_recipient.value,\n shipping_address_recipient.confidence,\n\ - \ )\n )\n print(\"Invoice items:\")\n for\ - \ idx, item in enumerate(invoice.fields.get(\"Items\").value):\n print(\"\ - ...Item #{}\".format(idx + 1))\n item_description = item.value.get(\"\ - Description\")\n if item_description:\n print(\n \ - \ \"......Description: {} has confidence: {}\".format(\n \ - \ item_description.value, item_description.confidence\n \ - \ )\n )\n item_quantity = item.value.get(\"\ - Quantity\")\n if item_quantity:\n print(\n \ - \ \"......Quantity: {} has confidence: {}\".format(\n \ - \ item_quantity.value, item_quantity.confidence\n )\n \ - \ )\n unit = item.value.get(\"Unit\")\n if unit:\n\ - \ print(\n \"......Unit: {} has confidence: {}\"\ - .format(\n unit.value, unit.confidence\n \ - \ )\n )\n unit_price = item.value.get(\"UnitPrice\"\ - )\n if unit_price:\n print(\n \"......Unit\ - \ Price: {}{} has confidence: {}\".format(\n unit_price.value,\ - \ unit_price.value.code if unit_price.value.code else \"\", unit_price.confidence\n\ - \ )\n )\n product_code = item.value.get(\"\ - ProductCode\")\n if product_code:\n print(\n \ - \ \"......Product Code: {} has confidence: {}\".format(\n \ - \ product_code.value, product_code.confidence\n )\n\ - \ )\n item_date = item.value.get(\"Date\")\n \ - \ if item_date:\n print(\n \"......Date: {} has\ - \ confidence: {}\".format(\n item_date.value, item_date.confidence\n\ - \ )\n )\n tax = item.value.get(\"Tax\"\ - )\n if tax:\n print(\n \"......Tax:\ - \ {} has confidence: {}\".format(tax.value, tax.confidence)\n )\n\ - \ amount = item.value.get(\"Amount\")\n if amount:\n \ - \ print(\n \"......Amount: {} has confidence: {}\"\ - .format(\n amount.value, amount.confidence\n \ - \ )\n )\n subtotal = invoice.fields.get(\"SubTotal\"\ - )\n if subtotal:\n print(\n \"Subtotal: {} has confidence:\ - \ {}\".format(\n subtotal.value, subtotal.confidence\n \ - \ )\n )\n total_tax = invoice.fields.get(\"TotalTax\"\ - )\n if total_tax:\n print(\n \"Total Tax: {} has\ - \ confidence: {}\".format(\n total_tax.value, total_tax.confidence\n\ - \ )\n )\n previous_unpaid_balance = invoice.fields.get(\"\ - PreviousUnpaidBalance\")\n if previous_unpaid_balance:\n print(\n\ - \ \"Previous Unpaid Balance: {} has confidence: {}\".format(\n \ - \ previous_unpaid_balance.value,\n previous_unpaid_balance.confidence,\n\ - \ )\n )\n amount_due = invoice.fields.get(\"AmountDue\"\ - )\n if amount_due:\n print(\n \"Amount Due: {} has\ - \ confidence: {}\".format(\n amount_due.value, amount_due.confidence\n\ - \ )\n )\n service_start_date = invoice.fields.get(\"\ - ServiceStartDate\")\n if service_start_date:\n print(\n \ - \ \"Service Start Date: {} has confidence: {}\".format(\n \ - \ service_start_date.value, service_start_date.confidence\n \ - \ )\n )\n service_end_date = invoice.fields.get(\"ServiceEndDate\"\ - )\n if service_end_date:\n print(\n \"Service End\ - \ Date: {} has confidence: {}\".format(\n service_end_date.value,\ - \ service_end_date.confidence\n )\n )\n service_address\ - \ = invoice.fields.get(\"ServiceAddress\")\n if service_address:\n \ - \ print(\n \"Service Address: {} has confidence: {}\".format(\n\ - \ service_address.value, service_address.confidence\n \ - \ )\n )\n service_address_recipient = invoice.fields.get(\"\ - ServiceAddressRecipient\")\n if service_address_recipient:\n print(\n\ - \ \"Service Address Recipient: {} has confidence: {}\".format(\n\ - \ service_address_recipient.value,\n service_address_recipient.confidence,\n\ - \ )\n )\n remittance_address = invoice.fields.get(\"\ - RemittanceAddress\")\n if remittance_address:\n print(\n \ - \ \"Remittance Address: {} has confidence: {}\".format(\n \ - \ remittance_address.value, remittance_address.confidence\n \ - \ )\n )\n remittance_address_recipient = invoice.fields.get(\"\ - RemittanceAddressRecipient\")\n if remittance_address_recipient:\n \ - \ print(\n \"Remittance Address Recipient: {} has confidence:\ - \ {}\".format(\n remittance_address_recipient.value,\n \ - \ remittance_address_recipient.confidence,\n )\n \ - \ )\n\n ````\n\nAnalyze a custom document. For more samples see the\ - \ *samples* folder.\n\n\n\n````python\n\n from azure.core.credentials\ - \ import AzureKeyCredential\n from azure.ai.formrecognizer.aio import DocumentAnalysisClient\n\ - \n endpoint = os.environ[\"AZURE_FORM_RECOGNIZER_ENDPOINT\"]\n key = os.environ[\"\ - AZURE_FORM_RECOGNIZER_KEY\"]\n model_id = os.getenv(\"CUSTOM_BUILT_MODEL_ID\"\ - , custom_model_id)\n\n document_analysis_client = DocumentAnalysisClient(\n\ - \ endpoint=endpoint, credential=AzureKeyCredential(key)\n )\n\n async\ - \ with document_analysis_client:\n # Make sure your document's type is included\ - \ in the list of document types the custom model can analyze\n with open(path_to_sample_documents,\ - \ \"rb\") as f:\n poller = await document_analysis_client.begin_analyze_document(\n\ - \ model_id=model_id, document=f\n )\n result = await\ - \ poller.result()\n\n for idx, document in enumerate(result.documents):\n \ - \ print(\"--------Analyzing document #{}--------\".format(idx + 1))\n \ - \ print(\"Document has type {}\".format(document.doc_type))\n print(\"\ - Document has document type confidence {}\".format(document.confidence))\n \ - \ print(\"Document was analyzed with model with ID {}\".format(result.model_id))\n\ - \ for name, field in document.fields.items():\n field_value =\ - \ field.value if field.value else field.content\n print(\"......found\ - \ field of type '{}' with value '{}' and with confidence {}\".format(field.value_type,\ - \ field_value, field.confidence))\n\n # iterate over tables, lines, and selection\ - \ marks on each page\n for page in result.pages:\n print(\"\\nLines found\ - \ on page {}\".format(page.page_number))\n for line in page.lines:\n \ - \ print(\"...Line '{}'\".format(line.content))\n for word in page.words:\n\ - \ print(\n \"...Word '{}' has a confidence of {}\".format(\n\ - \ word.content, word.confidence\n )\n \ - \ )\n if page.selection_marks:\n print(\"\\nSelection marks\ - \ found on page {}\".format(page.page_number))\n for selection_mark\ - \ in page.selection_marks:\n print(\n \"...Selection\ - \ mark is '{}' and has a confidence of {}\".format(\n selection_mark.state,\ - \ selection_mark.confidence\n )\n )\n\n for\ - \ i, table in enumerate(result.tables):\n print(\"\\nTable {} can be found\ - \ on page:\".format(i + 1))\n for region in table.bounding_regions:\n \ - \ print(\"...{}\".format(region.page_number))\n for cell in table.cells:\n\ - \ print(\n \"...Cell[{}][{}] has text '{}'\".format(\n\ - \ cell.row_index, cell.column_index, cell.content\n \ - \ )\n )\n print(\"-----------------------------------\")\n\n\ - \ ````\n" - uid: azure.ai.formrecognizer.aio.DocumentAnalysisClient.begin_analyze_document_from_url name: begin_analyze_document_from_url summary: 'Analyze field text and semantic values from a given document. @@ -394,59 +187,6 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Analyze a receipt. For more samples see the *samples* folder.\n\n\n\n````python\n\ - \n from azure.core.credentials import AzureKeyCredential\n from azure.ai.formrecognizer.aio\ - \ import DocumentAnalysisClient\n\n endpoint = os.environ[\"AZURE_FORM_RECOGNIZER_ENDPOINT\"\ - ]\n key = os.environ[\"AZURE_FORM_RECOGNIZER_KEY\"]\n\n document_analysis_client\ - \ = DocumentAnalysisClient(\n endpoint=endpoint, credential=AzureKeyCredential(key)\n\ - \ )\n async with document_analysis_client:\n url = \"https://raw.githubusercontent.com/Azure/azure-sdk-for-python/main/sdk/formrecognizer/azure-ai-formrecognizer/tests/sample_forms/receipt/contoso-receipt.png\"\ - \n poller = await document_analysis_client.begin_analyze_document_from_url(\n\ - \ \"prebuilt-receipt\", document_url=url\n )\n receipts\ - \ = await poller.result()\n\n for idx, receipt in enumerate(receipts.documents):\n\ - \ print(\"--------Analysis of receipt #{}--------\".format(idx + 1))\n \ - \ print(\"Receipt type: {}\".format(receipt.doc_type or \"N/A\"))\n \ - \ merchant_name = receipt.fields.get(\"MerchantName\")\n if merchant_name:\n\ - \ print(\n \"Merchant Name: {} has confidence: {}\".format(\n\ - \ merchant_name.value, merchant_name.confidence\n \ - \ )\n )\n transaction_date = receipt.fields.get(\"TransactionDate\"\ - )\n if transaction_date:\n print(\n \"Transaction\ - \ Date: {} has confidence: {}\".format(\n transaction_date.value,\ - \ transaction_date.confidence\n )\n )\n if receipt.fields.get(\"\ - Items\"):\n print(\"Receipt items:\")\n for idx, item in enumerate(receipt.fields.get(\"\ - Items\").value):\n print(\"...Item #{}\".format(idx + 1))\n \ - \ item_description = item.value.get(\"Description\")\n \ - \ if item_description:\n print(\n \"\ - ......Item Description: {} has confidence: {}\".format(\n \ - \ item_description.value, item_description.confidence\n \ - \ )\n )\n item_quantity = item.value.get(\"\ - Quantity\")\n if item_quantity:\n print(\n \ - \ \"......Item Quantity: {} has confidence: {}\".format(\n\ - \ item_quantity.value, item_quantity.confidence\n \ - \ )\n )\n item_price = item.value.get(\"\ - Price\")\n if item_price:\n print(\n \ - \ \"......Individual Item Price: {} has confidence: {}\".format(\n\ - \ item_price.value, item_price.confidence\n \ - \ )\n )\n item_total_price = item.value.get(\"\ - TotalPrice\")\n if item_total_price:\n print(\n\ - \ \"......Total Item Price: {} has confidence: {}\".format(\n\ - \ item_total_price.value, item_total_price.confidence\n\ - \ )\n )\n subtotal = receipt.fields.get(\"\ - Subtotal\")\n if subtotal:\n print(\n \"Subtotal:\ - \ {} has confidence: {}\".format(\n subtotal.value, subtotal.confidence\n\ - \ )\n )\n tax = receipt.fields.get(\"TotalTax\"\ - )\n if tax:\n print(\"Total tax: {} has confidence: {}\".format(tax.value,\ - \ tax.confidence))\n tip = receipt.fields.get(\"Tip\")\n if tip:\n\ - \ print(\"Tip: {} has confidence: {}\".format(tip.value, tip.confidence))\n\ - \ total = receipt.fields.get(\"Total\")\n if total:\n print(\"\ - Total: {} has confidence: {}\".format(total.value, total.confidence))\n \ - \ print(\"--------------------------------------\")\n\n ````\n" - uid: azure.ai.formrecognizer.aio.DocumentAnalysisClient.begin_classify_document name: begin_classify_document summary: 'Classify a document using a document classifier. For more information @@ -480,27 +220,6 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Classify a document. For more samples see the *samples* folder.\n\n\n\n````python\n\n from azure.core.credentials\ - \ import AzureKeyCredential\n from azure.ai.formrecognizer.aio import DocumentAnalysisClient\n\ - \n endpoint = os.environ[\"AZURE_FORM_RECOGNIZER_ENDPOINT\"]\n key = os.environ[\"\ - AZURE_FORM_RECOGNIZER_KEY\"]\n classifier_id = os.getenv(\"CLASSIFIER_ID\",\ - \ classifier_id)\n\n document_analysis_client = DocumentAnalysisClient(\n \ - \ endpoint=endpoint, credential=AzureKeyCredential(key)\n )\n async with\ - \ document_analysis_client:\n with open(path_to_sample_documents, \"rb\"\ - ) as f:\n poller = await document_analysis_client.begin_classify_document(\n\ - \ classifier_id, document=f\n )\n result = await\ - \ poller.result()\n\n print(\"----Classified documents----\")\n for doc in\ - \ result.documents:\n print(f\"Found document of type '{doc.doc_type or\ - \ 'N/A'}' with a confidence of {doc.confidence} contained on \"\n \ - \ f\"the following pages: {[region.page_number for region in doc.bounding_regions]}\"\ - )\n\n ````\n" - uid: azure.ai.formrecognizer.aio.DocumentAnalysisClient.begin_classify_document_from_url name: begin_classify_document_from_url summary: 'Classify a given document with a document classifier. For more information @@ -540,27 +259,6 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Classify a document. For more samples see the *samples* folder.\n\n\n\n````python\n\n from azure.core.credentials\ - \ import AzureKeyCredential\n from azure.ai.formrecognizer.aio import DocumentAnalysisClient\n\ - \n endpoint = os.environ[\"AZURE_FORM_RECOGNIZER_ENDPOINT\"]\n key = os.environ[\"\ - AZURE_FORM_RECOGNIZER_KEY\"]\n classifier_id = os.getenv(\"CLASSIFIER_ID\",\ - \ classifier_id)\n\n document_analysis_client = DocumentAnalysisClient(\n \ - \ endpoint=endpoint, credential=AzureKeyCredential(key)\n )\n async with\ - \ document_analysis_client:\n url = \"https://raw.githubusercontent.com/Azure/azure-sdk-for-python/main/sdk/formrecognizer/azure-ai-formrecognizer/tests/sample_forms/forms/IRS-1040.pdf\"\ - \n\n poller = await document_analysis_client.begin_classify_document_from_url(\n\ - \ classifier_id, document_url=url\n )\n result = await poller.result()\n\ - \n print(\"----Classified documents----\")\n for doc in result.documents:\n\ - \ print(f\"Found document of type '{doc.doc_type or 'N/A'}' with a confidence\ - \ of {doc.confidence} contained on \"\n f\"the following pages: {[region.page_number\ - \ for region in doc.bounding_regions]}\")\n\n ````\n" - uid: azure.ai.formrecognizer.aio.DocumentAnalysisClient.close name: close summary: Close the session. diff --git a/preview/docs-ref-autogen/azure-ai-formrecognizer/azure.ai.formrecognizer.aio.DocumentModelAdministrationClient.yml b/preview/docs-ref-autogen/azure-ai-formrecognizer/azure.ai.formrecognizer.aio.DocumentModelAdministrationClient.yml index 9dd74c6baa52..af39f6efd3e8 100644 --- a/preview/docs-ref-autogen/azure-ai-formrecognizer/azure.ai.formrecognizer.aio.DocumentModelAdministrationClient.yml +++ b/preview/docs-ref-autogen/azure-ai-formrecognizer/azure.ai.formrecognizer.aio.DocumentModelAdministrationClient.yml @@ -65,30 +65,6 @@ constructor: types: - - -examples: -- "Creating the DocumentModelAdministrationClient with an endpoint and API key.\n\n\n\n````python\n\n from azure.core.credentials\ - \ import AzureKeyCredential\n from azure.ai.formrecognizer.aio import DocumentModelAdministrationClient\n\ - \n endpoint = os.environ[\"AZURE_FORM_RECOGNIZER_ENDPOINT\"]\n key = os.environ[\"\ - AZURE_FORM_RECOGNIZER_KEY\"]\n\n document_model_admin_client = DocumentModelAdministrationClient(endpoint,\ - \ AzureKeyCredential(key))\n\n ````\n\nCreating the DocumentModelAdministrationClient\ - \ with a token credential.\n\n\n\n````python\n\n \"\"\"DefaultAzureCredential\ - \ will use the values from these environment\n variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,\ - \ AZURE_CLIENT_SECRET\n \"\"\"\n from azure.ai.formrecognizer.aio import DocumentModelAdministrationClient\n\ - \ from azure.identity.aio import DefaultAzureCredential\n\n endpoint = os.environ[\"\ - AZURE_FORM_RECOGNIZER_ENDPOINT\"]\n credential = DefaultAzureCredential()\n\n\ - \ document_model_admin_client = DocumentModelAdministrationClient(endpoint, credential)\n\ - \n ````\n" methods: - uid: azure.ai.formrecognizer.aio.DocumentModelAdministrationClient.begin_build_document_classifier name: begin_build_document_classifier @@ -126,39 +102,6 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Build a document classifier.\n\n\n\n````python\n\n import os\n\ - \ from azure.ai.formrecognizer.aio import DocumentModelAdministrationClient\n\ - \ from azure.ai.formrecognizer import (\n ClassifierDocumentTypeDetails,\n\ - \ AzureBlobContentSource,\n AzureBlobFileListSource\n )\n from\ - \ azure.core.credentials import AzureKeyCredential\n\n endpoint = os.environ[\"\ - AZURE_FORM_RECOGNIZER_ENDPOINT\"]\n key = os.environ[\"AZURE_FORM_RECOGNIZER_KEY\"\ - ]\n container_sas_url = os.environ[\"CLASSIFIER_CONTAINER_SAS_URL\"]\n\n document_model_admin_client\ - \ = DocumentModelAdministrationClient(endpoint=endpoint, credential=AzureKeyCredential(key))\n\ - \n async with document_model_admin_client:\n # pass either a azure_blob_source\ - \ or azure_blob_file_list_source\n poller = await document_model_admin_client.begin_build_document_classifier(\n\ - \ doc_types={\n \"IRS-1040-A\": ClassifierDocumentTypeDetails(\n\ - \ azure_blob_source=AzureBlobContentSource(\n \ - \ container_url=container_sas_url,\n prefix=\"IRS-1040-A/train\"\ - \n )\n ),\n \"IRS-1040-D\": ClassifierDocumentTypeDetails(\n\ - \ azure_blob_file_list_source=AzureBlobFileListSource(\n \ - \ container_url=container_sas_url,\n \ - \ file_list=\"IRS-1040-D.jsonl\"\n )\n ),\n \ - \ },\n description=\"IRS document classifier\"\n )\n \ - \ result = await poller.result()\n print(f\"Classifier ID: {result.classifier_id}\"\ - )\n print(f\"API version used to build the classifier model: {result.api_version}\"\ - )\n print(f\"Classifier description: {result.description}\")\n print(f\"\ - Document classes used for training the model:\")\n for doc_type, source\ - \ in result.doc_types.items():\n print(f\"Document type: {doc_type}\"\ - )\n blob_source = source.azure_blob_source if source.azure_blob_source\ - \ else source.azure_blob_file_list_source\n print(f\"Container source:\ - \ {blob_source.container_url}\\n\")\n\n ````\n" - uid: azure.ai.formrecognizer.aio.DocumentModelAdministrationClient.begin_build_document_model name: begin_build_document_model summary: 'Build a custom document model. @@ -249,32 +192,6 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Building a model from training files.\n\n\n\n````python\n\n from azure.ai.formrecognizer.aio\ - \ import DocumentModelAdministrationClient\n from azure.ai.formrecognizer import\ - \ ModelBuildMode\n from azure.core.credentials import AzureKeyCredential\n\n\ - \ endpoint = os.environ[\"AZURE_FORM_RECOGNIZER_ENDPOINT\"]\n key = os.environ[\"\ - AZURE_FORM_RECOGNIZER_KEY\"]\n container_sas_url = os.environ[\"CONTAINER_SAS_URL\"\ - ]\n\n document_model_admin_client = DocumentModelAdministrationClient(endpoint,\ - \ AzureKeyCredential(key))\n async with document_model_admin_client:\n \ - \ poller = await document_model_admin_client.begin_build_document_model(\n \ - \ ModelBuildMode.TEMPLATE, blob_container_url=container_sas_url, description=\"\ - my model description\"\n )\n model = await poller.result()\n\n print(\"\ - Model ID: {}\".format(model.model_id))\n print(\"Description: {}\".format(model.description))\n\ - \ print(\"Model created on: {}\\n\".format(model.created_on))\n print(\"Model\ - \ expires on: {}\".format(model.expires_on))\n print(\"Doc types the model can\ - \ recognize:\")\n for name, doc_type in model.doc_types.items():\n print(\"\ - \\nDoc Type: '{}' built with '{}' mode which has the following fields:\".format(name,\ - \ doc_type.build_mode))\n for field_name, field in doc_type.field_schema.items():\n\ - \ print(\"Field: '{}' has type '{}' and confidence score {}\".format(\n\ - \ field_name, field[\"type\"], doc_type.field_confidence[field_name]\n\ - \ ))\n\n ````\n" - uid: azure.ai.formrecognizer.aio.DocumentModelAdministrationClient.begin_compose_document_model name: begin_compose_document_model summary: 'Creates a composed document model from a collection of existing models. @@ -319,48 +236,6 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Creating a composed model with existing models.\n\n\n\n````python\n\n from azure.core.credentials\ - \ import AzureKeyCredential\n from azure.ai.formrecognizer.aio import DocumentModelAdministrationClient\n\ - \ from azure.ai.formrecognizer import ModelBuildMode\n\n endpoint = os.environ[\"\ - AZURE_FORM_RECOGNIZER_ENDPOINT\"]\n key = os.environ[\"AZURE_FORM_RECOGNIZER_KEY\"\ - ]\n po_supplies = os.environ['PURCHASE_ORDER_OFFICE_SUPPLIES_SAS_URL']\n po_equipment\ - \ = os.environ['PURCHASE_ORDER_OFFICE_EQUIPMENT_SAS_URL']\n po_furniture = os.environ['PURCHASE_ORDER_OFFICE_FURNITURE_SAS_URL']\n\ - \ po_cleaning_supplies = os.environ['PURCHASE_ORDER_OFFICE_CLEANING_SUPPLIES_SAS_URL']\n\ - \n document_model_admin_client = DocumentModelAdministrationClient(endpoint=endpoint,\ - \ credential=AzureKeyCredential(key))\n async with document_model_admin_client:\n\ - \ supplies_poller = await document_model_admin_client.begin_build_document_model(\n\ - \ ModelBuildMode.TEMPLATE, blob_container_url=po_supplies, description=\"\ - Purchase order-Office supplies\"\n )\n equipment_poller = await document_model_admin_client.begin_build_document_model(\n\ - \ ModelBuildMode.TEMPLATE, blob_container_url=po_equipment, description=\"\ - Purchase order-Office Equipment\"\n )\n furniture_poller = await document_model_admin_client.begin_build_document_model(\n\ - \ ModelBuildMode.TEMPLATE, blob_container_url=po_furniture, description=\"\ - Purchase order-Furniture\"\n )\n cleaning_supplies_poller = await\ - \ document_model_admin_client.begin_build_document_model(\n ModelBuildMode.TEMPLATE,\ - \ blob_container_url=po_cleaning_supplies, description=\"Purchase order-Cleaning\ - \ Supplies\"\n )\n supplies_model = await supplies_poller.result()\n\ - \ equipment_model = await equipment_poller.result()\n furniture_model\ - \ = await furniture_poller.result()\n cleaning_supplies_model = await cleaning_supplies_poller.result()\n\ - \n purchase_order_models = [\n supplies_model.model_id,\n \ - \ equipment_model.model_id,\n furniture_model.model_id,\n \ - \ cleaning_supplies_model.model_id\n ]\n\n poller = await document_model_admin_client.begin_compose_document_model(\n\ - \ purchase_order_models, description=\"Office Supplies Composed Model\"\ - \n )\n model = await poller.result()\n\n print(\"Office Supplies\ - \ Composed Model Info:\")\n print(\"Model ID: {}\".format(model.model_id))\n\ - \ print(\"Description: {}\".format(model.description))\n print(\"Model created\ - \ on: {}\\n\".format(model.created_on))\n print(\"Model expires on: {}\".format(model.expires_on))\n\ - \ print(\"Doc types the model can recognize:\")\n for name, doc_type in model.doc_types.items():\n\ - \ print(\"\\nDoc Type: '{}' which has the following fields:\".format(name))\n\ - \ for field_name, field in doc_type.field_schema.items():\n print(\"\ - Field: '{}' has type '{}' and confidence score {}\".format(\n field_name,\ - \ field[\"type\"], doc_type.field_confidence[field_name]\n ))\n\n \ - \ ````\n" - uid: azure.ai.formrecognizer.aio.DocumentModelAdministrationClient.begin_copy_document_model_to name: begin_copy_document_model_to summary: 'Copy a document model stored in this resource (the source) to the user @@ -401,37 +276,6 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Copy a model from the source resource to the target resource\n\n\n\n````python\n\n from azure.core.credentials\ - \ import AzureKeyCredential\n from azure.ai.formrecognizer.aio import DocumentModelAdministrationClient\n\ - \n source_endpoint = os.environ[\"AZURE_FORM_RECOGNIZER_SOURCE_ENDPOINT\"]\n\ - \ source_key = os.environ[\"AZURE_FORM_RECOGNIZER_SOURCE_KEY\"]\n target_endpoint\ - \ = os.environ[\"AZURE_FORM_RECOGNIZER_TARGET_ENDPOINT\"]\n target_key = os.environ[\"\ - AZURE_FORM_RECOGNIZER_TARGET_KEY\"]\n source_model_id = os.getenv(\"AZURE_SOURCE_MODEL_ID\"\ - , custom_model_id)\n\n target_client = DocumentModelAdministrationClient(endpoint=target_endpoint,\ - \ credential=AzureKeyCredential(target_key))\n async with target_client:\n \ - \ target = await target_client.get_copy_authorization(\n description=\"\ - model copied from other resource\"\n )\n\n source_client = DocumentModelAdministrationClient(endpoint=source_endpoint,\ - \ credential=AzureKeyCredential(source_key))\n async with source_client:\n \ - \ poller = await source_client.begin_copy_document_model_to(\n \ - \ model_id=source_model_id,\n target=target # output from target client's\ - \ call to get_copy_authorization()\n )\n copied_over_model = await\ - \ poller.result()\n\n print(\"Model ID: {}\".format(copied_over_model.model_id))\n\ - \ print(\"Description: {}\".format(copied_over_model.description))\n print(\"\ - Model created on: {}\\n\".format(copied_over_model.created_on))\n print(\"Model\ - \ expires on: {}\".format(copied_over_model.expires_on))\n print(\"Doc types\ - \ the model can recognize:\")\n for name, doc_type in copied_over_model.doc_types.items():\n\ - \ print(\"\\nDoc Type: '{}' which has the following fields:\".format(name))\n\ - \ for field_name, field in doc_type.field_schema.items():\n print(\"\ - Field: '{}' has type '{}' and confidence score {}\".format(\n field_name,\ - \ field[\"type\"], doc_type.field_confidence[field_name]\n ))\n\n \ - \ ````\n" - uid: azure.ai.formrecognizer.aio.DocumentModelAdministrationClient.close name: close summary: Close the @@ -457,17 +301,6 @@ methods: exceptions: - type: azure.core.exceptions.HttpResponseError - type: azure.core.exceptions.ResourceNotFoundError - examples: - - "Delete a classifier.\n\n\n\n````python\n\n await document_model_admin_client.delete_document_classifier(classifier_id=my_classifier.classifier_id)\n\ - \n try:\n await document_model_admin_client.get_document_classifier(classifier_id=my_classifier.classifier_id)\n\ - \ except ResourceNotFoundError:\n print(\"Successfully deleted classifier\ - \ with ID {}\".format(my_classifier.classifier_id))\n\n ````\n" - uid: azure.ai.formrecognizer.aio.DocumentModelAdministrationClient.delete_document_model name: delete_document_model summary: Delete a custom document model. @@ -484,17 +317,6 @@ methods: exceptions: - type: azure.core.exceptions.HttpResponseError - type: azure.core.exceptions.ResourceNotFoundError - examples: - - "Delete a model.\n\n\n\n````python\n\n await document_model_admin_client.delete_document_model(model_id=my_model.model_id)\n\ - \n try:\n await document_model_admin_client.get_document_model(model_id=my_model.model_id)\n\ - \ except ResourceNotFoundError:\n print(\"Successfully deleted model with\ - \ ID {}\".format(my_model.model_id))\n\n ````\n" - uid: azure.ai.formrecognizer.aio.DocumentModelAdministrationClient.get_copy_authorization name: get_copy_authorization summary: 'Generate authorization for copying a custom model into the target Form @@ -556,18 +378,6 @@ methods: exceptions: - type: azure.core.exceptions.HttpResponseError - type: azure.core.exceptions.ResourceNotFoundError - examples: - - "Get a classifier by its ID.\n\n\n\n````python\n\n my_classifier\ - \ = await document_model_admin_client.get_document_classifier(classifier_id=classifier_model.classifier_id)\n\ - \ print(\"\\nClassifier ID: {}\".format(my_classifier.classifier_id))\n print(\"\ - Description: {}\".format(my_classifier.description))\n print(\"Classifier created\ - \ on: {}\".format(my_classifier.created_on))\n\n ````\n" - uid: azure.ai.formrecognizer.aio.DocumentModelAdministrationClient.get_document_model name: get_document_model summary: Get a document model by its ID. @@ -585,17 +395,6 @@ methods: exceptions: - type: azure.core.exceptions.HttpResponseError - type: azure.core.exceptions.ResourceNotFoundError - examples: - - "Get a model by its ID.\n\n\n\n````python\n\n my_model = await document_model_admin_client.get_document_model(model_id=model.model_id)\n\ - \ print(\"\\nModel ID: {}\".format(my_model.model_id))\n print(\"Description:\ - \ {}\".format(my_model.description))\n print(\"Model created on: {}\".format(my_model.created_on))\n\ - \ print(\"Model expires on: {}\".format(my_model.expires_on))\n\n ````\n" - uid: azure.ai.formrecognizer.aio.DocumentModelAdministrationClient.get_operation name: get_operation summary: 'Get an operation by its ID. @@ -622,28 +421,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Get a document model operation by its ID.\n\n\n\n````python\n\n # Get an operation\ - \ by ID\n try:\n first_operation = await operations.__anext__()\n\n \ - \ print(\"\\nGetting operation info by ID: {}\".format(first_operation.operation_id))\n\ - \ operation_info = await document_model_admin_client.get_operation(first_operation.operation_id)\n\ - \ if operation_info.status == \"succeeded\":\n print(\"My {} operation\ - \ is completed.\".format(operation_info.kind))\n result = operation_info.result\n\ - \ if result is not None:\n if operation_info.kind == \"\ - documentClassifierBuild\":\n print(f\"Classifier ID: {result.classifier_id}\"\ - )\n else:\n print(\"Model ID: {}\".format(result.model_id))\n\ - \ elif operation_info.status == \"failed\":\n print(\"My {} operation\ - \ failed.\".format(operation_info.kind))\n error = operation_info.error\n\ - \ if error is not None:\n print(\"{}: {}\".format(error.code,\ - \ error.message))\n else:\n print(\"My operation status is {}\"\ - .format(operation_info.status))\n except StopAsyncIteration:\n print(\"\ - No operations found.\")\n\n ````\n" - uid: azure.ai.formrecognizer.aio.DocumentModelAdministrationClient.get_resource_details name: get_resource_details summary: Get information about the models under the Form Recognizer resource. @@ -654,23 +431,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Get model counts and limits under the Form Recognizer resource.\n\n\n\n````python\n\n document_model_admin_client\ - \ = DocumentModelAdministrationClient(endpoint=endpoint, credential=AzureKeyCredential(key))\n\ - \n async with document_model_admin_client:\n account_details = await document_model_admin_client.get_resource_details()\n\ - \ print(\"Our resource has {} custom models, and we can have at most {}\ - \ custom models\\n\".format(\n account_details.custom_document_models.count,\ - \ account_details.custom_document_models.limit\n ))\n neural_models\ - \ = account_details.custom_neural_document_model_builds\n print(f\"The quota\ - \ limit for custom neural document models is {neural_models.quota} and the resource\ - \ has\"\n f\"used {neural_models.used}. The resource quota will reset\ - \ on {neural_models.quota_resets_on}\")\n\n ````\n" - uid: azure.ai.formrecognizer.aio.DocumentModelAdministrationClient.list_document_classifiers name: list_document_classifiers summary: 'List information for each document classifier, including its classifier @@ -687,18 +447,6 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "List all classifiers that were built successfully under the Form Recognizer resource.\n\n\n\n````python\n\n classifiers\ - \ = document_model_admin_client.list_document_classifiers()\n\n print(\"We have\ - \ the following 'ready' models with IDs and descriptions:\")\n async for classifier\ - \ in classifiers:\n print(\"{} | {}\".format(classifier.classifier_id, classifier.description))\n\ - \n ````\n" - uid: azure.ai.formrecognizer.aio.DocumentModelAdministrationClient.list_document_models name: list_document_models summary: 'List information for each model, including its model ID, @@ -711,17 +459,6 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "List all models that were built successfully under the Form Recognizer resource.\n\n\n\n````python\n\n models = document_model_admin_client.list_document_models()\n\ - \n print(\"We have the following 'ready' models with IDs and descriptions:\"\ - )\n async for model in models:\n print(\"{} | {}\".format(model.model_id,\ - \ model.description))\n\n ````\n" - uid: azure.ai.formrecognizer.aio.DocumentModelAdministrationClient.list_operations name: list_operations summary: 'List information for each operation. @@ -742,25 +479,3 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "List all document model operations in the past 24 hours.\n\n\n\n````python\n\n from azure.core.credentials\ - \ import AzureKeyCredential\n from azure.ai.formrecognizer.aio import DocumentModelAdministrationClient\n\ - \n endpoint = os.environ[\"AZURE_FORM_RECOGNIZER_ENDPOINT\"]\n key = os.environ[\"\ - AZURE_FORM_RECOGNIZER_KEY\"]\n\n document_model_admin_client = DocumentModelAdministrationClient(endpoint=endpoint,\ - \ credential=AzureKeyCredential(key))\n\n async with document_model_admin_client:\n\ - \ operations = document_model_admin_client.list_operations()\n\n print(\"\ - The following document model operations exist under my resource:\")\n async\ - \ for operation in operations:\n print(\"\\nOperation ID: {}\".format(operation.operation_id))\n\ - \ print(\"Operation kind: {}\".format(operation.kind))\n print(\"\ - Operation status: {}\".format(operation.status))\n print(\"Operation\ - \ percent completed: {}\".format(operation.percent_completed))\n print(\"\ - Operation created on: {}\".format(operation.created_on))\n print(\"\ - Operation last updated on: {}\".format(operation.last_updated_on))\n \ - \ print(\"Resource location of successful operation: {}\".format(operation.resource_location))\n\ - \n ````\n" diff --git a/preview/docs-ref-autogen/azure-ai-formrecognizer/azure.ai.formrecognizer.aio.FormRecognizerClient.yml b/preview/docs-ref-autogen/azure-ai-formrecognizer/azure.ai.formrecognizer.aio.FormRecognizerClient.yml index 23bd3c9b2ba5..7a7362a85928 100644 --- a/preview/docs-ref-autogen/azure-ai-formrecognizer/azure.ai.formrecognizer.aio.FormRecognizerClient.yml +++ b/preview/docs-ref-autogen/azure-ai-formrecognizer/azure.ai.formrecognizer.aio.FormRecognizerClient.yml @@ -61,29 +61,6 @@ constructor: types: - - -examples: -- "Creating the FormRecognizerClient with an endpoint and API key.\n\n\n\n````python\n\n from azure.core.credentials\ - \ import AzureKeyCredential\n from azure.ai.formrecognizer.aio import FormRecognizerClient\n\ - \ endpoint = os.environ[\"AZURE_FORM_RECOGNIZER_ENDPOINT\"]\n key = os.environ[\"\ - AZURE_FORM_RECOGNIZER_KEY\"]\n\n form_recognizer_client = FormRecognizerClient(endpoint,\ - \ AzureKeyCredential(key))\n\n ````\n\nCreating the FormRecognizerClient with\ - \ a token credential.\n\n\n\n````python\n\n \"\"\"DefaultAzureCredential\ - \ will use the values from these environment\n variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,\ - \ AZURE_CLIENT_SECRET\n \"\"\"\n from azure.ai.formrecognizer.aio import FormRecognizerClient\n\ - \ from azure.identity.aio import DefaultAzureCredential\n\n endpoint = os.environ[\"\ - AZURE_FORM_RECOGNIZER_ENDPOINT\"]\n credential = DefaultAzureCredential()\n\n\ - \ form_recognizer_client = FormRecognizerClient(endpoint, credential)\n\n ````\n" methods: - uid: azure.ai.formrecognizer.aio.FormRecognizerClient.begin_recognize_business_cards name: begin_recognize_business_cards @@ -154,59 +131,6 @@ methods: - [[]] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Recognize business cards from a file.\n\n\n\n````python\n\ - \n from azure.core.credentials import AzureKeyCredential\n from azure.ai.formrecognizer.aio\ - \ import FormRecognizerClient\n\n endpoint = os.environ[\"AZURE_FORM_RECOGNIZER_ENDPOINT\"\ - ]\n key = os.environ[\"AZURE_FORM_RECOGNIZER_KEY\"]\n\n form_recognizer_client\ - \ = FormRecognizerClient(\n endpoint=endpoint, credential=AzureKeyCredential(key)\n\ - \ )\n async with form_recognizer_client:\n with open(path_to_sample_forms,\ - \ \"rb\") as f:\n poller = await form_recognizer_client.begin_recognize_business_cards(business_card=f,\ - \ locale=\"en-US\")\n business_cards = await poller.result()\n\n for idx,\ - \ business_card in enumerate(business_cards):\n print(\"--------Recognizing\ - \ business card #{}--------\".format(idx+1))\n contact_names = business_card.fields.get(\"\ - ContactNames\")\n if contact_names:\n for contact_name in contact_names.value:\n\ - \ print(\"Contact First Name: {} has confidence: {}\".format(\n\ - \ contact_name.value[\"FirstName\"].value, contact_name.value[\"\ - FirstName\"].confidence\n ))\n print(\"Contact Last\ - \ Name: {} has confidence: {}\".format(\n contact_name.value[\"\ - LastName\"].value, contact_name.value[\"LastName\"].confidence\n \ - \ ))\n company_names = business_card.fields.get(\"CompanyNames\")\n \ - \ if company_names:\n for company_name in company_names.value:\n\ - \ print(\"Company Name: {} has confidence: {}\".format(company_name.value,\ - \ company_name.confidence))\n departments = business_card.fields.get(\"\ - Departments\")\n if departments:\n for department in departments.value:\n\ - \ print(\"Department: {} has confidence: {}\".format(department.value,\ - \ department.confidence))\n job_titles = business_card.fields.get(\"JobTitles\"\ - )\n if job_titles:\n for job_title in job_titles.value:\n \ - \ print(\"Job Title: {} has confidence: {}\".format(job_title.value,\ - \ job_title.confidence))\n emails = business_card.fields.get(\"Emails\"\ - )\n if emails:\n for email in emails.value:\n print(\"\ - Email: {} has confidence: {}\".format(email.value, email.confidence))\n \ - \ websites = business_card.fields.get(\"Websites\")\n if websites:\n \ - \ for website in websites.value:\n print(\"Website: {} has\ - \ confidence: {}\".format(website.value, website.confidence))\n addresses\ - \ = business_card.fields.get(\"Addresses\")\n if addresses:\n \ - \ for address in addresses.value:\n print(\"Address: {} has confidence:\ - \ {}\".format(address.value, address.confidence))\n mobile_phones = business_card.fields.get(\"\ - MobilePhones\")\n if mobile_phones:\n for phone in mobile_phones.value:\n\ - \ print(\"Mobile phone number: {} has confidence: {}\".format(phone.value,\ - \ phone.confidence))\n faxes = business_card.fields.get(\"Faxes\")\n \ - \ if faxes:\n for fax in faxes.value:\n print(\"Fax\ - \ number: {} has confidence: {}\".format(fax.value, fax.confidence))\n work_phones\ - \ = business_card.fields.get(\"WorkPhones\")\n if work_phones:\n \ - \ for work_phone in work_phones.value:\n print(\"Work phone number:\ - \ {} has confidence: {}\".format(work_phone.value, work_phone.confidence))\n \ - \ other_phones = business_card.fields.get(\"OtherPhones\")\n if other_phones:\n\ - \ for other_phone in other_phones.value:\n print(\"Other\ - \ phone number: {} has confidence: {}\".format(other_phone.value, other_phone.confidence))\n\ - \n ````\n" - uid: azure.ai.formrecognizer.aio.FormRecognizerClient.begin_recognize_business_cards_from_url name: begin_recognize_business_cards_from_url summary: 'Extract field text and semantic values from a given business card. @@ -346,46 +270,6 @@ methods: - [[]] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Recognize text and content/layout information from a form.\n\n\n\n````python\n\n from azure.core.credentials\ - \ import AzureKeyCredential\n from azure.ai.formrecognizer.aio import FormRecognizerClient\n\ - \n endpoint = os.environ[\"AZURE_FORM_RECOGNIZER_ENDPOINT\"]\n key = os.environ[\"\ - AZURE_FORM_RECOGNIZER_KEY\"]\n\n async with FormRecognizerClient(\n endpoint=endpoint,\ - \ credential=AzureKeyCredential(key)\n ) as form_recognizer_client:\n\n \ - \ with open(path_to_sample_forms, \"rb\") as f:\n poller = await form_recognizer_client.begin_recognize_content(form=f)\n\ - \n form_pages = await poller.result()\n\n for idx, content in enumerate(form_pages):\n\ - \ print(\"----Recognizing content from page #{}----\".format(idx+1))\n\ - \ print(\"Page has width: {} and height: {}, measured with unit: {}\"\ - .format(\n content.width,\n content.height,\n \ - \ content.unit\n ))\n for table_idx, table in enumerate(content.tables):\n\ - \ print(\"Table # {} has {} rows and {} columns\".format(table_idx,\ - \ table.row_count, table.column_count))\n print(\"Table # {} location\ - \ on page: {}\".format(table_idx, format_bounding_box(table.bounding_box)))\n\ - \ for cell in table.cells:\n print(\"...Cell[{}][{}]\ - \ has text '{}' within bounding box '{}'\".format(\n cell.row_index,\n\ - \ cell.column_index,\n cell.text,\n\ - \ format_bounding_box(cell.bounding_box)\n \ - \ ))\n\n for line_idx, line in enumerate(content.lines):\n \ - \ print(\"Line # {} has word count '{}' and text '{}' within bounding\ - \ box '{}'\".format(\n line_idx,\n len(line.words),\n\ - \ line.text,\n format_bounding_box(line.bounding_box)\n\ - \ ))\n if line.appearance:\n if\ - \ line.appearance.style_name == \"handwriting\" and line.appearance.style_confidence\ - \ > 0.8:\n print(\"Text line '{}' is handwritten and might\ - \ be a signature.\".format(line.text))\n for word in line.words:\n\ - \ print(\"...Word '{}' has a confidence of {}\".format(word.text,\ - \ word.confidence))\n\n for selection_mark in content.selection_marks:\n\ - \ print(\"Selection mark is '{}' within bounding box '{}' and has\ - \ a confidence of {}\".format(\n selection_mark.state,\n \ - \ format_bounding_box(selection_mark.bounding_box),\n \ - \ selection_mark.confidence\n ))\n print(\"----------------------------------------\"\ - )\n\n\n ````\n" - uid: azure.ai.formrecognizer.aio.FormRecognizerClient.begin_recognize_content_from_url name: begin_recognize_content_from_url summary: 'Extract text and layout information from a given document. @@ -519,56 +403,6 @@ methods: - [[]] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Recognize fields and values from a custom form.\n\n\n\n````python\n\ - \n from azure.core.credentials import AzureKeyCredential\n from azure.ai.formrecognizer.aio\ - \ import FormRecognizerClient\n\n endpoint = os.environ[\"AZURE_FORM_RECOGNIZER_ENDPOINT\"\ - ]\n key = os.environ[\"AZURE_FORM_RECOGNIZER_KEY\"]\n model_id = os.getenv(\"\ - CUSTOM_TRAINED_MODEL_ID\", custom_model_id)\n\n async with FormRecognizerClient(\n\ - \ endpoint=endpoint, credential=AzureKeyCredential(key)\n ) as form_recognizer_client:\n\ - \n # Make sure your form's type is included in the list of form types the\ - \ custom model can recognize\n with open(path_to_sample_forms, \"rb\") as\ - \ f:\n poller = await form_recognizer_client.begin_recognize_custom_forms(\n\ - \ model_id=model_id, form=f, include_field_elements=True\n \ - \ )\n forms = await poller.result()\n\n for idx, form in enumerate(forms):\n\ - \ print(\"--------Recognizing Form #{}--------\".format(idx+1))\n \ - \ print(\"Form has type {}\".format(form.form_type))\n print(\"\ - Form has form type confidence {}\".format(form.form_type_confidence))\n \ - \ print(\"Form was analyzed with model with ID {}\".format(form.model_id))\n\ - \ for name, field in form.fields.items():\n # each field\ - \ is of type FormField\n # label_data is populated if you are using\ - \ a model trained without labels,\n # since the service needs to\ - \ make predictions for labels if not explicitly given to it.\n if\ - \ field.label_data:\n print(\"...Field '{}' has label '{}' with\ - \ a confidence score of {}\".format(\n name,\n \ - \ field.label_data.text,\n field.confidence\n\ - \ ))\n\n print(\"...Label '{}' has value '{}'\ - \ with a confidence score of {}\".format(\n field.label_data.text\ - \ if field.label_data else name, field.value, field.confidence\n \ - \ ))\n\n # iterate over tables, lines, and selection marks on each\ - \ page\n for page in form.pages:\n for i, table in enumerate(page.tables):\n\ - \ print(\"\\nTable {} on page {}\".format(i + 1, table.page_number))\n\ - \ for cell in table.cells:\n print(\"\ - ...Cell[{}][{}] has text '{}' with confidence {}\".format(\n \ - \ cell.row_index, cell.column_index, cell.text, cell.confidence\n \ - \ ))\n print(\"\\nLines found on page {}\".format(page.page_number))\n\ - \ for line in page.lines:\n print(\"...Line '{}'\ - \ is made up of the following words: \".format(line.text))\n \ - \ for word in line.words:\n print(\"......Word '{}' has\ - \ a confidence of {}\".format(\n word.text,\n \ - \ word.confidence\n ))\n \ - \ if page.selection_marks:\n print(\"\\nSelection marks found\ - \ on page {}\".format(page.page_number))\n for selection_mark\ - \ in page.selection_marks:\n print(\"......Selection mark\ - \ is '{}' and has a confidence of {}\".format(\n selection_mark.state,\n\ - \ selection_mark.confidence\n \ - \ ))\n\n print(\"-----------------------------------\")\n\n ````\n" - uid: azure.ai.formrecognizer.aio.FormRecognizerClient.begin_recognize_custom_forms_from_url name: begin_recognize_custom_forms_from_url summary: 'Analyze a custom form with a model trained with or without labels. The @@ -685,44 +519,6 @@ methods: - [[]] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Recognize identity documents from a file.\n\n\n\n````python\n\ - \n from azure.core.credentials import AzureKeyCredential\n from azure.ai.formrecognizer.aio\ - \ import FormRecognizerClient\n\n endpoint = os.environ[\"AZURE_FORM_RECOGNIZER_ENDPOINT\"\ - ]\n key = os.environ[\"AZURE_FORM_RECOGNIZER_KEY\"]\n\n async with FormRecognizerClient(\n\ - \ endpoint=endpoint, credential=AzureKeyCredential(key)\n ) as form_recognizer_client:\n\ - \ \n with open(path_to_sample_forms, \"rb\") as f:\n poller\ - \ = await form_recognizer_client.begin_recognize_identity_documents(identity_document=f)\n\ - \ \n id_documents = await poller.result()\n\n for idx, id_document\ - \ in enumerate(id_documents):\n print(\"--------Recognizing ID document\ - \ #{}--------\".format(idx+1))\n first_name = id_document.fields.get(\"\ - FirstName\")\n if first_name:\n print(\"First Name: {}\ - \ has confidence: {}\".format(first_name.value, first_name.confidence))\n \ - \ last_name = id_document.fields.get(\"LastName\")\n if last_name:\n\ - \ print(\"Last Name: {} has confidence: {}\".format(last_name.value,\ - \ last_name.confidence))\n document_number = id_document.fields.get(\"\ - DocumentNumber\")\n if document_number:\n print(\"Document\ - \ Number: {} has confidence: {}\".format(document_number.value, document_number.confidence))\n\ - \ dob = id_document.fields.get(\"DateOfBirth\")\n if dob:\n\ - \ print(\"Date of Birth: {} has confidence: {}\".format(dob.value,\ - \ dob.confidence))\n doe = id_document.fields.get(\"DateOfExpiration\"\ - )\n if doe:\n print(\"Date of Expiration: {} has confidence:\ - \ {}\".format(doe.value, doe.confidence))\n sex = id_document.fields.get(\"\ - Sex\")\n if sex:\n print(\"Sex: {} has confidence: {}\"\ - .format(sex.value, sex.confidence))\n address = id_document.fields.get(\"\ - Address\")\n if address:\n print(\"Address: {} has confidence:\ - \ {}\".format(address.value, address.confidence))\n country_region =\ - \ id_document.fields.get(\"CountryRegion\")\n if country_region:\n \ - \ print(\"Country/Region: {} has confidence: {}\".format(country_region.value,\ - \ country_region.confidence))\n region = id_document.fields.get(\"Region\"\ - )\n if region:\n print(\"Region: {} has confidence: {}\"\ - .format(region.value, region.confidence))\n\n ````\n" - uid: azure.ai.formrecognizer.aio.FormRecognizerClient.begin_recognize_identity_documents_from_url name: begin_recognize_identity_documents_from_url summary: 'Extract field text and semantic values from a given identity document. @@ -843,115 +639,6 @@ methods: - [[]] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Recognize invoices from a file.\n\n\n\n````python\n\n from azure.core.credentials\ - \ import AzureKeyCredential\n from azure.ai.formrecognizer.aio import FormRecognizerClient\n\ - \n endpoint = os.environ[\"AZURE_FORM_RECOGNIZER_ENDPOINT\"]\n key = os.environ[\"\ - AZURE_FORM_RECOGNIZER_KEY\"]\n\n async with FormRecognizerClient(\n endpoint=endpoint,\ - \ credential=AzureKeyCredential(key)\n ) as form_recognizer_client:\n \ - \ with open(path_to_sample_forms, \"rb\") as f:\n poller = await form_recognizer_client.begin_recognize_invoices(invoice=f,\ - \ locale=\"en-US\")\n invoices = await poller.result()\n\n for idx,\ - \ invoice in enumerate(invoices):\n print(\"--------Recognizing invoice\ - \ #{}--------\".format(idx+1))\n vendor_name = invoice.fields.get(\"\ - VendorName\")\n if vendor_name:\n print(\"Vendor Name:\ - \ {} has confidence: {}\".format(vendor_name.value, vendor_name.confidence))\n\ - \ vendor_address = invoice.fields.get(\"VendorAddress\")\n \ - \ if vendor_address:\n print(\"Vendor Address: {} has confidence:\ - \ {}\".format(vendor_address.value, vendor_address.confidence))\n vendor_address_recipient\ - \ = invoice.fields.get(\"VendorAddressRecipient\")\n if vendor_address_recipient:\n\ - \ print(\"Vendor Address Recipient: {} has confidence: {}\".format(vendor_address_recipient.value,\ - \ vendor_address_recipient.confidence))\n customer_name = invoice.fields.get(\"\ - CustomerName\")\n if customer_name:\n print(\"Customer\ - \ Name: {} has confidence: {}\".format(customer_name.value, customer_name.confidence))\n\ - \ customer_id = invoice.fields.get(\"CustomerId\")\n if customer_id:\n\ - \ print(\"Customer Id: {} has confidence: {}\".format(customer_id.value,\ - \ customer_id.confidence))\n customer_address = invoice.fields.get(\"\ - CustomerAddress\")\n if customer_address:\n print(\"Customer\ - \ Address: {} has confidence: {}\".format(customer_address.value, customer_address.confidence))\n\ - \ customer_address_recipient = invoice.fields.get(\"CustomerAddressRecipient\"\ - )\n if customer_address_recipient:\n print(\"Customer\ - \ Address Recipient: {} has confidence: {}\".format(customer_address_recipient.value,\ - \ customer_address_recipient.confidence))\n invoice_id = invoice.fields.get(\"\ - InvoiceId\")\n if invoice_id:\n print(\"Invoice Id: {}\ - \ has confidence: {}\".format(invoice_id.value, invoice_id.confidence))\n \ - \ invoice_date = invoice.fields.get(\"InvoiceDate\")\n if invoice_date:\n\ - \ print(\"Invoice Date: {} has confidence: {}\".format(invoice_date.value,\ - \ invoice_date.confidence))\n invoice_total = invoice.fields.get(\"\ - InvoiceTotal\")\n if invoice_total:\n print(\"Invoice\ - \ Total: {} has confidence: {}\".format(invoice_total.value, invoice_total.confidence))\n\ - \ due_date = invoice.fields.get(\"DueDate\")\n if due_date:\n\ - \ print(\"Due Date: {} has confidence: {}\".format(due_date.value,\ - \ due_date.confidence))\n purchase_order = invoice.fields.get(\"PurchaseOrder\"\ - )\n if purchase_order:\n print(\"Purchase Order: {} has\ - \ confidence: {}\".format(purchase_order.value, purchase_order.confidence))\n\ - \ billing_address = invoice.fields.get(\"BillingAddress\")\n \ - \ if billing_address:\n print(\"Billing Address: {} has confidence:\ - \ {}\".format(billing_address.value, billing_address.confidence))\n \ - \ billing_address_recipient = invoice.fields.get(\"BillingAddressRecipient\")\n\ - \ if billing_address_recipient:\n print(\"Billing Address\ - \ Recipient: {} has confidence: {}\".format(billing_address_recipient.value, billing_address_recipient.confidence))\n\ - \ shipping_address = invoice.fields.get(\"ShippingAddress\")\n \ - \ if shipping_address:\n print(\"Shipping Address: {} has confidence:\ - \ {}\".format(shipping_address.value, shipping_address.confidence))\n \ - \ shipping_address_recipient = invoice.fields.get(\"ShippingAddressRecipient\"\ - )\n if shipping_address_recipient:\n print(\"Shipping\ - \ Address Recipient: {} has confidence: {}\".format(shipping_address_recipient.value,\ - \ shipping_address_recipient.confidence))\n print(\"Invoice items:\"\ - )\n for idx, item in enumerate(invoice.fields.get(\"Items\").value):\n\ - \ print(\"...Item #{}\".format(idx+1))\n item_description\ - \ = item.value.get(\"Description\")\n if item_description:\n \ - \ print(\"......Description: {} has confidence: {}\".format(item_description.value,\ - \ item_description.confidence))\n item_quantity = item.value.get(\"\ - Quantity\")\n if item_quantity:\n print(\"......Quantity:\ - \ {} has confidence: {}\".format(item_quantity.value, item_quantity.confidence))\n\ - \ unit = item.value.get(\"Unit\")\n if unit:\n \ - \ print(\"......Unit: {} has confidence: {}\".format(unit.value,\ - \ unit.confidence))\n unit_price = item.value.get(\"UnitPrice\"\ - )\n if unit_price:\n print(\"......Unit Price:\ - \ {} has confidence: {}\".format(unit_price.value, unit_price.confidence))\n \ - \ product_code = item.value.get(\"ProductCode\")\n \ - \ if product_code:\n print(\"......Product Code: {} has confidence:\ - \ {}\".format(product_code.value, product_code.confidence))\n item_date\ - \ = item.value.get(\"Date\")\n if item_date:\n \ - \ print(\"......Date: {} has confidence: {}\".format(item_date.value, item_date.confidence))\n\ - \ tax = item.value.get(\"Tax\")\n if tax:\n \ - \ print(\"......Tax: {} has confidence: {}\".format(tax.value, tax.confidence))\n\ - \ amount = item.value.get(\"Amount\")\n if amount:\n\ - \ print(\"......Amount: {} has confidence: {}\".format(amount.value,\ - \ amount.confidence))\n subtotal = invoice.fields.get(\"SubTotal\")\n\ - \ if subtotal:\n print(\"Subtotal: {} has confidence:\ - \ {}\".format(subtotal.value, subtotal.confidence))\n total_tax = invoice.fields.get(\"\ - TotalTax\")\n if total_tax:\n print(\"Total Tax: {} has\ - \ confidence: {}\".format(total_tax.value, total_tax.confidence))\n \ - \ previous_unpaid_balance = invoice.fields.get(\"PreviousUnpaidBalance\")\n \ - \ if previous_unpaid_balance:\n print(\"Previous Unpaid\ - \ Balance: {} has confidence: {}\".format(previous_unpaid_balance.value, previous_unpaid_balance.confidence))\n\ - \ amount_due = invoice.fields.get(\"AmountDue\")\n if amount_due:\n\ - \ print(\"Amount Due: {} has confidence: {}\".format(amount_due.value,\ - \ amount_due.confidence))\n service_start_date = invoice.fields.get(\"\ - ServiceStartDate\")\n if service_start_date:\n print(\"\ - Service Start Date: {} has confidence: {}\".format(service_start_date.value, service_start_date.confidence))\n\ - \ service_end_date = invoice.fields.get(\"ServiceEndDate\")\n \ - \ if service_end_date:\n print(\"Service End Date: {} has confidence:\ - \ {}\".format(service_end_date.value, service_end_date.confidence))\n \ - \ service_address = invoice.fields.get(\"ServiceAddress\")\n if service_address:\n\ - \ print(\"Service Address: {} has confidence: {}\".format(service_address.value,\ - \ service_address.confidence))\n service_address_recipient = invoice.fields.get(\"\ - ServiceAddressRecipient\")\n if service_address_recipient:\n \ - \ print(\"Service Address Recipient: {} has confidence: {}\".format(service_address_recipient.value,\ - \ service_address_recipient.confidence))\n remittance_address = invoice.fields.get(\"\ - RemittanceAddress\")\n if remittance_address:\n print(\"\ - Remittance Address: {} has confidence: {}\".format(remittance_address.value, remittance_address.confidence))\n\ - \ remittance_address_recipient = invoice.fields.get(\"RemittanceAddressRecipient\"\ - )\n if remittance_address_recipient:\n print(\"Remittance\ - \ Address Recipient: {} has confidence: {}\".format(remittance_address_recipient.value,\ - \ remittance_address_recipient.confidence))\n\n ````\n" - uid: azure.ai.formrecognizer.aio.FormRecognizerClient.begin_recognize_invoices_from_url name: begin_recognize_invoices_from_url summary: 'Extract field text and semantic values from a given invoice. @@ -1078,53 +765,6 @@ methods: - [[]] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Recognize sales receipt fields.\n\n\n\n````python\n\n from azure.core.credentials\ - \ import AzureKeyCredential\n from azure.ai.formrecognizer.aio import FormRecognizerClient\n\ - \n endpoint = os.environ[\"AZURE_FORM_RECOGNIZER_ENDPOINT\"]\n key = os.environ[\"\ - AZURE_FORM_RECOGNIZER_KEY\"]\n\n async with FormRecognizerClient(\n endpoint=endpoint,\ - \ credential=AzureKeyCredential(key)\n ) as form_recognizer_client:\n\n \ - \ with open(path_to_sample_forms, \"rb\") as f:\n poller = await form_recognizer_client.begin_recognize_receipts(receipt=f,\ - \ locale=\"en-US\")\n\n receipts = await poller.result()\n\n for idx,\ - \ receipt in enumerate(receipts):\n print(\"--------Recognizing receipt\ - \ #{}--------\".format(idx+1))\n receipt_type = receipt.fields.get(\"\ - ReceiptType\")\n if receipt_type:\n print(\"Receipt Type:\ - \ {} has confidence: {}\".format(receipt_type.value, receipt_type.confidence))\n\ - \ merchant_name = receipt.fields.get(\"MerchantName\")\n if\ - \ merchant_name:\n print(\"Merchant Name: {} has confidence: {}\"\ - .format(merchant_name.value, merchant_name.confidence))\n transaction_date\ - \ = receipt.fields.get(\"TransactionDate\")\n if transaction_date:\n\ - \ print(\"Transaction Date: {} has confidence: {}\".format(transaction_date.value,\ - \ transaction_date.confidence))\n if receipt.fields.get(\"Items\"):\n\ - \ print(\"Receipt items:\")\n for idx, item in enumerate(receipt.fields.get(\"\ - Items\").value):\n print(\"...Item #{}\".format(idx+1))\n \ - \ item_name = item.value.get(\"Name\")\n if\ - \ item_name:\n print(\"......Item Name: {} has confidence:\ - \ {}\".format(item_name.value, item_name.confidence))\n item_quantity\ - \ = item.value.get(\"Quantity\")\n if item_quantity:\n \ - \ print(\"......Item Quantity: {} has confidence: {}\".format(item_quantity.value,\ - \ item_quantity.confidence))\n item_price = item.value.get(\"\ - Price\")\n if item_price:\n print(\"......Individual\ - \ Item Price: {} has confidence: {}\".format(item_price.value, item_price.confidence))\n\ - \ item_total_price = item.value.get(\"TotalPrice\")\n \ - \ if item_total_price:\n print(\"......Total\ - \ Item Price: {} has confidence: {}\".format(item_total_price.value, item_total_price.confidence))\n\ - \ subtotal = receipt.fields.get(\"Subtotal\")\n if subtotal:\n\ - \ print(\"Subtotal: {} has confidence: {}\".format(subtotal.value,\ - \ subtotal.confidence))\n tax = receipt.fields.get(\"Tax\")\n \ - \ if tax:\n print(\"Tax: {} has confidence: {}\".format(tax.value,\ - \ tax.confidence))\n tip = receipt.fields.get(\"Tip\")\n if\ - \ tip:\n print(\"Tip: {} has confidence: {}\".format(tip.value,\ - \ tip.confidence))\n total = receipt.fields.get(\"Total\")\n \ - \ if total:\n print(\"Total: {} has confidence: {}\".format(total.value,\ - \ total.confidence))\n print(\"--------------------------------------\"\ - )\n\n ````\n" - uid: azure.ai.formrecognizer.aio.FormRecognizerClient.begin_recognize_receipts_from_url name: begin_recognize_receipts_from_url summary: 'Extract field text and semantic values from a given sales receipt. @@ -1185,54 +825,6 @@ methods: - [[]] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Recognize sales receipt fields from a URL.\n\n\n\n````python\n\ - \n from azure.core.credentials import AzureKeyCredential\n from azure.ai.formrecognizer.aio\ - \ import FormRecognizerClient\n\n endpoint = os.environ[\"AZURE_FORM_RECOGNIZER_ENDPOINT\"\ - ]\n key = os.environ[\"AZURE_FORM_RECOGNIZER_KEY\"]\n\n async with FormRecognizerClient(\n\ - \ endpoint=endpoint, credential=AzureKeyCredential(key)\n ) as form_recognizer_client:\n\ - \ url = \"https://raw.githubusercontent.com/Azure/azure-sdk-for-python/main/sdk/formrecognizer/azure-ai-formrecognizer/tests/sample_forms/receipt/contoso-receipt.png\"\ - \n poller = await form_recognizer_client.begin_recognize_receipts_from_url(receipt_url=url)\n\ - \ receipts = await poller.result()\n\n for idx, receipt in enumerate(receipts):\n\ - \ print(\"--------Recognizing receipt #{}--------\".format(idx+1))\n\ - \ receipt_type = receipt.fields.get(\"ReceiptType\")\n if\ - \ receipt_type:\n print(\"Receipt Type: {} has confidence: {}\"\ - .format(receipt_type.value, receipt_type.confidence))\n merchant_name\ - \ = receipt.fields.get(\"MerchantName\")\n if merchant_name:\n \ - \ print(\"Merchant Name: {} has confidence: {}\".format(merchant_name.value,\ - \ merchant_name.confidence))\n transaction_date = receipt.fields.get(\"\ - TransactionDate\")\n if transaction_date:\n print(\"Transaction\ - \ Date: {} has confidence: {}\".format(transaction_date.value, transaction_date.confidence))\n\ - \ if receipt.fields.get(\"Items\"):\n print(\"Receipt\ - \ items:\")\n for idx, item in enumerate(receipt.fields.get(\"Items\"\ - ).value):\n print(\"...Item #{}\".format(idx+1))\n \ - \ item_name = item.value.get(\"Name\")\n if item_name:\n\ - \ print(\"......Item Name: {} has confidence: {}\".format(item_name.value,\ - \ item_name.confidence))\n item_quantity = item.value.get(\"\ - Quantity\")\n if item_quantity:\n print(\"\ - ......Item Quantity: {} has confidence: {}\".format(item_quantity.value, item_quantity.confidence))\n\ - \ item_price = item.value.get(\"Price\")\n \ - \ if item_price:\n print(\"......Individual Item Price:\ - \ {} has confidence: {}\".format(item_price.value, item_price.confidence))\n \ - \ item_total_price = item.value.get(\"TotalPrice\")\n \ - \ if item_total_price:\n print(\"......Total\ - \ Item Price: {} has confidence: {}\".format(item_total_price.value, item_total_price.confidence))\n\ - \ subtotal = receipt.fields.get(\"Subtotal\")\n if subtotal:\n\ - \ print(\"Subtotal: {} has confidence: {}\".format(subtotal.value,\ - \ subtotal.confidence))\n tax = receipt.fields.get(\"Tax\")\n \ - \ if tax:\n print(\"Tax: {} has confidence: {}\".format(tax.value,\ - \ tax.confidence))\n tip = receipt.fields.get(\"Tip\")\n if\ - \ tip:\n print(\"Tip: {} has confidence: {}\".format(tip.value,\ - \ tip.confidence))\n total = receipt.fields.get(\"Total\")\n \ - \ if total:\n print(\"Total: {} has confidence: {}\".format(total.value,\ - \ total.confidence))\n print(\"--------------------------------------\"\ - )\n\n ````\n" - uid: azure.ai.formrecognizer.aio.FormRecognizerClient.close name: close summary: Close the session. diff --git a/preview/docs-ref-autogen/azure-ai-formrecognizer/azure.ai.formrecognizer.aio.FormTrainingClient.yml b/preview/docs-ref-autogen/azure-ai-formrecognizer/azure.ai.formrecognizer.aio.FormTrainingClient.yml index 08ccb227737f..3b012a9a29df 100644 --- a/preview/docs-ref-autogen/azure-ai-formrecognizer/azure.ai.formrecognizer.aio.FormTrainingClient.yml +++ b/preview/docs-ref-autogen/azure-ai-formrecognizer/azure.ai.formrecognizer.aio.FormTrainingClient.yml @@ -58,29 +58,6 @@ constructor: types: - - -examples: -- "Creating the FormTrainingClient with an endpoint and API key.\n\n\n\n````python\n\n from azure.core.credentials\ - \ import AzureKeyCredential\n from azure.ai.formrecognizer.aio import FormTrainingClient\n\ - \ endpoint = os.environ[\"AZURE_FORM_RECOGNIZER_ENDPOINT\"]\n key = os.environ[\"\ - AZURE_FORM_RECOGNIZER_KEY\"]\n\n form_training_client = FormTrainingClient(endpoint,\ - \ AzureKeyCredential(key))\n\n ````\n\nCreating the FormTrainingClient with a\ - \ token credential.\n\n\n\n````python\n\n \"\"\"DefaultAzureCredential\ - \ will use the values from these environment\n variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,\ - \ AZURE_CLIENT_SECRET\n \"\"\"\n from azure.ai.formrecognizer.aio import FormTrainingClient\n\ - \ from azure.identity.aio import DefaultAzureCredential\n\n endpoint = os.environ[\"\ - AZURE_FORM_RECOGNIZER_ENDPOINT\"]\n credential = DefaultAzureCredential()\n\n\ - \ form_training_client = FormTrainingClient(endpoint, credential)\n\n ````\n" methods: - uid: azure.ai.formrecognizer.aio.FormTrainingClient.begin_copy_model name: begin_copy_model @@ -122,20 +99,6 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Copy a model from the source resource to the target resource\n\n\n\n````python\n\n source_client\ - \ = FormTrainingClient(endpoint=source_endpoint, credential=AzureKeyCredential(source_key))\n\ - \n async with source_client:\n poller = await source_client.begin_copy_model(\n\ - \ model_id=source_model_id,\n target=target # output from\ - \ target client's call to get_copy_authorization()\n )\n copied_over_model\ - \ = await poller.result()\n\n print(\"Model ID: {}\".format(copied_over_model.model_id))\n\ - \ print(\"Status: {}\".format(copied_over_model.status))\n\n ````\n" - uid: azure.ai.formrecognizer.aio.FormTrainingClient.begin_create_composed_model name: begin_create_composed_model summary: 'Creates a composed model from a collection of existing models that were @@ -176,43 +139,6 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Create a composed model\n\n\n\n````python\n\n from azure.core.credentials import AzureKeyCredential\n\ - \ from azure.ai.formrecognizer.aio import FormTrainingClient\n\n endpoint\ - \ = os.environ[\"AZURE_FORM_RECOGNIZER_ENDPOINT\"]\n key = os.environ[\"AZURE_FORM_RECOGNIZER_KEY\"\ - ]\n po_supplies = os.environ['PURCHASE_ORDER_OFFICE_SUPPLIES_SAS_URL_V2']\n\ - \ po_equipment = os.environ['PURCHASE_ORDER_OFFICE_EQUIPMENT_SAS_URL_V2']\n\ - \ po_furniture = os.environ['PURCHASE_ORDER_OFFICE_FURNITURE_SAS_URL_V2']\n\ - \ po_cleaning_supplies = os.environ['PURCHASE_ORDER_OFFICE_CLEANING_SUPPLIES_SAS_URL_V2']\n\ - \n form_training_client = FormTrainingClient(endpoint=endpoint, credential=AzureKeyCredential(key))\n\ - \ async with form_training_client:\n supplies_poller = await form_training_client.begin_training(\n\ - \ po_supplies, use_training_labels=True, model_name=\"Purchase order\ - \ - Office supplies\"\n )\n equipment_poller = await form_training_client.begin_training(\n\ - \ po_equipment, use_training_labels=True, model_name=\"Purchase order\ - \ - Office Equipment\"\n )\n furniture_poller = await form_training_client.begin_training(\n\ - \ po_furniture, use_training_labels=True, model_name=\"Purchase order\ - \ - Furniture\"\n )\n cleaning_supplies_poller = await form_training_client.begin_training(\n\ - \ po_cleaning_supplies, use_training_labels=True, model_name=\"Purchase\ - \ order - Cleaning Supplies\"\n )\n supplies_model = await supplies_poller.result()\n\ - \ equipment_model = await equipment_poller.result()\n furniture_model\ - \ = await furniture_poller.result()\n cleaning_supplies_model = await cleaning_supplies_poller.result()\n\ - \n models_trained_with_labels = [\n supplies_model.model_id,\n\ - \ equipment_model.model_id,\n furniture_model.model_id,\n\ - \ cleaning_supplies_model.model_id\n ]\n\n poller = await\ - \ form_training_client.begin_create_composed_model(\n models_trained_with_labels,\ - \ model_name=\"Office Supplies Composed Model\"\n )\n model = await\ - \ poller.result()\n\n print(\"Office Supplies Composed Model Info:\")\n print(\"\ - Model ID: {}\".format(model.model_id))\n print(\"Model name: {}\".format(model.model_name))\n\ - \ print(\"Is this a composed model?: {}\".format(model.properties.is_composed_model))\n\ - \ print(\"Status: {}\".format(model.status))\n print(\"Composed model creation\ - \ started on: {}\".format(model.training_started_on))\n print(\"Creation completed\ - \ on: {}\".format(model.training_completed_on))\n\n\n ````\n" - uid: azure.ai.formrecognizer.aio.FormTrainingClient.begin_training name: begin_training summary: 'Create and train a custom model. The request must include a *training_files_url* @@ -298,31 +224,6 @@ methods: "invalid" status is still created. You can delete this model by calling' - type: azure.ai.formrecognizer.aio.FormTrainingClient.delete_model - examples: - - "Training a model (without labels) with your custom forms.\n\n\n\n````python\n\n from azure.ai.formrecognizer.aio\ - \ import FormTrainingClient\n from azure.core.credentials import AzureKeyCredential\n\ - \n endpoint = os.environ[\"AZURE_FORM_RECOGNIZER_ENDPOINT\"]\n key = os.environ[\"\ - AZURE_FORM_RECOGNIZER_KEY\"]\n container_sas_url = os.environ[\"CONTAINER_SAS_URL_V2\"\ - ]\n\n async with FormTrainingClient(\n endpoint, AzureKeyCredential(key)\n\ - \ ) as form_training_client:\n\n poller = await form_training_client.begin_training(container_sas_url,\ - \ use_training_labels=False)\n model = await poller.result()\n\n #\ - \ Custom model information\n print(\"Model ID: {}\".format(model.model_id))\n\ - \ print(\"Status: {}\".format(model.status))\n print(\"Model name:\ - \ {}\".format(model.model_name))\n print(\"Training started on: {}\".format(model.training_started_on))\n\ - \ print(\"Training completed on: {}\".format(model.training_completed_on))\n\ - \n print(\"Recognized fields:\")\n # Looping through the submodels,\ - \ which contains the fields they were trained on\n for submodel in model.submodels:\n\ - \ print(\"...The submodel has form type '{}'\".format(submodel.form_type))\n\ - \ for name, field in submodel.fields.items():\n print(\"\ - ...The model found field '{}' to have label '{}'\".format(\n \ - \ name, field.label\n ))\n\n ````\n" - uid: azure.ai.formrecognizer.aio.FormTrainingClient.close name: close summary: Close the session. @@ -345,17 +246,6 @@ methods: exceptions: - type: azure.core.exceptions.HttpResponseError - type: azure.core.exceptions.ResourceNotFoundError - examples: - - "Delete a custom model.\n\n\n\n````python\n\n await form_training_client.delete_model(model_id=custom_model.model_id)\n\ - \n try:\n await form_training_client.get_custom_model(model_id=custom_model.model_id)\n\ - \ except ResourceNotFoundError:\n print(\"Successfully deleted model with\ - \ id {}\".format(custom_model.model_id))\n\n ````\n" - uid: azure.ai.formrecognizer.aio.FormTrainingClient.get_account_properties name: get_account_properties summary: Get information about the models on the form recognizer account. @@ -368,20 +258,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Get properties for the form recognizer account.\n\n\n\n````python\n\ - \n async with FormTrainingClient(\n endpoint=endpoint, credential=AzureKeyCredential(key)\n\ - \ ) as form_training_client:\n # First, we see how many custom models\ - \ we have, and what our limit is\n account_properties = await form_training_client.get_account_properties()\n\ - \ print(\"Our account has {} custom models, and we can have at most {} custom\ - \ models\\n\".format(\n account_properties.custom_model_count, account_properties.custom_model_limit\n\ - \ ))\n\n ````\n" - uid: azure.ai.formrecognizer.aio.FormTrainingClient.get_copy_authorization name: get_copy_authorization summary: 'Generate authorization for copying a custom model into the target Form @@ -420,20 +296,6 @@ methods: - [, [, ]] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Authorize the target resource to receive the copied model\n\n\n\n````python\n\n target_client\ - \ = FormTrainingClient(endpoint=target_endpoint, credential=AzureKeyCredential(target_key))\n\ - \n async with target_client:\n target = await target_client.get_copy_authorization(\n\ - \ resource_region=target_region,\n resource_id=target_resource_id\n\ - \ )\n # model ID that target client will use to access the model once\ - \ copy is complete\n print(\"Model ID: {}\".format(target[\"modelId\"]))\n\n\ - \ ````\n" - uid: azure.ai.formrecognizer.aio.FormTrainingClient.get_custom_model name: get_custom_model summary: 'Get a description of a custom model, including the types of forms @@ -453,21 +315,6 @@ methods: exceptions: - type: azure.core.exceptions.HttpResponseError - type: azure.core.exceptions.ResourceNotFoundError - examples: - - "Get a custom model with a model ID.\n\n\n\n````python\n\ - \n custom_model = await form_training_client.get_custom_model(model_id=model_info.model_id)\n\ - \ print(\"\\nModel ID: {}\".format(custom_model.model_id))\n print(\"Status:\ - \ {}\".format(custom_model.status))\n print(\"Model name: {}\".format(custom_model.model_name))\n\ - \ print(\"Is this a composed model?: {}\".format(custom_model.properties.is_composed_model))\n\ - \ print(\"Training started on: {}\".format(custom_model.training_started_on))\n\ - \ print(\"Training completed on: {}\".format(custom_model.training_completed_on))\n\ - \n ````\n" - uid: azure.ai.formrecognizer.aio.FormTrainingClient.get_form_recognizer_client name: get_form_recognizer_client summary: Get an instance of a FormRecognizerClient from FormTrainingClient. @@ -488,14 +335,3 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "List model information for each model on the account.\n\n\n\n````python\n\ - \n custom_models = form_training_client.list_custom_models()\n\n print(\"\ - We have models with the following IDs:\")\n async for model in custom_models:\n\ - \ print(model.model_id)\n\n ````\n" diff --git a/preview/docs-ref-autogen/azure-ai-ml/azure.ai.ml.operations.ModelOperations.yml b/preview/docs-ref-autogen/azure-ai-ml/azure.ai.ml.operations.ModelOperations.yml index f84927c3a931..3f12217491be 100644 --- a/preview/docs-ref-autogen/azure-ai-ml/azure.ai.ml.operations.ModelOperations.yml +++ b/preview/docs-ref-autogen/azure-ai-ml/azure.ai.ml.operations.ModelOperations.yml @@ -71,7 +71,7 @@ methods: - uid: azure.ai.ml.operations.ModelOperations.download name: download summary: Download files related to a model. - signature: 'download(name: str, version: str, download_path: PathLike | str = ''D:\\a\\_work\\1\\s\\dist_temp\\140\\azure-ai-ml-0.1.0b8\\doc'') + signature: 'download(name: str, version: str, download_path: PathLike | str = ''D:\\a\\_work\\1\\s\\source_code\\140\\azure_ai_ml-0.1.0b8\\doc'') -> None' parameters: - name: name diff --git a/preview/docs-ref-autogen/azure-ai-textanalytics/azure.ai.textanalytics.AnalyzeHealthcareEntitiesLROPoller.yml b/preview/docs-ref-autogen/azure-ai-textanalytics/azure.ai.textanalytics.AnalyzeHealthcareEntitiesLROPoller.yml index 1fd9ff867a68..05f5d65b3750 100644 --- a/preview/docs-ref-autogen/azure-ai-textanalytics/azure.ai.textanalytics.AnalyzeHealthcareEntitiesLROPoller.yml +++ b/preview/docs-ref-autogen/azure-ai-textanalytics/azure.ai.textanalytics.AnalyzeHealthcareEntitiesLROPoller.yml @@ -32,40 +32,6 @@ methods: exceptions: - type: azure.core.exceptions.HttpResponseError description: When the operation has already reached a terminal state. - examples: - - "Cancel an existing health operation.\n\n\n\n````python\n\ - \n import os\n from azure.core.exceptions import HttpResponseError\n from\ - \ azure.core.credentials import AzureKeyCredential\n from azure.ai.textanalytics\ - \ import TextAnalyticsClient\n\n endpoint = os.environ[\"AZURE_LANGUAGE_ENDPOINT\"\ - ]\n key = os.environ[\"AZURE_LANGUAGE_KEY\"]\n\n text_analytics_client = TextAnalyticsClient(\n\ - \ endpoint=endpoint,\n credential=AzureKeyCredential(key),\n )\n\ - \n documents = [\n \"RECORD #333582770390100 | MH | 85986313 | | 054351\ - \ | 2/14/2001 12:00:00 AM | \\\n CORONARY ARTERY DISEASE | Signed | DIS\ - \ | Admission Date: 5/22/2001 \\\n Report Status: Signed Discharge Date:\ - \ 4/24/2001 ADMISSION DIAGNOSIS: \\\n CORONARY ARTERY DISEASE. HISTORY OF\ - \ PRESENT ILLNESS: \\\n The patient is a 54-year-old gentleman with a history\ - \ of progressive angina over the past several months. \\\n The patient had\ - \ a cardiac catheterization in July of this year revealing total occlusion of\ - \ the RCA and \\\n 50% left main disease , with a strong family history\ - \ of coronary artery disease with a brother dying at \\\n the age of 52\ - \ from a myocardial infarction and another brother who is status post coronary\ - \ artery bypass grafting. \\\n The patient had a stress echocardiogram done\ - \ on July , 2001 , which showed no wall motion abnormalities ,\\\n but this\ - \ was a difficult study due to body habitus. The patient went for six minutes\ - \ with minimal ST depressions \\\n in the anterior lateral leads , thought\ - \ due to fatigue and wrist pain , his anginal equivalent. Due to the patient's\ - \ \\\n increased symptoms and family history and history left main disease\ - \ with total occasional of his RCA was referred \\\n for revascularization\ - \ with open heart surgery.\"\n ]\n\n poller = text_analytics_client.begin_analyze_healthcare_entities(documents)\n\ - \n try:\n poller.cancel()\n except HttpResponseError as e:\n #\ - \ If the operation has already reached a terminal state it cannot be cancelled.\n\ - \ print(e)\n\n else:\n print(\"Healthcare entities analysis was\ - \ successfully cancelled.\")\n\n\n ````\n" - uid: azure.ai.textanalytics.AnalyzeHealthcareEntitiesLROPoller.polling_method name: polling_method summary: Return the polling method associated to this poller. diff --git a/preview/docs-ref-autogen/azure-ai-textanalytics/azure.ai.textanalytics.TextAnalyticsClient.yml b/preview/docs-ref-autogen/azure-ai-textanalytics/azure.ai.textanalytics.TextAnalyticsClient.yml index afbd1011e7bd..9f7720ae5eb6 100644 --- a/preview/docs-ref-autogen/azure-ai-textanalytics/azure.ai.textanalytics.TextAnalyticsClient.yml +++ b/preview/docs-ref-autogen/azure-ai-textanalytics/azure.ai.textanalytics.TextAnalyticsClient.yml @@ -64,27 +64,6 @@ constructor: types: - - -examples: -- "Creating the TextAnalyticsClient with endpoint and API key.\n\n\n\n````python\n\n import os\n from azure.core.credentials import AzureKeyCredential\n\ - \ from azure.ai.textanalytics import TextAnalyticsClient\n endpoint = os.environ[\"\ - AZURE_LANGUAGE_ENDPOINT\"]\n key = os.environ[\"AZURE_LANGUAGE_KEY\"]\n\n text_analytics_client\ - \ = TextAnalyticsClient(endpoint, AzureKeyCredential(key))\n\n ````\n\nCreating\ - \ the TextAnalyticsClient with endpoint and token credential from Azure Active Directory.\n\n\n\n````python\n\n import os\n from azure.ai.textanalytics import TextAnalyticsClient\n\ - \ from azure.identity import DefaultAzureCredential\n\n endpoint = os.environ[\"\ - AZURE_LANGUAGE_ENDPOINT\"]\n credential = DefaultAzureCredential()\n\n text_analytics_client\ - \ = TextAnalyticsClient(endpoint, credential=credential)\n\n ````\n" methods: - uid: azure.ai.textanalytics.TextAnalyticsClient.analyze_sentiment name: analyze_sentiment @@ -220,33 +199,6 @@ methods: - type: azure.core.exceptions.HttpResponseError - type: TypeError - type: ValueError - examples: - - "Analyze sentiment in a batch of documents.\n\n\n\n````python\n\ - \n import os\n from azure.core.credentials import AzureKeyCredential\n from\ - \ azure.ai.textanalytics import TextAnalyticsClient\n\n endpoint = os.environ[\"\ - AZURE_LANGUAGE_ENDPOINT\"]\n key = os.environ[\"AZURE_LANGUAGE_KEY\"]\n\n \ - \ text_analytics_client = TextAnalyticsClient(endpoint=endpoint, credential=AzureKeyCredential(key))\n\ - \n documents = [\n \"\"\"I had the best day of my life. I decided to go\ - \ sky-diving and it made me appreciate my whole life so much more.\n I developed\ - \ a deep-connection with my instructor as well, and I feel as if I've made a life-long\ - \ friend in her.\"\"\",\n \"\"\"This was a waste of my time. All of the\ - \ views on this drop are extremely boring, all I saw was grass. 0/10 would\n \ - \ not recommend to any divers, even first timers.\"\"\",\n \"\"\"This\ - \ was pretty good! The sights were ok, and I had fun with my instructors! Can't\ - \ complain too much about my experience\"\"\",\n \"\"\"I only have one word\ - \ for my experience: WOW!!! I can't believe I have had such a wonderful skydiving\ - \ company right\n in my backyard this whole time! I will definitely be a\ - \ repeat customer, and I want to take my grandmother skydiving too,\n I\ - \ know she'll love it!\"\"\"\n ]\n\n\n result = text_analytics_client.analyze_sentiment(documents,\ - \ show_opinion_mining=True)\n docs = [doc for doc in result if not doc.is_error]\n\ - \n print(\"Let's visualize the sentiment of each of these documents\")\n for\ - \ idx, doc in enumerate(docs):\n print(f\"Document text: {documents[idx]}\"\ - )\n print(f\"Overall sentiment: {doc.sentiment}\")\n\n ````\n" - uid: azure.ai.textanalytics.TextAnalyticsClient.begin_abstractive_summary name: begin_abstractive_summary summary: 'Start a long-running abstractive summarization operation. @@ -382,48 +334,6 @@ methods: - ]] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Perform abstractive summarization on a batch of documents.\n\n\n\n````python\n\n import os\n from azure.core.credentials\ - \ import AzureKeyCredential\n from azure.ai.textanalytics import TextAnalyticsClient\n\ - \n endpoint = os.environ[\"AZURE_LANGUAGE_ENDPOINT\"]\n key = os.environ[\"\ - AZURE_LANGUAGE_KEY\"]\n\n text_analytics_client = TextAnalyticsClient(\n \ - \ endpoint=endpoint,\n credential=AzureKeyCredential(key),\n )\n\n\ - \ document = [\n \"At Microsoft, we have been on a quest to advance AI\ - \ beyond existing techniques, by taking a more holistic, \"\n \"human-centric\ - \ approach to learning and understanding. As Chief Technology Officer of Azure\ - \ AI Cognitive \"\n \"Services, I have been working with a team of amazing\ - \ scientists and engineers to turn this quest into a \"\n \"reality. In\ - \ my role, I enjoy a unique perspective in viewing the relationship among three\ - \ attributes of \"\n \"human cognition: monolingual text (X), audio or visual\ - \ sensory signals, (Y) and multilingual (Z). At the \"\n \"intersection\ - \ of all three, there's magic-what we call XYZ-code as illustrated in Figure 1-a\ - \ joint \"\n \"representation to create more powerful AI that can speak,\ - \ hear, see, and understand humans better. \"\n \"We believe XYZ-code will\ - \ enable us to fulfill our long-term vision: cross-domain transfer learning, \"\ - \n \"spanning modalities and languages. The goal is to have pretrained models\ - \ that can jointly learn \"\n \"representations to support a broad range\ - \ of downstream AI tasks, much in the way humans do today. \"\n \"Over the\ - \ past five years, we have achieved human performance on benchmarks in conversational\ - \ speech \"\n \"recognition, machine translation, conversational question\ - \ answering, machine reading comprehension, \"\n \"and image captioning.\ - \ These five breakthroughs provided us with strong signals toward our more ambitious\ - \ \"\n \"aspiration to produce a leap in AI capabilities, achieving multisensory\ - \ and multilingual learning that \"\n \"is closer in line with how humans\ - \ learn and understand. I believe the joint XYZ-code is a foundational \"\n \ - \ \"component of this aspiration, if grounded with external knowledge sources\ - \ in the downstream AI tasks.\"\n ]\n\n poller = text_analytics_client.begin_abstractive_summary(document)\n\ - \ abstractive_summary_results = poller.result()\n for result in abstractive_summary_results:\n\ - \ if result.kind == \"AbstractiveSummarization\":\n print(\"Summaries\ - \ abstracted:\")\n [print(f\"{summary.text}\\n\") for summary in result.summaries]\n\ - \ elif result.is_error is True:\n print(\"...Is an error with\ - \ code '{}' and message '{}'\".format(\n result.error.code, result.error.message\n\ - \ ))\n\n ````\n" - uid: azure.ai.textanalytics.TextAnalyticsClient.begin_analyze_actions name: begin_analyze_actions summary: 'Start a long-running operation to perform a variety of text analysis actions @@ -610,73 +520,6 @@ methods: - type: azure.core.exceptions.HttpResponseError - type: TypeError - type: ValueError - examples: - - "Start a long-running operation to perform a variety of text analysis\nactions\ - \ over a batch of documents.\n\n\n\n````python\n\ - \n import os\n from azure.core.credentials import AzureKeyCredential\n from\ - \ azure.ai.textanalytics import (\n TextAnalyticsClient,\n RecognizeEntitiesAction,\n\ - \ RecognizeLinkedEntitiesAction,\n RecognizePiiEntitiesAction,\n \ - \ ExtractKeyPhrasesAction,\n AnalyzeSentimentAction,\n )\n\n endpoint\ - \ = os.environ[\"AZURE_LANGUAGE_ENDPOINT\"]\n key = os.environ[\"AZURE_LANGUAGE_KEY\"\ - ]\n\n text_analytics_client = TextAnalyticsClient(\n endpoint=endpoint,\n\ - \ credential=AzureKeyCredential(key),\n )\n\n documents = [\n \ - \ 'We went to Contoso Steakhouse located at midtown NYC last week for a dinner\ - \ party, and we adore the spot! '\n 'They provide marvelous food and they\ - \ have a great menu. The chief cook happens to be the owner (I think his name\ - \ is John Doe) '\n 'and he is super nice, coming out of the kitchen and\ - \ greeted us all.'\n ,\n\n 'We enjoyed very much dining in the place!\ - \ '\n 'The Sirloin steak I ordered was tender and juicy, and the place was\ - \ impeccably clean. You can even pre-order from their '\n 'online menu at\ - \ www.contososteakhouse.com, call 312-555-0176 or send email to order@contososteakhouse.com!\ - \ '\n 'The only complaint I have is the food didn\\'t come fast enough.\ - \ Overall I highly recommend it!'\n ]\n\n poller = text_analytics_client.begin_analyze_actions(\n\ - \ documents,\n display_name=\"Sample Text Analysis\",\n actions=[\n\ - \ RecognizeEntitiesAction(),\n RecognizePiiEntitiesAction(),\n\ - \ ExtractKeyPhrasesAction(),\n RecognizeLinkedEntitiesAction(),\n\ - \ AnalyzeSentimentAction(),\n ],\n )\n\n document_results\ - \ = poller.result()\n for doc, action_results in zip(documents, document_results):\n\ - \ print(f\"\\nDocument text: {doc}\")\n for result in action_results:\n\ - \ if result.kind == \"EntityRecognition\":\n print(\"\ - ...Results of Recognize Entities Action:\")\n for entity in result.entities:\n\ - \ print(f\"......Entity: {entity.text}\")\n \ - \ print(f\".........Category: {entity.category}\")\n print(f\"\ - .........Confidence Score: {entity.confidence_score}\")\n print(f\"\ - .........Offset: {entity.offset}\")\n\n elif result.kind == \"PiiEntityRecognition\"\ - :\n print(\"...Results of Recognize PII Entities action:\")\n \ - \ for pii_entity in result.entities:\n print(f\"\ - ......Entity: {pii_entity.text}\")\n print(f\".........Category:\ - \ {pii_entity.category}\")\n print(f\".........Confidence Score:\ - \ {pii_entity.confidence_score}\")\n\n elif result.kind == \"KeyPhraseExtraction\"\ - :\n print(\"...Results of Extract Key Phrases action:\")\n \ - \ print(f\"......Key Phrases: {result.key_phrases}\")\n\n elif\ - \ result.kind == \"EntityLinking\":\n print(\"...Results of Recognize\ - \ Linked Entities action:\")\n for linked_entity in result.entities:\n\ - \ print(f\"......Entity name: {linked_entity.name}\")\n \ - \ print(f\".........Data source: {linked_entity.data_source}\")\n\ - \ print(f\".........Data source language: {linked_entity.language}\"\ - )\n print(\n f\".........Data source entity\ - \ ID: {linked_entity.data_source_entity_id}\"\n )\n \ - \ print(f\".........Data source URL: {linked_entity.url}\")\n \ - \ print(\".........Document matches:\")\n for match\ - \ in linked_entity.matches:\n print(f\"............Match\ - \ text: {match.text}\")\n print(f\"............Confidence\ - \ Score: {match.confidence_score}\")\n print(f\"............Offset:\ - \ {match.offset}\")\n print(f\"............Length: {match.length}\"\ - )\n\n elif result.kind == \"SentimentAnalysis\":\n print(\"\ - ...Results of Analyze Sentiment action:\")\n print(f\"......Overall\ - \ sentiment: {result.sentiment}\")\n print(\n \ - \ f\"......Scores: positive={result.confidence_scores.positive}; \\\n \ - \ neutral={result.confidence_scores.neutral}; \\\n \ - \ negative={result.confidence_scores.negative} \\n\"\n )\n\n \ - \ elif result.is_error is True:\n print(\n \ - \ f\"...Is an error with code '{result.error.code}' and message '{result.error.message}'\"\ - \n )\n\n print(\"------------------------------------------\"\ - )\n\n\n ````\n" - uid: azure.ai.textanalytics.TextAnalyticsClient.begin_analyze_healthcare_entities name: begin_analyze_healthcare_entities summary: 'Analyze healthcare entities and identify relationships between these entities @@ -847,45 +690,6 @@ methods: - type: azure.core.exceptions.HttpResponseError - type: TypeError - type: ValueError - examples: - - "Recognize healthcare entities in a batch of documents.\n\n\n\n````python\n\n import os\n import typing\n\ - \ from azure.core.credentials import AzureKeyCredential\n from azure.ai.textanalytics\ - \ import TextAnalyticsClient, HealthcareEntityRelation\n\n endpoint = os.environ[\"\ - AZURE_LANGUAGE_ENDPOINT\"]\n key = os.environ[\"AZURE_LANGUAGE_KEY\"]\n\n \ - \ text_analytics_client = TextAnalyticsClient(\n endpoint=endpoint,\n \ - \ credential=AzureKeyCredential(key),\n )\n\n documents = [\n \"\ - \"\"\n Patient needs to take 100 mg of ibuprofen, and 3 mg of potassium.\ - \ Also needs to take\n 10 mg of Zocor.\n \"\"\",\n \"\"\"\n\ - \ Patient needs to take 50 mg of ibuprofen, and 2 mg of Coumadin.\n \ - \ \"\"\"\n ]\n\n poller = text_analytics_client.begin_analyze_healthcare_entities(documents)\n\ - \ result = poller.result()\n\n docs = [doc for doc in result if not doc.is_error]\n\ - \n print(\"Let's first visualize the outputted healthcare result:\")\n for\ - \ doc in docs:\n for entity in doc.entities:\n print(f\"Entity:\ - \ {entity.text}\")\n print(f\"...Normalized Text: {entity.normalized_text}\"\ - )\n print(f\"...Category: {entity.category}\")\n print(f\"\ - ...Subcategory: {entity.subcategory}\")\n print(f\"...Offset: {entity.offset}\"\ - )\n print(f\"...Confidence score: {entity.confidence_score}\")\n \ - \ if entity.data_sources is not None:\n print(\"...Data Sources:\"\ - )\n for data_source in entity.data_sources:\n \ - \ print(f\"......Entity ID: {data_source.entity_id}\")\n print(f\"\ - ......Name: {data_source.name}\")\n if entity.assertion is not None:\n\ - \ print(\"...Assertion:\")\n print(f\"......Conditionality:\ - \ {entity.assertion.conditionality}\")\n print(f\"......Certainty:\ - \ {entity.assertion.certainty}\")\n print(f\"......Association:\ - \ {entity.assertion.association}\")\n for relation in doc.entity_relations:\n\ - \ print(f\"Relation of type: {relation.relation_type} has the following\ - \ roles\")\n for role in relation.roles:\n print(f\"...Role\ - \ '{role.name}' with entity '{role.entity.text}'\")\n print(\"------------------------------------------\"\ - )\n\n print(\"Now, let's get all of medication dosage relations from the documents\"\ - )\n dosage_of_medication_relations = [\n entity_relation\n for doc\ - \ in docs\n for entity_relation in doc.entity_relations if entity_relation.relation_type\ - \ == HealthcareEntityRelation.DOSAGE_OF_MEDICATION\n ]\n\n ````\n" - uid: azure.ai.textanalytics.TextAnalyticsClient.begin_extract_summary name: begin_extract_summary summary: 'Start a long-running extractive summarization operation. @@ -1013,48 +817,6 @@ methods: - ]] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Perform extractive summarization on a batch of documents.\n\n\n\n````python\n\n import os\n from azure.core.credentials\ - \ import AzureKeyCredential\n from azure.ai.textanalytics import TextAnalyticsClient\n\ - \n endpoint = os.environ[\"AZURE_LANGUAGE_ENDPOINT\"]\n key = os.environ[\"\ - AZURE_LANGUAGE_KEY\"]\n\n text_analytics_client = TextAnalyticsClient(\n \ - \ endpoint=endpoint,\n credential=AzureKeyCredential(key),\n )\n\n\ - \ document = [\n \"At Microsoft, we have been on a quest to advance AI\ - \ beyond existing techniques, by taking a more holistic, \"\n \"human-centric\ - \ approach to learning and understanding. As Chief Technology Officer of Azure\ - \ AI Cognitive \"\n \"Services, I have been working with a team of amazing\ - \ scientists and engineers to turn this quest into a \"\n \"reality. In\ - \ my role, I enjoy a unique perspective in viewing the relationship among three\ - \ attributes of \"\n \"human cognition: monolingual text (X), audio or visual\ - \ sensory signals, (Y) and multilingual (Z). At the \"\n \"intersection\ - \ of all three, there's magic-what we call XYZ-code as illustrated in Figure 1-a\ - \ joint \"\n \"representation to create more powerful AI that can speak,\ - \ hear, see, and understand humans better. \"\n \"We believe XYZ-code will\ - \ enable us to fulfill our long-term vision: cross-domain transfer learning, \"\ - \n \"spanning modalities and languages. The goal is to have pretrained models\ - \ that can jointly learn \"\n \"representations to support a broad range\ - \ of downstream AI tasks, much in the way humans do today. \"\n \"Over the\ - \ past five years, we have achieved human performance on benchmarks in conversational\ - \ speech \"\n \"recognition, machine translation, conversational question\ - \ answering, machine reading comprehension, \"\n \"and image captioning.\ - \ These five breakthroughs provided us with strong signals toward our more ambitious\ - \ \"\n \"aspiration to produce a leap in AI capabilities, achieving multisensory\ - \ and multilingual learning that \"\n \"is closer in line with how humans\ - \ learn and understand. I believe the joint XYZ-code is a foundational \"\n \ - \ \"component of this aspiration, if grounded with external knowledge sources\ - \ in the downstream AI tasks.\"\n ]\n\n poller = text_analytics_client.begin_extract_summary(document)\n\ - \ extract_summary_results = poller.result()\n for result in extract_summary_results:\n\ - \ if result.kind == \"ExtractiveSummarization\":\n print(\"Summary\ - \ extracted: \\n{}\".format(\n \" \".join([sentence.text for sentence\ - \ in result.sentences]))\n )\n elif result.is_error is True:\n\ - \ print(\"...Is an error with code '{}' and message '{}'\".format(\n\ - \ result.error.code, result.error.message\n ))\n\n ````\n" - uid: azure.ai.textanalytics.TextAnalyticsClient.begin_multi_label_classify name: begin_multi_label_classify summary: 'Start a long-running custom multi label classification operation. @@ -1176,34 +938,6 @@ methods: - ]] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Perform multi label classification on a batch of documents.\n\n\n\n````python\n\n import os\n from azure.core.credentials\ - \ import AzureKeyCredential\n from azure.ai.textanalytics import TextAnalyticsClient\n\ - \n endpoint = os.environ[\"AZURE_LANGUAGE_ENDPOINT\"]\n key = os.environ[\"\ - AZURE_LANGUAGE_KEY\"]\n project_name = os.environ[\"MULTI_LABEL_CLASSIFY_PROJECT_NAME\"\ - ]\n deployment_name = os.environ[\"MULTI_LABEL_CLASSIFY_DEPLOYMENT_NAME\"]\n\ - \ path_to_sample_document = os.path.abspath(\n os.path.join(\n \ - \ os.path.abspath(__file__),\n \"..\",\n \"./text_samples/custom_classify_sample.txt\"\ - ,\n )\n )\n\n text_analytics_client = TextAnalyticsClient(\n endpoint=endpoint,\n\ - \ credential=AzureKeyCredential(key),\n )\n\n with open(path_to_sample_document)\ - \ as fd:\n document = [fd.read()]\n\n poller = text_analytics_client.begin_multi_label_classify(\n\ - \ document,\n project_name=project_name,\n deployment_name=deployment_name\n\ - \ )\n\n document_results = poller.result()\n for doc, classification_result\ - \ in zip(document, document_results):\n if classification_result.kind ==\ - \ \"CustomDocumentClassification\":\n classifications = classification_result.classifications\n\ - \ print(f\"\\nThe movie plot '{doc}' was classified as the following\ - \ genres:\\n\")\n for classification in classifications:\n \ - \ print(\"'{}' with confidence score {}.\".format(\n classification.category,\ - \ classification.confidence_score\n ))\n elif classification_result.is_error\ - \ is True:\n print(\"Movie plot '{}' has an error with code '{}' and\ - \ message '{}'\".format(\n doc, classification_result.error.code,\ - \ classification_result.error.message\n ))\n\n ````\n" - uid: azure.ai.textanalytics.TextAnalyticsClient.begin_recognize_custom_entities name: begin_recognize_custom_entities summary: 'Start a long-running custom named entity recognition operation. @@ -1336,33 +1070,6 @@ methods: - ]] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Recognize custom entities in a batch of documents.\n\n\n\n````python\n\n import os\n from azure.core.credentials\ - \ import AzureKeyCredential\n from azure.ai.textanalytics import TextAnalyticsClient\n\ - \n endpoint = os.environ[\"AZURE_LANGUAGE_ENDPOINT\"]\n key = os.environ[\"\ - AZURE_LANGUAGE_KEY\"]\n project_name = os.environ[\"CUSTOM_ENTITIES_PROJECT_NAME\"\ - ]\n deployment_name = os.environ[\"CUSTOM_ENTITIES_DEPLOYMENT_NAME\"]\n path_to_sample_document\ - \ = os.path.abspath(\n os.path.join(\n os.path.abspath(__file__),\n\ - \ \"..\",\n \"./text_samples/custom_entities_sample.txt\"\ - ,\n )\n )\n\n text_analytics_client = TextAnalyticsClient(\n endpoint=endpoint,\n\ - \ credential=AzureKeyCredential(key),\n )\n\n with open(path_to_sample_document)\ - \ as fd:\n document = [fd.read()]\n\n poller = text_analytics_client.begin_recognize_custom_entities(\n\ - \ document,\n project_name=project_name,\n deployment_name=deployment_name\n\ - \ )\n\n document_results = poller.result()\n for custom_entities_result\ - \ in document_results:\n if custom_entities_result.kind == \"CustomEntityRecognition\"\ - :\n for entity in custom_entities_result.entities:\n print(\n\ - \ \"Entity '{}' has category '{}' with confidence score of '{}'\"\ - .format(\n entity.text, entity.category, entity.confidence_score\n\ - \ )\n )\n elif custom_entities_result.is_error\ - \ is True:\n print(\"...Is an error with code '{}' and message '{}'\"\ - .format(\n custom_entities_result.error.code, custom_entities_result.error.message\n\ - \ )\n )\n\n ````\n" - uid: azure.ai.textanalytics.TextAnalyticsClient.begin_single_label_classify name: begin_single_label_classify summary: 'Start a long-running custom single label classification operation. @@ -1484,33 +1191,6 @@ methods: - ]] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Perform single label classification on a batch of documents.\n\n\n\n````python\n\n import os\n from azure.core.credentials\ - \ import AzureKeyCredential\n from azure.ai.textanalytics import TextAnalyticsClient\n\ - \n endpoint = os.environ[\"AZURE_LANGUAGE_ENDPOINT\"]\n key = os.environ[\"\ - AZURE_LANGUAGE_KEY\"]\n project_name = os.environ[\"SINGLE_LABEL_CLASSIFY_PROJECT_NAME\"\ - ]\n deployment_name = os.environ[\"SINGLE_LABEL_CLASSIFY_DEPLOYMENT_NAME\"]\n\ - \ path_to_sample_document = os.path.abspath(\n os.path.join(\n \ - \ os.path.abspath(__file__),\n \"..\",\n \"./text_samples/custom_classify_sample.txt\"\ - ,\n )\n )\n\n text_analytics_client = TextAnalyticsClient(\n endpoint=endpoint,\n\ - \ credential=AzureKeyCredential(key),\n )\n\n with open(path_to_sample_document)\ - \ as fd:\n document = [fd.read()]\n\n poller = text_analytics_client.begin_single_label_classify(\n\ - \ document,\n project_name=project_name,\n deployment_name=deployment_name\n\ - \ )\n\n document_results = poller.result()\n for doc, classification_result\ - \ in zip(document, document_results):\n if classification_result.kind ==\ - \ \"CustomDocumentClassification\":\n classification = classification_result.classifications[0]\n\ - \ print(\"The document text '{}' was classified as '{}' with confidence\ - \ score {}.\".format(\n doc, classification.category, classification.confidence_score)\n\ - \ )\n elif classification_result.is_error is True:\n \ - \ print(\"Document text '{}' has an error with code '{}' and message '{}'\".format(\n\ - \ doc, classification_result.error.code, classification_result.error.message\n\ - \ ))\n\n ````\n" - uid: azure.ai.textanalytics.TextAnalyticsClient.detect_language name: detect_language summary: 'Detect language for a batch of documents. @@ -1614,34 +1294,6 @@ methods: - type: azure.core.exceptions.HttpResponseError - type: TypeError - type: ValueError - examples: - - "Detecting language in a batch of documents.\n\n\n\n````python\n\ - \n import os\n from azure.core.credentials import AzureKeyCredential\n from\ - \ azure.ai.textanalytics import TextAnalyticsClient\n\n endpoint = os.environ[\"\ - AZURE_LANGUAGE_ENDPOINT\"]\n key = os.environ[\"AZURE_LANGUAGE_KEY\"]\n\n \ - \ text_analytics_client = TextAnalyticsClient(endpoint=endpoint, credential=AzureKeyCredential(key))\n\ - \ documents = [\n \"\"\"\n The concierge Paulette was extremely\ - \ helpful. Sadly when we arrived the elevator was broken, but with Paulette's\ - \ help we barely noticed this inconvenience.\n She arranged for our baggage\ - \ to be brought up to our room with no extra charge and gave us a free meal to\ - \ refurbish all of the calories we lost from\n walking up the stairs :).\ - \ Can't say enough good things about my experience!\n \"\"\",\n \"\ - \"\"\n \u6700\u8FD1\u7531\u4E8E\u5DE5\u4F5C\u538B\u529B\u592A\u5927\uFF0C\ - \u6211\u4EEC\u51B3\u5B9A\u53BB\u5BCC\u9152\u5E97\u5EA6\u5047\u3002\u90A3\u513F\ - \u7684\u6E29\u6CC9\u5B9E\u5728\u592A\u8212\u670D\u4E86\uFF0C\u6211\u8DDF\u6211\ - \u4E08\u592B\u90FD\u5B8C\u5168\u6062\u590D\u4E86\u5DE5\u4F5C\u524D\u7684\u9752\ - \u6625\u7CBE\u795E\uFF01\u52A0\u6CB9\uFF01\n \"\"\"\n ]\n\n result =\ - \ text_analytics_client.detect_language(documents)\n reviewed_docs = [doc for\ - \ doc in result if not doc.is_error]\n\n print(\"Let's see what language each\ - \ review is in!\")\n\n for idx, doc in enumerate(reviewed_docs):\n print(\"\ - Review #{} is in '{}', which has ISO639-1 name '{}'\\n\".format(\n idx,\ - \ doc.primary_language.name, doc.primary_language.iso6391_name\n ))\n\n\ - \ ````\n" - uid: azure.ai.textanalytics.TextAnalyticsClient.dynamic_classification name: dynamic_classification summary: 'Perform dynamic classification on a batch of documents. @@ -1771,31 +1423,6 @@ methods: - ] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Perform dynamic classification on a batch of documents.\n\n\n\n````python\n\n import os\n from azure.core.credentials\ - \ import AzureKeyCredential\n from azure.ai.textanalytics import TextAnalyticsClient\n\ - \n endpoint = os.environ[\"AZURE_LANGUAGE_ENDPOINT\"]\n key = os.environ[\"\ - AZURE_LANGUAGE_KEY\"]\n\n text_analytics_client = TextAnalyticsClient(\n \ - \ endpoint=endpoint,\n credential=AzureKeyCredential(key),\n )\n \ - \ documents = [\n \"The WHO is issuing a warning about Monkey Pox.\",\n\ - \ \"Mo Salah plays in Liverpool FC in England.\",\n ]\n result = text_analytics_client.dynamic_classification(\n\ - \ documents,\n categories=[\"Health\", \"Politics\", \"Music\", \"\ - Sports\"],\n classification_type=\"Multi\"\n )\n\n for doc, classification_result\ - \ in zip(documents, result):\n if classification_result.kind == \"DynamicClassification\"\ - :\n classifications = classification_result.classifications\n \ - \ print(f\"\\n'{doc}' classifications:\\n\")\n for classification\ - \ in classifications:\n print(\"Category '{}' with confidence score\ - \ {}.\".format(\n classification.category, classification.confidence_score\n\ - \ ))\n elif classification_result.is_error is True:\n \ - \ print(\"Document '{}' has an error with code '{}' and message '{}'\".format(\n\ - \ doc, classification_result.error.code, classification_result.error.message\n\ - \ ))\n\n ````\n" - uid: azure.ai.textanalytics.TextAnalyticsClient.extract_key_phrases name: extract_key_phrases summary: 'Extract key phrases from a batch of documents. @@ -1903,30 +1530,6 @@ methods: - type: azure.core.exceptions.HttpResponseError - type: TypeError - type: ValueError - examples: - - "Extract the key phrases in a batch of documents.\n\n\n\n````python\n\n import os\n from azure.core.credentials\ - \ import AzureKeyCredential\n from azure.ai.textanalytics import TextAnalyticsClient\n\ - \n endpoint = os.environ[\"AZURE_LANGUAGE_ENDPOINT\"]\n key = os.environ[\"\ - AZURE_LANGUAGE_KEY\"]\n\n text_analytics_client = TextAnalyticsClient(endpoint=endpoint,\ - \ credential=AzureKeyCredential(key))\n articles = [\n \"\"\"\n \ - \ Washington, D.C. Autumn in DC is a uniquely beautiful season. The leaves fall\ - \ from the trees\n in a city chock-full of forests, leaving yellow leaves\ - \ on the ground and a clearer view of the\n blue sky above...\n \"\ - \"\",\n \"\"\"\n Redmond, WA. In the past few days, Microsoft has\ - \ decided to further postpone the start date of\n its United States workers,\ - \ due to the pandemic that rages with no end in sight...\n \"\"\",\n \ - \ \"\"\"\n Redmond, WA. Employees at Microsoft can be excited about the\ - \ new coffee shop that will open on campus\n once workers no longer have\ - \ to work remotely...\n \"\"\"\n ]\n\n result = text_analytics_client.extract_key_phrases(articles)\n\ - \ for idx, doc in enumerate(result):\n if not doc.is_error:\n \ - \ print(\"Key phrases in article #{}: {}\".format(\n idx + 1,\n\ - \ \", \".join(doc.key_phrases)\n ))\n\n ````\n" - uid: azure.ai.textanalytics.TextAnalyticsClient.recognize_entities name: recognize_entities summary: 'Recognize entities for a batch of documents. @@ -2043,36 +1646,6 @@ methods: - type: azure.core.exceptions.HttpResponseError - type: TypeError - type: ValueError - examples: - - "Recognize entities in a batch of documents.\n\n\n\n````python\n\ - \n import os\n import typing\n from azure.core.credentials import AzureKeyCredential\n\ - \ from azure.ai.textanalytics import TextAnalyticsClient\n\n endpoint = os.environ[\"\ - AZURE_LANGUAGE_ENDPOINT\"]\n key = os.environ[\"AZURE_LANGUAGE_KEY\"]\n\n \ - \ text_analytics_client = TextAnalyticsClient(endpoint=endpoint, credential=AzureKeyCredential(key))\n\ - \ reviews = [\n \"\"\"I work for Foo Company, and we hired Contoso for\ - \ our annual founding ceremony. The food\n was amazing and we all can't\ - \ say enough good words about the quality and the level of service.\"\"\",\n \ - \ \"\"\"We at the Foo Company re-hired Contoso after all of our past successes\ - \ with the company.\n Though the food was still great, I feel there has\ - \ been a quality drop since their last time\n catering for us. Is anyone\ - \ else running into the same problem?\"\"\",\n \"\"\"Bar Company is over\ - \ the moon about the service we received from Contoso, the best sliders ever!!!!\"\ - \"\"\n ]\n\n result = text_analytics_client.recognize_entities(reviews)\n\ - \ result = [review for review in result if not review.is_error]\n organization_to_reviews:\ - \ typing.Dict[str, typing.List[str]] = {}\n\n for idx, review in enumerate(result):\n\ - \ for entity in review.entities:\n print(f\"Entity '{entity.text}'\ - \ has category '{entity.category}'\")\n if entity.category == 'Organization':\n\ - \ organization_to_reviews.setdefault(entity.text, [])\n \ - \ organization_to_reviews[entity.text].append(reviews[idx])\n\n for organization,\ - \ reviews in organization_to_reviews.items():\n print(\n \"\\\ - n\\nOrganization '{}' has left us the following review(s): {}\".format(\n \ - \ organization, \"\\n\\n\".join(reviews)\n )\n )\n\n\ - \ ````\n" - uid: azure.ai.textanalytics.TextAnalyticsClient.recognize_linked_entities name: recognize_linked_entities summary: 'Recognize linked entities from a well-known knowledge base for a batch @@ -2193,31 +1766,6 @@ methods: - type: azure.core.exceptions.HttpResponseError - type: TypeError - type: ValueError - examples: - - "Recognize linked entities in a batch of documents.\n\n\n\n````python\n\n import os\n from azure.core.credentials\ - \ import AzureKeyCredential\n from azure.ai.textanalytics import TextAnalyticsClient\n\ - \n endpoint = os.environ[\"AZURE_LANGUAGE_ENDPOINT\"]\n key = os.environ[\"\ - AZURE_LANGUAGE_KEY\"]\n\n text_analytics_client = TextAnalyticsClient(endpoint=endpoint,\ - \ credential=AzureKeyCredential(key))\n documents = [\n \"\"\"\n \ - \ Microsoft was founded by Bill Gates with some friends he met at Harvard. One\ - \ of his friends,\n Steve Ballmer, eventually became CEO after Bill Gates\ - \ as well. Steve Ballmer eventually stepped\n down as CEO of Microsoft,\ - \ and was succeeded by Satya Nadella.\n Microsoft originally moved its headquarters\ - \ to Bellevue, Washington in January 1979, but is now\n headquartered in\ - \ Redmond.\n \"\"\"\n ]\n\n result = text_analytics_client.recognize_linked_entities(documents)\n\ - \ docs = [doc for doc in result if not doc.is_error]\n\n print(\n \"\ - Let's map each entity to it's Wikipedia article. I also want to see how many times\ - \ each \"\n \"entity is mentioned in a document\\n\\n\"\n )\n entity_to_url\ - \ = {}\n for doc in docs:\n for entity in doc.entities:\n print(\"\ - Entity '{}' has been mentioned '{}' time(s)\".format(\n entity.name,\ - \ len(entity.matches)\n ))\n if entity.data_source == \"Wikipedia\"\ - :\n entity_to_url[entity.name] = entity.url\n\n ````\n" - uid: azure.ai.textanalytics.TextAnalyticsClient.recognize_pii_entities name: recognize_pii_entities summary: 'Recognize entities containing personal information for a batch of documents. @@ -2356,27 +1904,3 @@ methods: - type: azure.core.exceptions.HttpResponseError - type: TypeError - type: ValueError - examples: - - "Recognize personally identifiable information entities in a batch of documents.\n\n\n\n````python\n\n import os\n from azure.core.credentials\ - \ import AzureKeyCredential\n from azure.ai.textanalytics import TextAnalyticsClient\n\ - \n endpoint = os.environ[\"AZURE_LANGUAGE_ENDPOINT\"]\n key = os.environ[\"\ - AZURE_LANGUAGE_KEY\"]\n\n text_analytics_client = TextAnalyticsClient(\n \ - \ endpoint=endpoint, credential=AzureKeyCredential(key)\n )\n documents\ - \ = [\n \"\"\"Parker Doe has repaid all of their loans as of 2020-04-25.\n\ - \ Their SSN is 859-98-0987. To contact them, use their phone number\n \ - \ 555-555-5555. They are originally from Brazil and have Brazilian CPF number\ - \ 998.214.865-68\"\"\"\n ]\n\n result = text_analytics_client.recognize_pii_entities(documents)\n\ - \ docs = [doc for doc in result if not doc.is_error]\n\n print(\n \"\ - Let's compare the original document with the documents after redaction. \"\n \ - \ \"I also want to comb through all of the entities that got redacted\"\n\ - \ )\n for idx, doc in enumerate(docs):\n print(f\"Document text: {documents[idx]}\"\ - )\n print(f\"Redacted document text: {doc.redacted_text}\")\n for\ - \ entity in doc.entities:\n print(\"...Entity '{}' with category '{}'\ - \ got redacted\".format(\n entity.text, entity.category\n \ - \ ))\n\n\n ````\n" diff --git a/preview/docs-ref-autogen/azure-ai-textanalytics/azure.ai.textanalytics.aio.AsyncAnalyzeHealthcareEntitiesLROPoller.yml b/preview/docs-ref-autogen/azure-ai-textanalytics/azure.ai.textanalytics.aio.AsyncAnalyzeHealthcareEntitiesLROPoller.yml index 15ff772d2a3e..1dedc32743ba 100644 --- a/preview/docs-ref-autogen/azure-ai-textanalytics/azure.ai.textanalytics.aio.AsyncAnalyzeHealthcareEntitiesLROPoller.yml +++ b/preview/docs-ref-autogen/azure-ai-textanalytics/azure.ai.textanalytics.aio.AsyncAnalyzeHealthcareEntitiesLROPoller.yml @@ -32,42 +32,6 @@ methods: exceptions: - type: azure.core.exceptions.HttpResponseError description: When the operation has already reached a terminal state. - examples: - - "Cancel an existing health operation.\n\n\n\n````python\n\ - \n import os\n from azure.core.exceptions import HttpResponseError\n from\ - \ azure.core.credentials import AzureKeyCredential\n from azure.ai.textanalytics.aio\ - \ import TextAnalyticsClient\n\n endpoint = os.environ[\"AZURE_LANGUAGE_ENDPOINT\"\ - ]\n key = os.environ[\"AZURE_LANGUAGE_KEY\"]\n\n text_analytics_client = TextAnalyticsClient(\n\ - \ endpoint=endpoint,\n credential=AzureKeyCredential(key),\n )\n\ - \n documents = [\n \"RECORD #333582770390100 | MH | 85986313 | | 054351\ - \ | 2/14/2001 12:00:00 AM | \\\n CORONARY ARTERY DISEASE | Signed | DIS\ - \ | Admission Date: 5/22/2001 \\\n Report Status: Signed Discharge Date:\ - \ 4/24/2001 ADMISSION DIAGNOSIS: \\\n CORONARY ARTERY DISEASE. HISTORY OF\ - \ PRESENT ILLNESS: \\\n The patient is a 54-year-old gentleman with a history\ - \ of progressive angina over the past several months. \\\n The patient had\ - \ a cardiac catheterization in July of this year revealing total occlusion of\ - \ the RCA and \\\n 50% left main disease , with a strong family history\ - \ of coronary artery disease with a brother dying at \\\n the age of 52\ - \ from a myocardial infarction and another brother who is status post coronary\ - \ artery bypass grafting. \\\n The patient had a stress echocardiogram done\ - \ on July , 2001 , which showed no wall motion abnormalities ,\\\n but this\ - \ was a difficult study due to body habitus. The patient went for six minutes\ - \ with minimal ST depressions \\\n in the anterior lateral leads , thought\ - \ due to fatigue and wrist pain , his anginal equivalent. Due to the patient's\ - \ \\\n increased symptoms and family history and history left main disease\ - \ with total occasional of his RCA was referred \\\n for revascularization\ - \ with open heart surgery.\"\n ]\n\n async with text_analytics_client:\n \ - \ poller = await text_analytics_client.begin_analyze_healthcare_entities(documents)\n\ - \n try:\n await poller.cancel()\n except HttpResponseError\ - \ as e:\n # If the operation has already reached a terminal state it\ - \ cannot be cancelled.\n print(e)\n\n else:\n print(\"\ - Healthcare entities analysis was successfully cancelled.\")\n\n\n ````\n" - uid: azure.ai.textanalytics.aio.AsyncAnalyzeHealthcareEntitiesLROPoller.polling_method name: polling_method summary: Return the polling method associated to this poller. diff --git a/preview/docs-ref-autogen/azure-ai-textanalytics/azure.ai.textanalytics.aio.TextAnalyticsClient.yml b/preview/docs-ref-autogen/azure-ai-textanalytics/azure.ai.textanalytics.aio.TextAnalyticsClient.yml index f7ea5857207e..b05df2a76887 100644 --- a/preview/docs-ref-autogen/azure-ai-textanalytics/azure.ai.textanalytics.aio.TextAnalyticsClient.yml +++ b/preview/docs-ref-autogen/azure-ai-textanalytics/azure.ai.textanalytics.aio.TextAnalyticsClient.yml @@ -64,29 +64,6 @@ constructor: types: - - -examples: -- "Creating the TextAnalyticsClient with endpoint and API key.\n\n\n\n````python\n\n import os\n from\ - \ azure.core.credentials import AzureKeyCredential\n from azure.ai.textanalytics.aio\ - \ import TextAnalyticsClient\n endpoint = os.environ[\"AZURE_LANGUAGE_ENDPOINT\"\ - ]\n key = os.environ[\"AZURE_LANGUAGE_KEY\"]\n\n text_analytics_client = TextAnalyticsClient(endpoint,\ - \ AzureKeyCredential(key))\n\n ````\n\nCreating the TextAnalyticsClient with endpoint\ - \ and token credential from Azure Active Directory.\n\n\n\n````python\n\n import os\n from\ - \ azure.ai.textanalytics.aio import TextAnalyticsClient\n from azure.identity.aio\ - \ import DefaultAzureCredential\n\n endpoint = os.environ[\"AZURE_LANGUAGE_ENDPOINT\"\ - ]\n credential = DefaultAzureCredential()\n\n text_analytics_client = TextAnalyticsClient(endpoint,\ - \ credential=credential)\n\n ````\n" methods: - uid: azure.ai.textanalytics.aio.TextAnalyticsClient.analyze_sentiment name: analyze_sentiment @@ -222,34 +199,6 @@ methods: - type: azure.core.exceptions.HttpResponseError - type: TypeError - type: ValueError - examples: - - "Analyze sentiment in a batch of documents.\n\n\n\n````python\n\n import os\n\ - \ from azure.core.credentials import AzureKeyCredential\n from azure.ai.textanalytics.aio\ - \ import TextAnalyticsClient\n\n endpoint = os.environ[\"AZURE_LANGUAGE_ENDPOINT\"\ - ]\n key = os.environ[\"AZURE_LANGUAGE_KEY\"]\n\n text_analytics_client = TextAnalyticsClient(endpoint=endpoint,\ - \ credential=AzureKeyCredential(key))\n\n documents = [\n \"\"\"I had\ - \ the best day of my life. I decided to go sky-diving and it made me appreciate\ - \ my whole life so much more.\n I developed a deep-connection with my instructor\ - \ as well, and I feel as if I've made a life-long friend in her.\"\"\",\n \ - \ \"\"\"This was a waste of my time. All of the views on this drop are extremely\ - \ boring, all I saw was grass. 0/10 would\n not recommend to any divers,\ - \ even first timers.\"\"\",\n \"\"\"This was pretty good! The sights were\ - \ ok, and I had fun with my instructors! Can't complain too much about my experience\"\ - \"\",\n \"\"\"I only have one word for my experience: WOW!!! I can't believe\ - \ I have had such a wonderful skydiving company right\n in my backyard this\ - \ whole time! I will definitely be a repeat customer, and I want to take my grandmother\ - \ skydiving too,\n I know she'll love it!\"\"\"\n ]\n\n async with text_analytics_client:\n\ - \ result = await text_analytics_client.analyze_sentiment(documents)\n\n\ - \ docs = [doc for doc in result if not doc.is_error]\n\n print(\"Let's visualize\ - \ the sentiment of each of these documents\")\n for idx, doc in enumerate(docs):\n\ - \ print(f\"Document text: {documents[idx]}\")\n print(f\"Overall sentiment:\ - \ {doc.sentiment}\")\n\n ````\n" - uid: azure.ai.textanalytics.aio.TextAnalyticsClient.begin_abstractive_summary name: begin_abstractive_summary summary: 'Start a long-running abstractive summarization operation. @@ -385,50 +334,6 @@ methods: - ]] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Perform abstractive summarization on a batch of documents.\n\n\n\n````python\n\n import os\n\ - \ from azure.core.credentials import AzureKeyCredential\n from azure.ai.textanalytics.aio\ - \ import TextAnalyticsClient\n\n endpoint = os.environ[\"AZURE_LANGUAGE_ENDPOINT\"\ - ]\n key = os.environ[\"AZURE_LANGUAGE_KEY\"]\n\n text_analytics_client = TextAnalyticsClient(\n\ - \ endpoint=endpoint,\n credential=AzureKeyCredential(key),\n )\n\ - \n document = [\n \"At Microsoft, we have been on a quest to advance AI\ - \ beyond existing techniques, by taking a more holistic, \"\n \"human-centric\ - \ approach to learning and understanding. As Chief Technology Officer of Azure\ - \ AI Cognitive \"\n \"Services, I have been working with a team of amazing\ - \ scientists and engineers to turn this quest into a \"\n \"reality. In\ - \ my role, I enjoy a unique perspective in viewing the relationship among three\ - \ attributes of \"\n \"human cognition: monolingual text (X), audio or visual\ - \ sensory signals, (Y) and multilingual (Z). At the \"\n \"intersection\ - \ of all three, there's magic-what we call XYZ-code as illustrated in Figure 1-a\ - \ joint \"\n \"representation to create more powerful AI that can speak,\ - \ hear, see, and understand humans better. \"\n \"We believe XYZ-code will\ - \ enable us to fulfill our long-term vision: cross-domain transfer learning, \"\ - \n \"spanning modalities and languages. The goal is to have pretrained models\ - \ that can jointly learn \"\n \"representations to support a broad range\ - \ of downstream AI tasks, much in the way humans do today. \"\n \"Over the\ - \ past five years, we have achieved human performance on benchmarks in conversational\ - \ speech \"\n \"recognition, machine translation, conversational question\ - \ answering, machine reading comprehension, \"\n \"and image captioning.\ - \ These five breakthroughs provided us with strong signals toward our more ambitious\ - \ \"\n \"aspiration to produce a leap in AI capabilities, achieving multisensory\ - \ and multilingual learning that \"\n \"is closer in line with how humans\ - \ learn and understand. I believe the joint XYZ-code is a foundational \"\n \ - \ \"component of this aspiration, if grounded with external knowledge sources\ - \ in the downstream AI tasks.\"\n ]\n async with text_analytics_client:\n\ - \ poller = await text_analytics_client.begin_abstractive_summary(document)\n\ - \ abstractive_summary_results = await poller.result()\n async for\ - \ result in abstractive_summary_results:\n if result.kind == \"AbstractiveSummarization\"\ - :\n print(\"Summaries abstracted:\")\n [print(f\"\ - {summary.text}\\n\") for summary in result.summaries]\n elif result.is_error\ - \ is True:\n print(\"...Is an error with code '{}' and message '{}'\"\ - .format(\n result.error.code, result.error.message\n \ - \ ))\n\n ````\n" - uid: azure.ai.textanalytics.aio.TextAnalyticsClient.begin_analyze_actions name: begin_analyze_actions summary: 'Start a long-running operation to perform a variety of text analysis actions @@ -615,81 +520,6 @@ methods: - type: azure.core.exceptions.HttpResponseError - type: TypeError - type: ValueError - examples: - - "Start a long-running operation to perform a variety of text analysis actions\ - \ over\na batch of documents.\n\n\n\n````python\n\n import os\n from azure.core.credentials import\ - \ AzureKeyCredential\n from azure.ai.textanalytics.aio import TextAnalyticsClient\n\ - \ from azure.ai.textanalytics import (\n RecognizeEntitiesAction,\n \ - \ RecognizeLinkedEntitiesAction,\n RecognizePiiEntitiesAction,\n \ - \ ExtractKeyPhrasesAction,\n AnalyzeSentimentAction,\n )\n\n endpoint\ - \ = os.environ[\"AZURE_LANGUAGE_ENDPOINT\"]\n key = os.environ[\"AZURE_LANGUAGE_KEY\"\ - ]\n\n text_analytics_client = TextAnalyticsClient(\n endpoint=endpoint,\n\ - \ credential=AzureKeyCredential(key),\n )\n\n documents = [\n \ - \ 'We went to Contoso Steakhouse located at midtown NYC last week for a dinner\ - \ party, and we adore the spot! '\n 'They provide marvelous food and they\ - \ have a great menu. The chief cook happens to be the owner (I think his name\ - \ is John Doe) '\n 'and he is super nice, coming out of the kitchen and\ - \ greeted us all.'\n ,\n\n 'We enjoyed very much dining in the place!\ - \ '\n 'The Sirloin steak I ordered was tender and juicy, and the place was\ - \ impeccably clean. You can even pre-order from their '\n 'online menu at\ - \ www.contososteakhouse.com, call 312-555-0176 or send email to order@contososteakhouse.com!\ - \ '\n 'The only complaint I have is the food didn\\'t come fast enough.\ - \ Overall I highly recommend it!'\n ]\n\n async with text_analytics_client:\n\ - \ poller = await text_analytics_client.begin_analyze_actions(\n \ - \ documents,\n display_name=\"Sample Text Analysis\",\n \ - \ actions=[\n RecognizeEntitiesAction(),\n RecognizePiiEntitiesAction(),\n\ - \ ExtractKeyPhrasesAction(),\n RecognizeLinkedEntitiesAction(),\n\ - \ AnalyzeSentimentAction(),\n ]\n )\n\n pages\ - \ = await poller.result()\n\n # To enumerate / zip for async, unless you\ - \ install a third party library,\n # you have to read in all of the elements\ - \ into memory first.\n # If you're not looking to enumerate / zip, we recommend\ - \ you just asynchronously\n # loop over it immediately, without going through\ - \ this step of reading them into memory\n document_results = []\n \ - \ async for page in pages:\n document_results.append(page)\n\n for\ - \ doc, action_results in zip(documents, document_results):\n print(f\"\\\ - nDocument text: {doc}\")\n for result in action_results:\n if\ - \ result.kind == \"EntityRecognition\":\n print(\"...Results of\ - \ Recognize Entities Action:\")\n for entity in result.entities:\n\ - \ print(f\"......Entity: {entity.text}\")\n \ - \ print(f\".........Category: {entity.category}\")\n print(f\"\ - .........Confidence Score: {entity.confidence_score}\")\n print(f\"\ - .........Offset: {entity.offset}\")\n\n elif result.kind == \"PiiEntityRecognition\"\ - :\n print(\"...Results of Recognize PII Entities action:\")\n \ - \ for pii_entity in result.entities:\n print(f\"\ - ......Entity: {pii_entity.text}\")\n print(f\".........Category:\ - \ {pii_entity.category}\")\n print(f\".........Confidence Score:\ - \ {pii_entity.confidence_score}\")\n\n elif result.kind == \"KeyPhraseExtraction\"\ - :\n print(\"...Results of Extract Key Phrases action:\")\n \ - \ print(f\"......Key Phrases: {result.key_phrases}\")\n\n elif\ - \ result.kind == \"EntityLinking\":\n print(\"...Results of Recognize\ - \ Linked Entities action:\")\n for linked_entity in result.entities:\n\ - \ print(f\"......Entity name: {linked_entity.name}\")\n \ - \ print(f\".........Data source: {linked_entity.data_source}\")\n\ - \ print(f\".........Data source language: {linked_entity.language}\"\ - )\n print(\n f\".........Data source entity\ - \ ID: {linked_entity.data_source_entity_id}\"\n )\n \ - \ print(f\".........Data source URL: {linked_entity.url}\")\n \ - \ print(\".........Document matches:\")\n for match\ - \ in linked_entity.matches:\n print(f\"............Match\ - \ text: {match.text}\")\n print(f\"............Confidence\ - \ Score: {match.confidence_score}\")\n print(f\"............Offset:\ - \ {match.offset}\")\n print(f\"............Length: {match.length}\"\ - )\n\n elif result.kind == \"SentimentAnalysis\":\n print(\"\ - ...Results of Analyze Sentiment action:\")\n print(f\"......Overall\ - \ sentiment: {result.sentiment}\")\n print(\n \ - \ f\"......Scores: positive={result.confidence_scores.positive}; \\\n \ - \ neutral={result.confidence_scores.neutral}; \\\n \ - \ negative={result.confidence_scores.negative} \\n\"\n )\n\n \ - \ elif result.is_error is True:\n print(\n \ - \ f\"...Is an error with code '{result.error.code}' and message '{result.error.message}'\"\ - \n )\n\n print(\"------------------------------------------\"\ - )\n\n\n ````\n" - uid: azure.ai.textanalytics.aio.TextAnalyticsClient.begin_analyze_healthcare_entities name: begin_analyze_healthcare_entities summary: 'Analyze healthcare entities and identify relationships between these entities @@ -857,46 +687,6 @@ methods: - type: azure.core.exceptions.HttpResponseError - type: TypeError - type: ValueError - examples: - - "Analyze healthcare entities in a batch of documents.\n\n\n\n````python\n\n import os\n\ - \ import typing\n from azure.core.credentials import AzureKeyCredential\n\ - \ from azure.ai.textanalytics import HealthcareEntityRelation\n from azure.ai.textanalytics.aio\ - \ import TextAnalyticsClient\n\n endpoint = os.environ[\"AZURE_LANGUAGE_ENDPOINT\"\ - ]\n key = os.environ[\"AZURE_LANGUAGE_KEY\"]\n\n text_analytics_client = TextAnalyticsClient(\n\ - \ endpoint=endpoint,\n credential=AzureKeyCredential(key),\n )\n\ - \n documents = [\n \"\"\"\n Patient needs to take 100 mg of ibuprofen,\ - \ and 3 mg of potassium. Also needs to take\n 10 mg of Zocor.\n \"\ - \"\",\n \"\"\"\n Patient needs to take 50 mg of ibuprofen, and 2 mg\ - \ of Coumadin.\n \"\"\"\n ]\n\n async with text_analytics_client:\n\ - \ poller = await text_analytics_client.begin_analyze_healthcare_entities(documents)\n\ - \ result = await poller.result()\n docs = [doc async for doc in result\ - \ if not doc.is_error]\n\n print(\"Let's first visualize the outputted healthcare\ - \ result:\")\n for doc in docs:\n for entity in doc.entities:\n \ - \ print(f\"Entity: {entity.text}\")\n print(f\"...Normalized Text:\ - \ {entity.normalized_text}\")\n print(f\"...Category: {entity.category}\"\ - )\n print(f\"...Subcategory: {entity.subcategory}\")\n print(f\"\ - ...Offset: {entity.offset}\")\n print(f\"...Confidence score: {entity.confidence_score}\"\ - )\n if entity.data_sources is not None:\n print(\"...Data\ - \ Sources:\")\n for data_source in entity.data_sources:\n \ - \ print(f\"......Entity ID: {data_source.entity_id}\")\n \ - \ print(f\"......Name: {data_source.name}\")\n if entity.assertion\ - \ is not None:\n print(\"...Assertion:\")\n print(f\"\ - ......Conditionality: {entity.assertion.conditionality}\")\n print(f\"\ - ......Certainty: {entity.assertion.certainty}\")\n print(f\"......Association:\ - \ {entity.assertion.association}\")\n for relation in doc.entity_relations:\n\ - \ print(f\"Relation of type: {relation.relation_type} has the following\ - \ roles\")\n for role in relation.roles:\n print(f\"...Role\ - \ '{role.name}' with entity '{role.entity.text}'\")\n print(\"------------------------------------------\"\ - )\n\n print(\"Now, let's get all of medication dosage relations from the documents\"\ - )\n dosage_of_medication_relations = [\n entity_relation\n for doc\ - \ in docs\n for entity_relation in doc.entity_relations if entity_relation.relation_type\ - \ == HealthcareEntityRelation.DOSAGE_OF_MEDICATION\n ]\n\n ````\n" - uid: azure.ai.textanalytics.aio.TextAnalyticsClient.begin_extract_summary name: begin_extract_summary summary: 'Start a long-running extractive summarization operation. @@ -1024,50 +814,6 @@ methods: - ]] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Perform extractive summarization on a batch of documents.\n\n\n\n````python\n\n import os\n\ - \ from azure.core.credentials import AzureKeyCredential\n from azure.ai.textanalytics.aio\ - \ import TextAnalyticsClient\n\n endpoint = os.environ[\"AZURE_LANGUAGE_ENDPOINT\"\ - ]\n key = os.environ[\"AZURE_LANGUAGE_KEY\"]\n\n text_analytics_client = TextAnalyticsClient(\n\ - \ endpoint=endpoint,\n credential=AzureKeyCredential(key),\n )\n\ - \n document = [\n \"At Microsoft, we have been on a quest to advance AI\ - \ beyond existing techniques, by taking a more holistic, \"\n \"human-centric\ - \ approach to learning and understanding. As Chief Technology Officer of Azure\ - \ AI Cognitive \"\n \"Services, I have been working with a team of amazing\ - \ scientists and engineers to turn this quest into a \"\n \"reality. In\ - \ my role, I enjoy a unique perspective in viewing the relationship among three\ - \ attributes of \"\n \"human cognition: monolingual text (X), audio or visual\ - \ sensory signals, (Y) and multilingual (Z). At the \"\n \"intersection\ - \ of all three, there's magic-what we call XYZ-code as illustrated in Figure 1-a\ - \ joint \"\n \"representation to create more powerful AI that can speak,\ - \ hear, see, and understand humans better. \"\n \"We believe XYZ-code will\ - \ enable us to fulfill our long-term vision: cross-domain transfer learning, \"\ - \n \"spanning modalities and languages. The goal is to have pretrained models\ - \ that can jointly learn \"\n \"representations to support a broad range\ - \ of downstream AI tasks, much in the way humans do today. \"\n \"Over the\ - \ past five years, we have achieved human performance on benchmarks in conversational\ - \ speech \"\n \"recognition, machine translation, conversational question\ - \ answering, machine reading comprehension, \"\n \"and image captioning.\ - \ These five breakthroughs provided us with strong signals toward our more ambitious\ - \ \"\n \"aspiration to produce a leap in AI capabilities, achieving multisensory\ - \ and multilingual learning that \"\n \"is closer in line with how humans\ - \ learn and understand. I believe the joint XYZ-code is a foundational \"\n \ - \ \"component of this aspiration, if grounded with external knowledge sources\ - \ in the downstream AI tasks.\"\n ]\n\n async with text_analytics_client:\n\ - \ poller = await text_analytics_client.begin_extract_summary(document)\n\ - \ extract_summary_results = await poller.result()\n async for result\ - \ in extract_summary_results:\n if result.kind == \"ExtractiveSummarization\"\ - :\n print(\"Summary extracted: \\n{}\".format(\n \ - \ \" \".join([sentence.text for sentence in result.sentences]))\n \ - \ )\n elif result.is_error is True:\n print(\"...Is\ - \ an error with code '{}' and message '{}'\".format(\n result.error.code,\ - \ result.error.message\n ))\n\n ````\n" - uid: azure.ai.textanalytics.aio.TextAnalyticsClient.begin_multi_label_classify name: begin_multi_label_classify summary: 'Start a long-running custom multi label classification operation. @@ -1189,38 +935,6 @@ methods: - ]] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Perform multi label classification on a batch of documents.\n\n\n\n````python\n\n import os\n\ - \ from azure.core.credentials import AzureKeyCredential\n from azure.ai.textanalytics.aio\ - \ import TextAnalyticsClient\n\n endpoint = os.environ[\"AZURE_LANGUAGE_ENDPOINT\"\ - ]\n key = os.environ[\"AZURE_LANGUAGE_KEY\"]\n project_name = os.environ[\"\ - MULTI_LABEL_CLASSIFY_PROJECT_NAME\"]\n deployment_name = os.environ[\"MULTI_LABEL_CLASSIFY_DEPLOYMENT_NAME\"\ - ]\n path_to_sample_document = os.path.abspath(\n os.path.join(\n \ - \ os.path.abspath(__file__),\n \"..\",\n \"..\",\n \ - \ \"./text_samples/custom_classify_sample.txt\",\n )\n )\n\n \ - \ with open(path_to_sample_document) as fd:\n document = [fd.read()]\n\n\ - \ text_analytics_client = TextAnalyticsClient(\n endpoint=endpoint,\n\ - \ credential=AzureKeyCredential(key),\n )\n\n async with text_analytics_client:\n\ - \ poller = await text_analytics_client.begin_multi_label_classify(\n \ - \ document,\n project_name=project_name,\n deployment_name=deployment_name\n\ - \ )\n\n pages = await poller.result()\n document_results = []\n\ - \ async for page in pages:\n document_results.append(page)\n\n\ - \ for doc, classification_result in zip(document, document_results):\n \ - \ if classification_result.kind == \"CustomDocumentClassification\":\n \ - \ classifications = classification_result.classifications\n print(f\"\ - \\nThe movie plot '{doc}' was classified as the following genres:\\n\")\n \ - \ for classification in classifications:\n print(\"'{}' with\ - \ confidence score {}.\".format(\n classification.category,\ - \ classification.confidence_score\n ))\n elif classification_result.is_error\ - \ is True:\n print(\"Movie plot '{}' has an error with code '{}' and\ - \ message '{}'\".format(\n doc, classification_result.error.code,\ - \ classification_result.error.message\n ))\n\n ````\n" - uid: azure.ai.textanalytics.aio.TextAnalyticsClient.begin_recognize_custom_entities name: begin_recognize_custom_entities summary: 'Start a long-running custom named entity recognition operation. @@ -1354,36 +1068,6 @@ methods: - ]] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Recognize custom entities in a batch of documents.\n\n\n\n````python\n\n import os\n\ - \ from azure.core.credentials import AzureKeyCredential\n from azure.ai.textanalytics.aio\ - \ import TextAnalyticsClient\n\n endpoint = os.environ[\"AZURE_LANGUAGE_ENDPOINT\"\ - ]\n key = os.environ[\"AZURE_LANGUAGE_KEY\"]\n project_name = os.environ[\"\ - CUSTOM_ENTITIES_PROJECT_NAME\"]\n deployment_name = os.environ[\"CUSTOM_ENTITIES_DEPLOYMENT_NAME\"\ - ]\n path_to_sample_document = os.path.abspath(\n os.path.join(\n \ - \ os.path.abspath(__file__),\n \"..\",\n \"..\",\n \ - \ \"./text_samples/custom_entities_sample.txt\",\n )\n )\n\n \ - \ text_analytics_client = TextAnalyticsClient(\n endpoint=endpoint,\n \ - \ credential=AzureKeyCredential(key),\n )\n\n with open(path_to_sample_document)\ - \ as fd:\n document = [fd.read()]\n\n async with text_analytics_client:\n\ - \ poller = await text_analytics_client.begin_recognize_custom_entities(\n\ - \ document,\n project_name=project_name,\n deployment_name=deployment_name\n\ - \ )\n\n document_results = await poller.result()\n\n async for\ - \ custom_entities_result in document_results:\n if custom_entities_result.kind\ - \ == \"CustomEntityRecognition\":\n for entity in custom_entities_result.entities:\n\ - \ print(\n \"Entity '{}' has category\ - \ '{}' with confidence score of '{}'\".format(\n entity.text,\ - \ entity.category, entity.confidence_score\n )\n \ - \ )\n elif custom_entities_result.is_error is True:\n \ - \ print(\"...Is an error with code '{}' and message '{}'\".format(\n\ - \ custom_entities_result.error.code, custom_entities_result.error.message\n\ - \ )\n )\n\n ````\n" - uid: azure.ai.textanalytics.aio.TextAnalyticsClient.begin_single_label_classify name: begin_single_label_classify summary: 'Start a long-running custom single label classification operation. @@ -1505,37 +1189,6 @@ methods: - ]] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Perform single label classification on a batch of documents.\n\n\n\n````python\n\n import os\n\ - \ from azure.core.credentials import AzureKeyCredential\n from azure.ai.textanalytics.aio\ - \ import TextAnalyticsClient\n\n endpoint = os.environ[\"AZURE_LANGUAGE_ENDPOINT\"\ - ]\n key = os.environ[\"AZURE_LANGUAGE_KEY\"]\n project_name = os.environ[\"\ - SINGLE_LABEL_CLASSIFY_PROJECT_NAME\"]\n deployment_name = os.environ[\"SINGLE_LABEL_CLASSIFY_DEPLOYMENT_NAME\"\ - ]\n path_to_sample_document = os.path.abspath(\n os.path.join(\n \ - \ os.path.abspath(__file__),\n \"..\",\n \"..\",\n \ - \ \"./text_samples/custom_classify_sample.txt\",\n )\n )\n\n \ - \ text_analytics_client = TextAnalyticsClient(\n endpoint=endpoint,\n \ - \ credential=AzureKeyCredential(key),\n )\n\n with open(path_to_sample_document)\ - \ as fd:\n document = [fd.read()]\n\n async with text_analytics_client:\n\ - \ poller = await text_analytics_client.begin_single_label_classify(\n \ - \ document,\n project_name=project_name,\n deployment_name=deployment_name\n\ - \ )\n\n pages = await poller.result()\n\n document_results =\ - \ []\n async for page in pages:\n document_results.append(page)\n\ - \n for doc, classification_result in zip(document, document_results):\n \ - \ if classification_result.kind == \"CustomDocumentClassification\":\n \ - \ classification = classification_result.classifications[0]\n print(\"\ - The document text '{}' was classified as '{}' with confidence score {}.\".format(\n\ - \ doc, classification.category, classification.confidence_score)\n\ - \ )\n elif classification_result.is_error is True:\n \ - \ print(\"Document text '{}' has an error with code '{}' and message '{}'\".format(\n\ - \ doc, classification_result.error.code, classification_result.error.message\n\ - \ ))\n\n ````\n" - uid: azure.ai.textanalytics.aio.TextAnalyticsClient.detect_language name: detect_language summary: 'Detect language for a batch of documents. @@ -1637,34 +1290,6 @@ methods: - type: azure.core.exceptions.HttpResponseError - type: TypeError - type: ValueError - examples: - - "Detecting language in a batch of documents.\n\n\n\n````python\n\n import os\n\ - \ from azure.core.credentials import AzureKeyCredential\n from azure.ai.textanalytics.aio\ - \ import TextAnalyticsClient\n\n endpoint = os.environ[\"AZURE_LANGUAGE_ENDPOINT\"\ - ]\n key = os.environ[\"AZURE_LANGUAGE_KEY\"]\n\n text_analytics_client = TextAnalyticsClient(endpoint=endpoint,\ - \ credential=AzureKeyCredential(key))\n documents = [\n \"\"\"\n \ - \ The concierge Paulette was extremely helpful. Sadly when we arrived the elevator\ - \ was broken, but with Paulette's help we barely noticed this inconvenience.\n\ - \ She arranged for our baggage to be brought up to our room with no extra\ - \ charge and gave us a free meal to refurbish all of the calories we lost from\n\ - \ walking up the stairs :). Can't say enough good things about my experience!\n\ - \ \"\"\",\n \"\"\"\n \u6700\u8FD1\u7531\u4E8E\u5DE5\u4F5C\u538B\ - \u529B\u592A\u5927\uFF0C\u6211\u4EEC\u51B3\u5B9A\u53BB\u5BCC\u9152\u5E97\u5EA6\ - \u5047\u3002\u90A3\u513F\u7684\u6E29\u6CC9\u5B9E\u5728\u592A\u8212\u670D\u4E86\ - \uFF0C\u6211\u8DDF\u6211\u4E08\u592B\u90FD\u5B8C\u5168\u6062\u590D\u4E86\u5DE5\ - \u4F5C\u524D\u7684\u9752\u6625\u7CBE\u795E\uFF01\u52A0\u6CB9\uFF01\n \"\"\ - \"\n ]\n async with text_analytics_client:\n result = await text_analytics_client.detect_language(documents)\n\ - \n reviewed_docs = [doc for doc in result if not doc.is_error]\n\n print(\"\ - Let's see what language each review is in!\")\n\n for idx, doc in enumerate(reviewed_docs):\n\ - \ print(\"Review #{} is in '{}', which has ISO639-1 name '{}'\\n\".format(\n\ - \ idx, doc.primary_language.name, doc.primary_language.iso6391_name\n\ - \ ))\n\n ````\n" - uid: azure.ai.textanalytics.aio.TextAnalyticsClient.dynamic_classification name: dynamic_classification summary: 'Perform dynamic classification on a batch of documents. @@ -1794,32 +1419,6 @@ methods: - ] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Perform dynamic classification on a batch of documents.\n\n\n\n````python\n\n import os\n\ - \ from azure.core.credentials import AzureKeyCredential\n from azure.ai.textanalytics.aio\ - \ import TextAnalyticsClient\n\n endpoint = os.environ[\"AZURE_LANGUAGE_ENDPOINT\"\ - ]\n key = os.environ[\"AZURE_LANGUAGE_KEY\"]\n\n text_analytics_client = TextAnalyticsClient(\n\ - \ endpoint=endpoint,\n credential=AzureKeyCredential(key),\n )\n\ - \ documents = [\n \"The WHO is issuing a warning about Monkey Pox.\",\n\ - \ \"Mo Salah plays in Liverpool FC in England.\",\n ]\n\n async with\ - \ text_analytics_client:\n results = await text_analytics_client.dynamic_classification(\n\ - \ documents,\n categories=[\"Health\", \"Politics\", \"Music\"\ - , \"Sports\"],\n classification_type=\"Multi\"\n )\n\n for doc,\ - \ classification_result in zip(documents, results):\n if classification_result.kind\ - \ == \"DynamicClassification\":\n classifications = classification_result.classifications\n\ - \ print(f\"\\n'{doc}' classifications:\\n\")\n for classification\ - \ in classifications:\n print(\"Category '{}' with confidence score\ - \ {}.\".format(\n classification.category, classification.confidence_score\n\ - \ ))\n elif classification_result.is_error is True:\n \ - \ print(\"Document '{}' has an error with code '{}' and message '{}'\".format(\n\ - \ doc, classification_result.error.code, classification_result.error.message\n\ - \ ))\n\n ````\n" - uid: azure.ai.textanalytics.aio.TextAnalyticsClient.extract_key_phrases name: extract_key_phrases summary: 'Extract key phrases from a batch of documents. @@ -1927,32 +1526,6 @@ methods: - type: azure.core.exceptions.HttpResponseError - type: TypeError - type: ValueError - examples: - - "Extract the key phrases in a batch of documents.\n\n\n\n````python\n\n import os\n\ - \ from azure.core.credentials import AzureKeyCredential\n from azure.ai.textanalytics.aio\ - \ import TextAnalyticsClient\n\n endpoint = os.environ[\"AZURE_LANGUAGE_ENDPOINT\"\ - ]\n key = os.environ[\"AZURE_LANGUAGE_KEY\"]\n\n text_analytics_client = TextAnalyticsClient(endpoint=endpoint,\ - \ credential=AzureKeyCredential(key))\n articles = [\n \"\"\"\n \ - \ Washington, D.C. Autumn in DC is a uniquely beautiful season. The leaves fall\ - \ from the trees\n in a city chock-full of forests, leaving yellow leaves\ - \ on the ground and a clearer view of the\n blue sky above...\n \"\ - \"\",\n \"\"\"\n Redmond, WA. In the past few days, Microsoft has\ - \ decided to further postpone the start date of\n its United States workers,\ - \ due to the pandemic that rages with no end in sight...\n \"\"\",\n \ - \ \"\"\"\n Redmond, WA. Employees at Microsoft can be excited about the\ - \ new coffee shop that will open on campus\n once workers no longer have\ - \ to work remotely...\n \"\"\"\n ]\n\n async with text_analytics_client:\n\ - \ result = await text_analytics_client.extract_key_phrases(articles)\n\n\ - \ articles_that_mention_microsoft = []\n for idx, doc in enumerate(result):\n\ - \ if not doc.is_error:\n print(\"Key phrases in article #{}: {}\"\ - .format(\n idx + 1,\n \", \".join(doc.key_phrases)\n\ - \ ))\n\n ````\n" - uid: azure.ai.textanalytics.aio.TextAnalyticsClient.recognize_entities name: recognize_entities summary: 'Recognize entities for a batch of documents. @@ -2071,37 +1644,6 @@ methods: - type: azure.core.exceptions.HttpResponseError - type: TypeError - type: ValueError - examples: - - "Recognize entities in a batch of documents.\n\n\n\n````python\n\n import os\n\ - \ import typing\n from azure.core.credentials import AzureKeyCredential\n\ - \ from azure.ai.textanalytics.aio import TextAnalyticsClient\n\n endpoint\ - \ = os.environ[\"AZURE_LANGUAGE_ENDPOINT\"]\n key = os.environ[\"AZURE_LANGUAGE_KEY\"\ - ]\n\n text_analytics_client = TextAnalyticsClient(endpoint=endpoint, credential=AzureKeyCredential(key))\n\ - \ reviews = [\n \"\"\"I work for Foo Company, and we hired Contoso for\ - \ our annual founding ceremony. The food\n was amazing and we all can't\ - \ say enough good words about the quality and the level of service.\"\"\",\n \ - \ \"\"\"We at the Foo Company re-hired Contoso after all of our past successes\ - \ with the company.\n Though the food was still great, I feel there has\ - \ been a quality drop since their last time\n catering for us. Is anyone\ - \ else running into the same problem?\"\"\",\n \"\"\"Bar Company is over\ - \ the moon about the service we received from Contoso, the best sliders ever!!!!\"\ - \"\"\n ]\n\n async with text_analytics_client:\n result = await text_analytics_client.recognize_entities(reviews)\n\ - \n result = [review for review in result if not review.is_error]\n organization_to_reviews:\ - \ typing.Dict[str, typing.List[str]] = {}\n\n for idx, review in enumerate(result):\n\ - \ for entity in review.entities:\n print(f\"Entity '{entity.text}'\ - \ has category '{entity.category}'\")\n\n if entity.category == 'Organization':\n\ - \ organization_to_reviews.setdefault(entity.text, [])\n \ - \ organization_to_reviews[entity.text].append(reviews[idx])\n\n for organization,\ - \ reviews in organization_to_reviews.items():\n print(\n \"\\\ - n\\nOrganization '{}' has left us the following review(s): {}\".format(\n \ - \ organization, \"\\n\\n\".join(reviews)\n )\n )\n\n\ - \ ````\n" - uid: azure.ai.textanalytics.aio.TextAnalyticsClient.recognize_linked_entities name: recognize_linked_entities summary: 'Recognize linked entities from a well-known knowledge base for a batch @@ -2222,32 +1764,6 @@ methods: - type: azure.core.exceptions.HttpResponseError - type: TypeError - type: ValueError - examples: - - "Recognize linked entities in a batch of documents.\n\n\n\n````python\n\n import os\n\ - \ from azure.core.credentials import AzureKeyCredential\n from azure.ai.textanalytics.aio\ - \ import TextAnalyticsClient\n\n endpoint = os.environ[\"AZURE_LANGUAGE_ENDPOINT\"\ - ]\n key = os.environ[\"AZURE_LANGUAGE_KEY\"]\n\n text_analytics_client = TextAnalyticsClient(endpoint=endpoint,\ - \ credential=AzureKeyCredential(key))\n documents = [\n \"\"\"\n \ - \ Microsoft was founded by Bill Gates with some friends he met at Harvard. One\ - \ of his friends,\n Steve Ballmer, eventually became CEO after Bill Gates\ - \ as well. Steve Ballmer eventually stepped\n down as CEO of Microsoft,\ - \ and was succeeded by Satya Nadella.\n Microsoft originally moved its headquarters\ - \ to Bellevue, Washington in January 1979, but is now\n headquartered in\ - \ Redmond.\n \"\"\"\n ]\n\n async with text_analytics_client:\n \ - \ result = await text_analytics_client.recognize_linked_entities(documents)\n\ - \n docs = [doc for doc in result if not doc.is_error]\n\n print(\n \"\ - Let's map each entity to it's Wikipedia article. I also want to see how many times\ - \ each \"\n \"entity is mentioned in a document\\n\\n\"\n )\n entity_to_url\ - \ = {}\n for doc in docs:\n for entity in doc.entities:\n print(\"\ - Entity '{}' has been mentioned '{}' time(s)\".format(\n entity.name,\ - \ len(entity.matches)\n ))\n if entity.data_source == \"Wikipedia\"\ - :\n entity_to_url[entity.name] = entity.url\n\n ````\n" - uid: azure.ai.textanalytics.aio.TextAnalyticsClient.recognize_pii_entities name: recognize_pii_entities summary: 'Recognize entities containing personal information for a batch of documents. @@ -2386,27 +1902,3 @@ methods: - type: azure.core.exceptions.HttpResponseError - type: TypeError - type: ValueError - examples: - - "Recognize personally identifiable information entities in a batch of documents.\n\n\n\n````python\n\n import os\n from azure.core.credentials\ - \ import AzureKeyCredential\n from azure.ai.textanalytics import TextAnalyticsClient\n\ - \n endpoint = os.environ[\"AZURE_LANGUAGE_ENDPOINT\"]\n key = os.environ[\"\ - AZURE_LANGUAGE_KEY\"]\n\n text_analytics_client = TextAnalyticsClient(\n \ - \ endpoint=endpoint, credential=AzureKeyCredential(key)\n )\n documents\ - \ = [\n \"\"\"Parker Doe has repaid all of their loans as of 2020-04-25.\n\ - \ Their SSN is 859-98-0987. To contact them, use their phone number\n \ - \ 555-555-5555. They are originally from Brazil and have Brazilian CPF number\ - \ 998.214.865-68\"\"\"\n ]\n\n result = text_analytics_client.recognize_pii_entities(documents)\n\ - \ docs = [doc for doc in result if not doc.is_error]\n\n print(\n \"\ - Let's compare the original document with the documents after redaction. \"\n \ - \ \"I also want to comb through all of the entities that got redacted\"\n\ - \ )\n for idx, doc in enumerate(docs):\n print(f\"Document text: {documents[idx]}\"\ - )\n print(f\"Redacted document text: {doc.redacted_text}\")\n for\ - \ entity in doc.entities:\n print(\"...Entity '{}' with category '{}'\ - \ got redacted\".format(\n entity.text, entity.category\n \ - \ ))\n\n\n ````\n" diff --git a/preview/docs-ref-autogen/azure-ai-translation-document/azure.ai.translation.document.DocumentTranslationClient.yml b/preview/docs-ref-autogen/azure-ai-translation-document/azure.ai.translation.document.DocumentTranslationClient.yml index d3fd42a6342c..1f52cc2fc0ea 100644 --- a/preview/docs-ref-autogen/azure-ai-translation-document/azure.ai.translation.document.DocumentTranslationClient.yml +++ b/preview/docs-ref-autogen/azure-ai-translation-document/azure.ai.translation.document.DocumentTranslationClient.yml @@ -41,30 +41,6 @@ constructor: types: - - -examples: -- "Creating the DocumentTranslationClient with an endpoint and API key.\n\n\n\n````python\n\n from azure.core.credentials import AzureKeyCredential\n\ - \ from azure.ai.translation.document import DocumentTranslationClient\n\n endpoint\ - \ = os.environ[\"AZURE_DOCUMENT_TRANSLATION_ENDPOINT\"]\n key = os.environ[\"\ - AZURE_DOCUMENT_TRANSLATION_KEY\"]\n\n document_translation_client = DocumentTranslationClient(endpoint,\ - \ AzureKeyCredential(key))\n\n ````\n\nCreating the DocumentTranslationClient\ - \ with a token credential.\n\n\n\n````python\n\n \"\"\"DefaultAzureCredential\ - \ will use the values from these environment\n variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,\ - \ AZURE_CLIENT_SECRET\n \"\"\"\n from azure.identity import DefaultAzureCredential\n\ - \ from azure.ai.translation.document import DocumentTranslationClient\n\n endpoint\ - \ = os.environ[\"AZURE_DOCUMENT_TRANSLATION_ENDPOINT\"]\n credential = DefaultAzureCredential()\n\ - \n document_translation_client = DocumentTranslationClient(endpoint, credential)\n\ - \n ````\n" methods: - uid: azure.ai.translation.document.DocumentTranslationClient.begin_translation name: begin_translation @@ -196,33 +172,6 @@ methods: - [[]] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Translate the documents in your storage container.\n\n\n\n````python\n\n import os\n from azure.core.credentials\ - \ import AzureKeyCredential\n from azure.ai.translation.document import DocumentTranslationClient\n\ - \n endpoint = os.environ[\"AZURE_DOCUMENT_TRANSLATION_ENDPOINT\"]\n key =\ - \ os.environ[\"AZURE_DOCUMENT_TRANSLATION_KEY\"]\n source_container_url = os.environ[\"\ - AZURE_SOURCE_CONTAINER_URL\"]\n target_container_url = os.environ[\"AZURE_TARGET_CONTAINER_URL\"\ - ]\n\n client = DocumentTranslationClient(endpoint, AzureKeyCredential(key))\n\ - \n poller = client.begin_translation(source_container_url, target_container_url,\ - \ \"fr\")\n result = poller.result()\n\n print(f\"Status: {poller.status()}\"\ - )\n print(f\"Created on: {poller.details.created_on}\")\n print(f\"Last updated\ - \ on: {poller.details.last_updated_on}\")\n print(f\"Total number of translations\ - \ on documents: {poller.details.documents_total_count}\")\n\n print(\"\\nOf\ - \ total documents...\")\n print(f\"{poller.details.documents_failed_count} failed\"\ - )\n print(f\"{poller.details.documents_succeeded_count} succeeded\")\n\n for\ - \ document in result:\n print(f\"Document ID: {document.id}\")\n print(f\"\ - Document status: {document.status}\")\n if document.status == \"Succeeded\"\ - :\n print(f\"Source document location: {document.source_document_url}\"\ - )\n print(f\"Translated document location: {document.translated_document_url}\"\ - )\n print(f\"Translated to language: {document.translated_to}\\n\")\n\ - \ else:\n print(f\"Error Code: {document.error.code}, Message:\ - \ {document.error.message}\\n\")\n\n ````\n" - uid: azure.ai.translation.document.DocumentTranslationClient.cancel_translation name: cancel_translation summary: 'Cancel a currently processing or queued translation operation. @@ -387,34 +336,6 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "List all the document statuses as they are being translated.\n\n\n\n````python\n\n import os\n import time\n\ - \ from azure.core.credentials import AzureKeyCredential\n from azure.ai.translation.document\ - \ import DocumentTranslationClient\n\n endpoint = os.environ[\"AZURE_DOCUMENT_TRANSLATION_ENDPOINT\"\ - ]\n key = os.environ[\"AZURE_DOCUMENT_TRANSLATION_KEY\"]\n source_container_url\ - \ = os.environ[\"AZURE_SOURCE_CONTAINER_URL\"]\n target_container_url = os.environ[\"\ - AZURE_TARGET_CONTAINER_URL\"]\n\n client = DocumentTranslationClient(endpoint,\ - \ AzureKeyCredential(key))\n\n poller = client.begin_translation(source_container_url,\ - \ target_container_url, \"es\")\n\n completed_docs = []\n while not poller.done():\n\ - \ time.sleep(30)\n\n doc_statuses = client.list_document_statuses(poller.id)\n\ - \ for document in doc_statuses:\n if document.id not in completed_docs:\n\ - \ if document.status == \"Succeeded\":\n print(f\"\ - Document at {document.source_document_url} was translated to {document.translated_to}\ - \ \"\n f\"language. You can find translated document at\ - \ {document.translated_document_url}\")\n completed_docs.append(document.id)\n\ - \ if document.status == \"Failed\":\n print(f\"\ - Document at {document.source_document_url} failed translation. \"\n \ - \ f\"Error Code: {document.error.code}, Message: {document.error.message}\"\ - )\n completed_docs.append(document.id)\n if document.status\ - \ == \"Running\":\n print(f\"Document ID: {document.id}, translation\ - \ progress is \"\n f\"{document.translation_progress *\ - \ 100} percent\")\n\n print(\"\\nTranslation completed.\")\n\n ````\n" - uid: azure.ai.translation.document.DocumentTranslationClient.list_translation_statuses name: list_translation_statuses summary: List all the submitted translation operations under the Document Translation @@ -480,25 +401,3 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "List all submitted translations under the resource.\n\n\n\n````python\n\n from azure.core.credentials import AzureKeyCredential\n\ - \ from azure.ai.translation.document import DocumentTranslationClient\n\n\n\ - \ endpoint = os.environ[\"AZURE_DOCUMENT_TRANSLATION_ENDPOINT\"]\n key = os.environ[\"\ - AZURE_DOCUMENT_TRANSLATION_KEY\"]\n\n client = DocumentTranslationClient(endpoint,\ - \ AzureKeyCredential(key))\n operations = client.list_translation_statuses()\ - \ # type: ItemPaged[TranslationStatus]\n\n for operation in operations:\n \ - \ print(f\"ID: {operation.id}\")\n print(f\"Status: {operation.status}\"\ - )\n print(f\"Created on: {operation.created_on}\")\n print(f\"Last\ - \ updated on: {operation.last_updated_on}\")\n print(f\"Total number of\ - \ operations on documents: {operation.documents_total_count}\")\n print(f\"\ - Total number of characters charged: {operation.total_characters_charged}\")\n\n\ - \ print(\"\\nOf total documents...\")\n print(f\"{operation.documents_failed_count}\ - \ failed\")\n print(f\"{operation.documents_succeeded_count} succeeded\"\ - )\n print(f\"{operation.documents_canceled_count} canceled\\n\")\n\n\n \ - \ ````\n" diff --git a/preview/docs-ref-autogen/azure-ai-translation-document/azure.ai.translation.document.aio.DocumentTranslationClient.yml b/preview/docs-ref-autogen/azure-ai-translation-document/azure.ai.translation.document.aio.DocumentTranslationClient.yml index 4200f61cccd2..1a82ab2d0757 100644 --- a/preview/docs-ref-autogen/azure-ai-translation-document/azure.ai.translation.document.aio.DocumentTranslationClient.yml +++ b/preview/docs-ref-autogen/azure-ai-translation-document/azure.ai.translation.document.aio.DocumentTranslationClient.yml @@ -41,30 +41,6 @@ constructor: types: - - -examples: -- "Creating the DocumentTranslationClient with an endpoint and API key.\n\n\n\n````python\n\n from azure.core.credentials\ - \ import AzureKeyCredential\n from azure.ai.translation.document.aio import DocumentTranslationClient\n\ - \n endpoint = os.environ[\"AZURE_DOCUMENT_TRANSLATION_ENDPOINT\"]\n key = os.environ[\"\ - AZURE_DOCUMENT_TRANSLATION_KEY\"]\n\n document_translation_client = DocumentTranslationClient(endpoint,\ - \ AzureKeyCredential(key))\n\n ````\n\nCreating the DocumentTranslationClient\ - \ with a token credential.\n\n\n\n````python\n\n \"\"\"DefaultAzureCredential\ - \ will use the values from these environment\n variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,\ - \ AZURE_CLIENT_SECRET\n \"\"\"\n from azure.identity.aio import DefaultAzureCredential\n\ - \ from azure.ai.translation.document.aio import DocumentTranslationClient\n\n\ - \ endpoint = os.environ[\"AZURE_DOCUMENT_TRANSLATION_ENDPOINT\"]\n credential\ - \ = DefaultAzureCredential()\n\n document_translation_client = DocumentTranslationClient(endpoint,\ - \ credential)\n\n ````\n" methods: - uid: azure.ai.translation.document.aio.DocumentTranslationClient.begin_translation name: begin_translation @@ -196,33 +172,6 @@ methods: - [[]] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Translate the documents in your storage container.\n\n\n\n````python\n\n import os\n\ - \ from azure.core.credentials import AzureKeyCredential\n from azure.ai.translation.document.aio\ - \ import DocumentTranslationClient\n\n endpoint = os.environ[\"AZURE_DOCUMENT_TRANSLATION_ENDPOINT\"\ - ]\n key = os.environ[\"AZURE_DOCUMENT_TRANSLATION_KEY\"]\n source_container_url\ - \ = os.environ[\"AZURE_SOURCE_CONTAINER_URL\"]\n target_container_url = os.environ[\"\ - AZURE_TARGET_CONTAINER_URL\"]\n\n client = DocumentTranslationClient(endpoint,\ - \ AzureKeyCredential(key))\n\n async with client:\n poller = await client.begin_translation(source_container_url,\ - \ target_container_url, \"fr\")\n result = await poller.result()\n\n \ - \ print(f\"Status: {poller.status()}\")\n print(f\"Created on: {poller.details.created_on}\"\ - )\n print(f\"Last updated on: {poller.details.last_updated_on}\")\n \ - \ print(f\"Total number of translations on documents: {poller.details.documents_total_count}\"\ - )\n\n print(\"\\nOf total documents...\")\n print(f\"{poller.details.documents_failed_count}\ - \ failed\")\n print(f\"{poller.details.documents_succeeded_count} succeeded\"\ - )\n\n async for document in result:\n print(f\"Document ID: {document.id}\"\ - )\n print(f\"Document status: {document.status}\")\n if document.status\ - \ == \"Succeeded\":\n print(f\"Source document location: {document.source_document_url}\"\ - )\n print(f\"Translated document location: {document.translated_document_url}\"\ - )\n print(f\"Translated to language: {document.translated_to}\\\ - n\")\n else:\n print(f\"Error Code: {document.error.code},\ - \ Message: {document.error.message}\\n\")\n\n ````\n" - uid: azure.ai.translation.document.aio.DocumentTranslationClient.cancel_translation name: cancel_translation summary: 'Cancel a currently processing or queued translation operation. @@ -388,36 +337,6 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "List all the document statuses as they are being translated.\n\n\n\n````python\n\n import os\n\ - \ from azure.core.credentials import AzureKeyCredential\n from azure.ai.translation.document.aio\ - \ import DocumentTranslationClient\n\n endpoint = os.environ[\"AZURE_DOCUMENT_TRANSLATION_ENDPOINT\"\ - ]\n key = os.environ[\"AZURE_DOCUMENT_TRANSLATION_KEY\"]\n source_container_url\ - \ = os.environ[\"AZURE_SOURCE_CONTAINER_URL\"]\n target_container_url = os.environ[\"\ - AZURE_TARGET_CONTAINER_URL\"]\n\n client = DocumentTranslationClient(endpoint,\ - \ AzureKeyCredential(key))\n\n async with client:\n poller = await client.begin_translation(source_container_url,\ - \ target_container_url, \"es\")\n\n completed_docs = []\n while poller.status()\ - \ in [\"Running\", \"NotStarted\"]:\n await asyncio.sleep(30)\n\n \ - \ doc_statuses = client.list_document_statuses(poller.id)\n \ - \ async for document in doc_statuses:\n if document.id not in completed_docs:\n\ - \ if document.status == \"Succeeded\":\n \ - \ print(f\"Document at {document.source_document_url} was translated to {document.translated_to}\ - \ \"\n f\"language. You can find translated document\ - \ at {document.translated_document_url}\")\n completed_docs.append(document.id)\n\ - \ if document.status == \"Failed\":\n \ - \ print(f\"Document at {document.source_document_url} failed translation. \"\n\ - \ f\"Error Code: {document.error.code}, Message: {document.error.message}\"\ - )\n completed_docs.append(document.id)\n \ - \ if document.status == \"Running\":\n print(f\"Document\ - \ ID: {document.id}, translation progress is \"\n \ - \ f\"{document.translation_progress * 100} percent\")\n\n print(\"\\nTranslation\ - \ completed.\")\n\n ````\n" - uid: azure.ai.translation.document.aio.DocumentTranslationClient.list_translation_statuses name: list_translation_statuses summary: List all the submitted translation operations under the Document Translation @@ -483,25 +402,3 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "List all submitted translations under the resource.\n\n\n\n````python\n\n from azure.core.credentials\ - \ import AzureKeyCredential\n from azure.ai.translation.document.aio import\ - \ DocumentTranslationClient\n\n endpoint = os.environ[\"AZURE_DOCUMENT_TRANSLATION_ENDPOINT\"\ - ]\n key = os.environ[\"AZURE_DOCUMENT_TRANSLATION_KEY\"]\n\n client = DocumentTranslationClient(endpoint,\ - \ AzureKeyCredential(key))\n async with client:\n operations = client.list_translation_statuses()\ - \ # type: AsyncItemPaged[TranslationStatus]\n\n async for operation in\ - \ operations:\n print(f\"ID: {operation.id}\")\n print(f\"\ - Status: {operation.status}\")\n print(f\"Created on: {operation.created_on}\"\ - )\n print(f\"Last updated on: {operation.last_updated_on}\")\n \ - \ print(f\"Total number of operations on documents: {operation.documents_total_count}\"\ - )\n print(f\"Total number of characters charged: {operation.total_characters_charged}\"\ - )\n\n print(\"\\nOf total documents...\")\n print(f\"{operation.documents_failed_count}\ - \ failed\")\n print(f\"{operation.documents_succeeded_count} succeeded\"\ - )\n print(f\"{operation.documents_canceled_count} canceled\\n\")\n\n\ - \ ````\n" diff --git a/preview/docs-ref-autogen/azure-communication-administration/azure.communication.administration.CommunicationIdentityClient.yml b/preview/docs-ref-autogen/azure-communication-administration/azure.communication.administration.CommunicationIdentityClient.yml index 6d90012a8fa4..8b8a5abb3679 100644 --- a/preview/docs-ref-autogen/azure-communication-administration/azure.communication.administration.CommunicationIdentityClient.yml +++ b/preview/docs-ref-autogen/azure-communication-administration/azure.communication.administration.CommunicationIdentityClient.yml @@ -19,35 +19,6 @@ constructor: shared access key' isRequired: true -examples: -- "\n\n\n\n````python\n\n : utf-8\n\n -------------------------------------------------------------------\n\ - \ ght (c) Microsoft Corporation. All rights reserved.\n ed under the MIT License.\ - \ See License.txt in the project root for\n e information.\n --------------------------------------------------------------------\n\ - \n\n entity_sample.py\n ION:\n e samples demonstrate identity client samples.\n\ - \n uthenticating a client via a connection string\n\n on identity_samples.py\n\ - \n s\n\n mmunicationIdentityClientSamples(object):\n\n __init__(self):\n \ - \ self.connection_string = os.getenv('AZURE_COMMUNICATION_SERVICE_CONNECTION_STRING')\n\ - \n issue_token(self):\n from azure.communication.administration import CommunicationIdentityClient\n\ - \n identity_client = CommunicationIdentityClient.from_connection_string(self.connection_string)\n\ - \ user = identity_client.create_user()\n tokenresponse = identity_client.issue_token(user,\ - \ scopes=[\"chat\"])\n print(tokenresponse)\n\n revoke_tokens(self):\n from\ - \ azure.communication.administration import CommunicationIdentityClient\n\n identity_client\ - \ = CommunicationIdentityClient.from_connection_string(self.connection_string)\n\ - \ user = identity_client.create_user()\n tokenresponse = identity_client.issue_token(user,\ - \ scopes=[\"chat\"])\n identity_client.revoke_tokens(user)\n print(tokenresponse)\n\ - \n create_user(self):\n from azure.communication.administration import CommunicationIdentityClient\n\ - \ identity_client = CommunicationIdentityClient.from_connection_string(self.connection_string)\n\ - \ user = identity_client.create_user()\n\n print(user.identifier)\n\n delete_user(self):\n\ - \ from azure.communication.administration import CommunicationIdentityClient\n\ - \ identity_client = CommunicationIdentityClient.from_connection_string(self.connection_string)\n\ - \ user = identity_client.create_user()\n identity_client.delete_user(user)\n\ - \n e__ == '__main__':\n le = CommunicationIdentityClientSamples()\n le.create_user()\n\ - \ le.delete_user()\n le.issue_token()\n le.revoke_tokens()\n\n ````\n" methods: - uid: azure.communication.administration.CommunicationIdentityClient.create_user name: create_user diff --git a/preview/docs-ref-autogen/azure-communication-identity/azure.communication.identity.CommunicationIdentityClient.yml b/preview/docs-ref-autogen/azure-communication-identity/azure.communication.identity.CommunicationIdentityClient.yml index da716013a571..61ec098bd8da 100644 --- a/preview/docs-ref-autogen/azure-communication-identity/azure.communication.identity.CommunicationIdentityClient.yml +++ b/preview/docs-ref-autogen/azure-communication-identity/azure.communication.identity.CommunicationIdentityClient.yml @@ -27,117 +27,6 @@ constructor: in unsupported behavior.' types: - -examples: -- "\n\n\n\n````python\n\n : utf-8\n\n -------------------------------------------------------------------\n\ - \ ght (c) Microsoft Corporation. All rights reserved.\n ed under the MIT License.\ - \ See License.txt in the project root for\n e information.\n --------------------------------------------------------------------\n\ - \n\n entity_sample.py\n ION:\n e samples demonstrate creating a user, issuing\ - \ a token, revoking a token and deleting a user.\n\n\n on identity_samples.py\n\ - \ the environment variables with your own values before running the sample:\n\ - \ OMMUNICATION_SAMPLES_CONNECTION_STRING - the connection string in your Communication\ - \ Services resource\n ZURE_CLIENT_ID - the client ID of your active directory\ - \ application\n ZURE_CLIENT_SECRET - the secret of your active directory application\n\ - \ ZURE_TENANT_ID - the tenant ID of your active directory application\n OMMUNICATION_M365_APP_ID\ - \ - the application id of Microsoft 365\n OMMUNICATION_M365_AAD_AUTHORITY - the\ - \ Azure AD authority of Microsoft 365 \n OMMUNICATION_M365_AAD_TENANT - the tenant\ - \ ID of Microsoft 365 application\n OMMUNICATION_MSAL_USERNAME - the username\ - \ for authenticating via MSAL library\n OMMUNICATION_MSAL_PASSWORD - the password\ - \ for authenticating via MSAL library\n\n etime import timedelta\n s\n re.communication.identity._shared.utils\ - \ import parse_connection_str\n l import PublicClientApplication\n mmunicationIdentityClientSamples(object):\n\ - \n __init__(self):\n self.connection_string = os.getenv('COMMUNICATION_SAMPLES_CONNECTION_STRING')\n\ - \ self.client_id = os.getenv('AZURE_CLIENT_ID')\n self.client_secret = os.getenv('AZURE_CLIENT_SECRET')\n\ - \ self.tenant_id = os.getenv('AZURE_TENANT_ID')\n self.m365_client_id = os.getenv('COMMUNICATION_M365_APP_ID')\ - \ \n self.m365_aad_authority = os.getenv('COMMUNICATION_M365_AAD_AUTHORITY') \n\ - \ self.m365_aad_tenant = os.getenv('COMMUNICATION_M365_AAD_TENANT')\n self.msal_username\ - \ = os.getenv('COMMUNICATION_MSAL_USERNAME') \n self.msal_password = os.getenv('COMMUNICATION_MSAL_PASSWORD')\n\ - \n get_token(self):\n from azure.communication.identity import (\n CommunicationIdentityClient,\n\ - \ CommunicationTokenScope\n )\n\n if self.client_id is not None and self.client_secret\ - \ is not None and self.tenant_id is not None:\n from azure.identity import\ - \ DefaultAzureCredential\n endpoint, _ = parse_connection_str(self.connection_string)\n\ - \ identity_client = CommunicationIdentityClient(endpoint, DefaultAzureCredential())\n\ - \ else:\n identity_client = CommunicationIdentityClient.from_connection_string(self.connection_string)\n\ - \ user = identity_client.create_user()\n print(\"Getting token for: \" + user.properties.get('id'))\n\ - \ tokenresponse = identity_client.get_token(user, scopes=[CommunicationTokenScope.CHAT])\n\ - \ print(\"Token issued with value: \" + tokenresponse.token)\n\n get_token_with_custom_expiration(self):\n\ - \ from azure.communication.identity import (\n CommunicationIdentityClient,\n\ - \ CommunicationTokenScope\n )\n\n if self.client_id is not None and self.client_secret\ - \ is not None and self.tenant_id is not None:\n from azure.identity import\ - \ DefaultAzureCredential\n endpoint, _ = parse_connection_str(self.connection_string)\n\ - \ identity_client = CommunicationIdentityClient(endpoint, DefaultAzureCredential())\n\ - \ else:\n identity_client = CommunicationIdentityClient.from_connection_string(self.connection_string)\n\ - \ user = identity_client.create_user()\n print(\"Getting token for: \" + user.properties.get('id'))\n\ - \ token_expires_in = timedelta(hours=1)\n tokenresponse = identity_client.get_token(user,\ - \ scopes=[CommunicationTokenScope.CHAT], token_expires_in=token_expires_in)\n \ - \ print(\"Issued token with custom expiration\" + tokenresponse.token)\n\n revoke_tokens(self):\n\ - \ from azure.communication.identity import (\n CommunicationIdentityClient,\n\ - \ CommunicationTokenScope\n )\n\n if self.client_id is not None and self.client_secret\ - \ is not None and self.tenant_id is not None:\n from azure.identity import\ - \ DefaultAzureCredential\n endpoint, _ = parse_connection_str(self.connection_string)\n\ - \ identity_client = CommunicationIdentityClient(endpoint, DefaultAzureCredential())\n\ - \ else:\n identity_client = CommunicationIdentityClient.from_connection_string(self.connection_string)\n\ - \ user = identity_client.create_user()\n tokenresponse = identity_client.get_token(user,\ - \ scopes=[CommunicationTokenScope.CHAT])\n print(\"Revoking token: \" + tokenresponse.token)\n\ - \ identity_client.revoke_tokens(user)\n print(tokenresponse.token + \" revoked\ - \ successfully\")\n\n create_user(self):\n from azure.communication.identity\ - \ import CommunicationIdentityClient\n\n if self.client_id is not None and self.client_secret\ - \ is not None and self.tenant_id is not None:\n from azure.identity import\ - \ DefaultAzureCredential\n endpoint, _ = parse_connection_str(self.connection_string)\n\ - \ identity_client = CommunicationIdentityClient(endpoint, DefaultAzureCredential())\n\ - \ else:\n identity_client = CommunicationIdentityClient.from_connection_string(self.connection_string)\n\ - \ print(\"Creating new user\")\n user = identity_client.create_user()\n print(\"\ - User created with id:\" + user.properties.get('id'))\n\n create_user_and_token(self):\n\ - \ from azure.communication.identity import (\n CommunicationIdentityClient,\n\ - \ CommunicationTokenScope\n )\n if self.client_id is not None and self.client_secret\ - \ is not None and self.tenant_id is not None:\n from azure.identity import\ - \ DefaultAzureCredential\n endpoint, _ = parse_connection_str(self.connection_string)\n\ - \ identity_client = CommunicationIdentityClient(endpoint, DefaultAzureCredential())\n\ - \ else:\n identity_client = CommunicationIdentityClient.from_connection_string(self.connection_string)\n\ - \ print(\"Creating new user with token\")\n user, tokenresponse = identity_client.create_user_and_token(scopes=[CommunicationTokenScope.CHAT])\n\ - \ print(\"User created with id:\" + user.properties.get('id'))\n print(\"Token\ - \ issued with value: \" + tokenresponse.token)\n\n create_user_and_token_with_custom_expiration(self):\n\ - \ from azure.communication.identity import (\n CommunicationIdentityClient,\n\ - \ CommunicationTokenScope\n )\n if self.client_id is not None and self.client_secret\ - \ is not None and self.tenant_id is not None:\n from azure.identity import\ - \ DefaultAzureCredential\n endpoint, _ = parse_connection_str(self.connection_string)\n\ - \ identity_client = CommunicationIdentityClient(endpoint, DefaultAzureCredential())\n\ - \ else:\n identity_client = CommunicationIdentityClient.from_connection_string(self.connection_string)\n\ - \ print(\"Creating new user with token\")\n token_expires_in = timedelta(hours=1)\n\ - \ user, tokenresponse = identity_client.create_user_and_token(scopes=[CommunicationTokenScope.CHAT],\ - \ token_expires_in=token_expires_in)\n print(\"User created with id:\" + user.properties.get('id'))\n\ - \ print(\"Issued token with custom expiration: \" + tokenresponse.token)\n\n \ - \ delete_user(self):\n from azure.communication.identity import CommunicationIdentityClient\n\ - \n if self.client_id is not None and self.client_secret is not None and self.tenant_id\ - \ is not None:\n from azure.identity import DefaultAzureCredential\n \ - \ endpoint, _ = parse_connection_str(self.connection_string)\n identity_client\ - \ = CommunicationIdentityClient(endpoint, DefaultAzureCredential())\n else:\n\ - \ identity_client = CommunicationIdentityClient.from_connection_string(self.connection_string)\n\ - \ user = identity_client.create_user()\n print(\"Deleting user: \" + user.properties.get('id'))\n\ - \ identity_client.delete_user(user)\n print(user.properties.get('id') + \" deleted\"\ - )\n\n get_token_for_teams_user(self):\n if (os.getenv(\"SKIP_INT_IDENTITY_EXCHANGE_TOKEN_TEST\"\ - ) == \"true\"):\n print(\"Skipping the Get Access Token for Teams User sample\"\ - )\n return\n from azure.communication.identity import CommunicationIdentityClient\n\ - \n if self.client_id is not None and self.client_secret is not None and self.tenant_id\ - \ is not None:\n from azure.identity import DefaultAzureCredential\n \ - \ endpoint, _ = parse_connection_str(self.connection_string)\n identity_client\ - \ = CommunicationIdentityClient(endpoint, DefaultAzureCredential())\n else:\n\ - \ identity_client = CommunicationIdentityClient.from_connection_string(self.connection_string)\n\ - \n msal_app = PublicClientApplication(client_id=self.m365_client_id, authority=\"\ - {}/{}\".format(self.m365_aad_authority, self.m365_aad_tenant))\n scopes = [ \n\ - \ \"https://auth.msft.communication.azure.com/Teams.ManageCalls\",\n \ - \ \"https://auth.msft.communication.azure.com/Teams.ManageChats\"\n ]\n result\ - \ = msal_app.acquire_token_by_username_password(\n username=self.msal_username,\n\ - \ password=self.msal_password,\n scopes=scopes)\n aad_token = result[\"\ - access_token\"]\n teams_user_oid = result[\"id_token_claims\"][\"oid\"] \n print(\"\ - AAD access token of a Teams User: \" + aad_token)\n\n tokenresponse = identity_client.get_token_for_teams_user(aad_token,\ - \ self.m365_client_id, teams_user_oid)\n print(\"Token issued with value: \" +\ - \ tokenresponse.token)\n\n\n e__ == '__main__':\n le = CommunicationIdentityClientSamples()\n\ - \ le.create_user()\n le.create_user_and_token()\n le.get_token()\n le.revoke_tokens()\n\ - \ le.delete_user() \n le.get_token_for_teams_user()\n\n ````\n" methods: - uid: azure.communication.identity.CommunicationIdentityClient.create_user name: create_user diff --git a/preview/docs-ref-autogen/azure-communication-networktraversal/azure.communication.networktraversal.aio.CommunicationRelayClient.yml b/preview/docs-ref-autogen/azure-communication-networktraversal/azure.communication.networktraversal.aio.CommunicationRelayClient.yml index e70b34f893bc..9a2d90d74d53 100644 --- a/preview/docs-ref-autogen/azure-communication-networktraversal/azure.communication.networktraversal.aio.CommunicationRelayClient.yml +++ b/preview/docs-ref-autogen/azure-communication-networktraversal/azure.communication.networktraversal.aio.CommunicationRelayClient.yml @@ -20,43 +20,6 @@ constructor: isRequired: true types: - -examples: -- "\n\n\n\n````python\n\n : utf-8\n\n -------------------------------------------------------------------\n\ - \ ght (c) Microsoft Corporation. All rights reserved.\n ed under the MIT License.\ - \ See License.txt in the project root for\n e information.\n --------------------------------------------------------------------\n\ - \n\n twork_traversal_samples_async.py\n ION:\n e samples demonstrate creating\ - \ a user, issuing a token, revoking a token and deleting a user.\n\n\n on network_traversal_samples.py\n\ - \ the environment variables with your own values before running the sample:\n\ - \ OMMUNICATION_SAMPLES_CONNECTION_STRING - the connection string in your ACS resource\n\ - \ ZURE_CLIENT_ID - the client ID of your active directory application\n ZURE_CLIENT_SECRET\ - \ - the secret of your active directory application\n ZURE_TENANT_ID - the tenant\ - \ ID of your active directory application\n\n s\n syncio\n re.communication.networktraversal._shared.utils\ - \ import parse_connection_str\n\n mmunicationRelayClientSamples(object):\n\n \ - \ __init__(self):\n self.connection_string = os.getenv('COMMUNICATION_SAMPLES_CONNECTION_STRING')\n\ - \ self.client_id = os.getenv('AZURE_CLIENT_ID')\n self.client_secret = os.getenv('AZURE_CLIENT_SECRET')\n\ - \ self.tenant_id = os.getenv('AZURE_TENANT_ID')\n\n c def get_relay_config(self):\n\ - \ from azure.communication.networktraversal.aio import CommunicationRelayClient\n\ - \ from azure.communication.identity.aio import CommunicationIdentityClient\n\n\ - \ if self.client_id is not None and self.client_secret is not None and self.tenant_id\ - \ is not None:\n from azure.identity.aio import DefaultAzureCredential\n \ - \ endpoint, _ = parse_connection_str(self.connection_string)\n identity_client\ - \ = CommunicationIdentityClient(endpoint, DefaultAzureCredential())\n relay_client\ - \ = CommunicationRelayClient(endpoint, DefaultAzureCredential())\n else:\n \ - \ identity_client = CommunicationIdentityClient.from_connection_string(self.connection_string)\n\ - \ relay_client = CommunicationRelayClient.from_connection_string(self.connection_string)\n\ - \n async with identity_client:\n print(\"Creating new user\")\n user\ - \ = await identity_client.create_user()\n print(\"User created with id:\"\ - \ + user.properties.get('id'))\n\n async with relay_client:\n print(\"Getting\ - \ relay configuration\")\n relay_configuration = await relay_client.get_relay_configuration(user=user)\n\ - \n for iceServer in relay_configuration.ice_servers:\n print(\"Icer server:\"\ - )\n print(iceServer)\n\n f main():\n le = CommunicationRelayClientSamples()\n\ - \ t sample.get_relay_config()\n\n e__ == '__main__':\n cio.run(main())\n\n\ - \ ````\n" methods: - uid: azure.communication.networktraversal.aio.CommunicationRelayClient.close name: close diff --git a/preview/docs-ref-autogen/azure-containerregistry/azure.containerregistry.ContainerRegistryClient.yml b/preview/docs-ref-autogen/azure-containerregistry/azure.containerregistry.ContainerRegistryClient.yml index 86147ecaf3c1..21ca1c104d03 100644 --- a/preview/docs-ref-autogen/azure-containerregistry/azure.containerregistry.ContainerRegistryClient.yml +++ b/preview/docs-ref-autogen/azure-containerregistry/azure.containerregistry.ContainerRegistryClient.yml @@ -41,14 +41,6 @@ constructor: The default value is "[https://containerregistry.azure.net](https://containerregistry.azure.net)".' types: - -examples: -- "Instantiate an instance of *ContainerRegistryClient*\n\n\n\n````python\n\n with ContainerRegistryClient(self.endpoint,\ - \ self.credential, audience=self.audience) as client:\n\n ````\n" methods: - uid: azure.containerregistry.ContainerRegistryClient.delete_blob name: delete_blob @@ -121,15 +113,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Delete a repository from the *ContainerRegistryClient*\n\n\n\ - \n````python\n\n client.delete_repository(repository_name)\n\n \ - \ ````\n" - uid: azure.containerregistry.ContainerRegistryClient.delete_tag name: delete_tag summary: "Delete a tag from a repository. If the tag cannot be found or a response\ @@ -323,15 +306,6 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "List repositories in a container registry account\n\n\n\ - \n````python\n\n for repository in client.list_repository_names():\n \ - \ print(repository)\n\n ````\n" - uid: azure.containerregistry.ContainerRegistryClient.list_tag_properties name: list_tag_properties summary: "List the tags for a repository\n\nExample\n\n\n\n\n\n````python\n\n import json\n\ - \n for item in container.query_items(\n query='SELECT * FROM products\ - \ p WHERE p.productModel <> \"DISCONTINUED\"',\n enable_cross_partition_query=True,\n\ - \ ):\n print(json.dumps(item, indent=True))\n\n ````\n\nParameterized\ - \ query to get all products that have been discontinued:\n\n\n\n````python\n\n discontinued_items\ - \ = container.query_items(\n query='SELECT * FROM products p WHERE p.productModel\ - \ = @model AND p.productName=\"Widget\"',\n parameters=[dict(name=\"@model\"\ - , value=\"DISCONTINUED\")],\n )\n for item in discontinued_items:\n \ - \ print(json.dumps(item, indent=True))\n\n ````\n" - uid: azure.cosmos.ContainerProxy.query_items_change_feed name: query_items_change_feed summary: Get a sorted list of items that were changed, in the order in which they @@ -601,15 +581,6 @@ methods: exceptions: - type: azure.cosmos.exceptions.CosmosHttpResponseError description: The given item couldn't be retrieved. - examples: - - "Get an item from the database and update one of its properties:\n\n\n\n````python\n\n item = container.read_item(\"\ - item2\", partition_key=\"Widget\")\n item[\"productModel\"] = \"DISCONTINUED\"\ - \n updated_item = container.upsert_item(item)\n\n ````\n" - uid: azure.cosmos.ContainerProxy.read_offer name: read_offer summary: "Get the ThroughputProperties object for this container.\nIf no ThroughputProperties\ diff --git a/preview/docs-ref-autogen/azure-cosmos/azure.cosmos.CosmosClient.yml b/preview/docs-ref-autogen/azure-cosmos/azure.cosmos.CosmosClient.yml index cdd51a1c9c40..944e5e681347 100644 --- a/preview/docs-ref-autogen/azure-cosmos/azure.cosmos.CosmosClient.yml +++ b/preview/docs-ref-autogen/azure-cosmos/azure.cosmos.CosmosClient.yml @@ -119,16 +119,6 @@ constructor: at INFO level.' types: - -examples: -- "Create a new instance of the Cosmos DB client:\n\n\n\n````python\n\n from azure.cosmos import exceptions,\ - \ CosmosClient, PartitionKey\n\n import os\n\n url = os.environ[\"ACCOUNT_URI\"\ - ]\n key = os.environ[\"ACCOUNT_KEY\"]\n client = CosmosClient(url, key)\n\n\ - \ ````\n" methods: - uid: azure.cosmos.CosmosClient.create_database name: create_database @@ -174,16 +164,6 @@ methods: exceptions: - type: azure.cosmos.exceptions.CosmosResourceExistsError description: Database with the given ID already exists. - examples: - - "Create a database in the Cosmos DB account:\n\n\n\n````python\n\n database_name\ - \ = \"testDatabase\"\n try:\n database = client.create_database(id=database_name)\n\ - \ except exceptions.CosmosResourceExistsError:\n database = client.get_database_client(database=database_name)\n\ - \n ````\n" - uid: azure.cosmos.CosmosClient.create_database_if_not_exists name: create_database_if_not_exists summary: "Create the database if it does not exist already.\n\nIf the database already\ diff --git a/preview/docs-ref-autogen/azure-cosmos/azure.cosmos.DatabaseProxy.yml b/preview/docs-ref-autogen/azure-cosmos/azure.cosmos.DatabaseProxy.yml index 182474b871ba..b7dfccb569be 100644 --- a/preview/docs-ref-autogen/azure-cosmos/azure.cosmos.DatabaseProxy.yml +++ b/preview/docs-ref-autogen/azure-cosmos/azure.cosmos.DatabaseProxy.yml @@ -117,28 +117,6 @@ methods: exceptions: - type: azure.cosmos.exceptions.CosmosHttpResponseError description: The container creation failed. - examples: - - "Create a container with default settings:\n\n\n\n````python\n\n container_name\ - \ = \"products\"\n try:\n container = database.create_container(\n \ - \ id=container_name, partition_key=PartitionKey(path=\"/productName\")\n\ - \ )\n except exceptions.CosmosResourceExistsError:\n container =\ - \ database.get_container_client(container_name)\n\n ````\n\nCreate a container\ - \ with specific settings; in this case, a custom partition key:\n\n\n\n````python\n\n customer_container_name\ - \ = \"customers\"\n try:\n customer_container = database.create_container(\n\ - \ id=customer_container_name,\n partition_key=PartitionKey(path=\"\ - /city\"),\n default_ttl=200,\n )\n except exceptions.CosmosResourceExistsError:\n\ - \ customer_container = database.get_container_client(customer_container_name)\n\ - \n ````\n" - uid: azure.cosmos.DatabaseProxy.create_container_if_not_exists name: create_container_if_not_exists summary: 'Create a container if it does not exist already. @@ -249,17 +227,6 @@ methods: exceptions: - type: azure.cosmos.exceptions.CosmosHttpResponseError description: If the given user couldn't be created. - examples: - - "Create a database user:\n\n\n\n````python\n\n try:\n database.create_user(dict(id=\"\ - Walter Harp\"))\n except exceptions.CosmosResourceExistsError:\n print(\"\ - A user with that ID already exists.\")\n except exceptions.CosmosHttpResponseError\ - \ as failure:\n print(\"Failed to create user. Status code:{}\".format(failure.status_code))\n\ - \n ````\n" - uid: azure.cosmos.DatabaseProxy.delete_container name: delete_container summary: Delete a container. @@ -343,15 +310,6 @@ methods: description: A *ContainerProxy* instance representing the retrieved database. types: - - examples: - - "Get an existing container, handling a failure if encountered:\n\n\n\n````python\n\n database =\ - \ client.get_database_client(database_name)\n container = database.get_container_client(container_name)\n\ - \n ````\n" - uid: azure.cosmos.DatabaseProxy.get_throughput name: get_throughput summary: "Get the ThroughputProperties object for this database.\nIf no ThroughputProperties\ @@ -403,15 +361,6 @@ methods: description: An Iterable of container properties (dicts). types: - [[, ]] - examples: - - "List all containers in the database:\n\n\n\n````python\n\n database =\ - \ client.get_database_client(database_name)\n for container in database.list_containers():\n\ - \ print(\"Container ID: {}\".format(container['id']))\n\n ````\n" - uid: azure.cosmos.DatabaseProxy.list_users name: list_users summary: List all the users in the container. @@ -601,18 +550,6 @@ methods: description: 'Raised if the container couldn''t be replaced. This includes if the container with given id does not exist.' - examples: - - "Reset the TTL property on a container, and display the updated properties:\n\n\n\n````python\n\n # Set the\ - \ TTL on the container to 3600 seconds (one hour)\n database.replace_container(container,\ - \ partition_key=PartitionKey(path='/productName'), default_ttl=3600)\n\n # Display\ - \ the new TTL setting for the container\n container_props = database.get_container_client(container_name).read()\n\ - \ print(\"New container TTL: {}\".format(json.dumps(container_props['defaultTtl'])))\n\ - \n ````\n" - uid: azure.cosmos.DatabaseProxy.replace_throughput name: replace_throughput summary: Replace the database-level throughput. diff --git a/preview/docs-ref-autogen/azure-cosmos/azure.cosmos.aio.ContainerProxy.yml b/preview/docs-ref-autogen/azure-cosmos/azure.cosmos.aio.ContainerProxy.yml index bbf3665d3ea6..b56f4e936d6f 100644 --- a/preview/docs-ref-autogen/azure-cosmos/azure.cosmos.aio.ContainerProxy.yml +++ b/preview/docs-ref-autogen/azure-cosmos/azure.cosmos.aio.ContainerProxy.yml @@ -462,28 +462,6 @@ methods: description: An AsyncItemPaged of items (dicts). types: - [[, ]] - examples: - - "Get all products that have not been discontinued:\n\n\n\n````python\n\ - \n import json\n\n async for item in container.query_items(\n\ - \ query='SELECT * FROM products p WHERE p.productModel <> \"\ - DISCONTINUED\"',\n enable_cross_partition_query=True,\n \ - \ ):\n print(json.dumps(item, indent=True))\n\n ````\n\n\ - Parameterized query to get all products that have been discontinued:\n\n\n\n````python\n\ - \n discontinued_items = container.query_items(\n query='SELECT\ - \ * FROM products p WHERE p.productModel = @model AND p.productName=\"Widget\"\ - ',\n parameters=[dict(name=\"@model\", value=\"DISCONTINUED\")],\n\ - \ )\n async for item in discontinued_items:\n \ - \ print(json.dumps(item, indent=True))\n\n ````\n" - uid: azure.cosmos.aio.ContainerProxy.query_items_change_feed name: query_items_change_feed summary: Get a sorted list of items that were changed, in the order in which they @@ -647,16 +625,6 @@ methods: exceptions: - type: azure.cosmos.exceptions.CosmosHttpResponseError description: The given item couldn't be retrieved. - examples: - - "Get an item from the database and update one of its properties:\n\n\n\n````python\n\ - \n item = await container.read_item(\"item2\", partition_key=\"Widget\"\ - )\n item[\"productModel\"] = \"DISCONTINUED\"\n updated_item\ - \ = await container.upsert_item(item)\n\n ````\n" - uid: azure.cosmos.aio.ContainerProxy.replace_item name: replace_item summary: 'Replaces the specified item if it exists in the container. diff --git a/preview/docs-ref-autogen/azure-cosmos/azure.cosmos.aio.CosmosClient.yml b/preview/docs-ref-autogen/azure-cosmos/azure.cosmos.aio.CosmosClient.yml index 6c81ed8dbdf7..7100d9264a8b 100644 --- a/preview/docs-ref-autogen/azure-cosmos/azure.cosmos.aio.CosmosClient.yml +++ b/preview/docs-ref-autogen/azure-cosmos/azure.cosmos.aio.CosmosClient.yml @@ -118,14 +118,6 @@ constructor: at INFO level.' types: - -examples: -- "Create a new instance of the Cosmos DB client:\n\n\n\n````python\n\n async with CosmosClient(url,\ - \ key) as client:\n\n ````\n" methods: - uid: azure.cosmos.aio.CosmosClient.close name: close @@ -177,16 +169,6 @@ methods: exceptions: - type: azure.cosmos.exceptions.CosmosResourceExistsError description: Database with the given ID already exists. - examples: - - "Create a database in the Cosmos DB account:\n\n\n\n````python\n\n database_name\ - \ = \"testDatabase\"\n try:\n database = await client.create_database(id=database_name)\n\ - \ except exceptions.CosmosResourceExistsError:\n database\ - \ = client.get_database_client(database=database_name)\n\n ````\n" - uid: azure.cosmos.aio.CosmosClient.create_database_if_not_exists name: create_database_if_not_exists summary: "Create the database if it does not exist already.\n\nIf the database already\ diff --git a/preview/docs-ref-autogen/azure-cosmos/azure.cosmos.aio.DatabaseProxy.yml b/preview/docs-ref-autogen/azure-cosmos/azure.cosmos.aio.DatabaseProxy.yml index 71f1773c56dc..3225ddacb47a 100644 --- a/preview/docs-ref-autogen/azure-cosmos/azure.cosmos.aio.DatabaseProxy.yml +++ b/preview/docs-ref-autogen/azure-cosmos/azure.cosmos.aio.DatabaseProxy.yml @@ -123,29 +123,6 @@ methods: exceptions: - type: azure.cosmos.exceptions.CosmosHttpResponseError description: The container creation failed. - examples: - - "Create a container with default settings:\n\n\n\n````python\n\n container_name\ - \ = \"products\"\n try:\n container = await database.create_container(\n\ - \ id=container_name, partition_key=PartitionKey(path=\"/productName\"\ - )\n )\n except exceptions.CosmosResourceExistsError:\n\ - \ container = database.get_container_client(container_name)\n\n\ - \ ````\n\nCreate a container with specific settings; in this case, a custom\ - \ partition key:\n\n\n\n````python\n\n customer_container_name = \"customers\"\ - \n try:\n customer_container = await database.create_container(\n\ - \ id=customer_container_name,\n partition_key=PartitionKey(path=\"\ - /city\"),\n default_ttl=200,\n )\n except\ - \ exceptions.CosmosResourceExistsError:\n customer_container = database.get_container_client(customer_container_name)\n\ - \n ````\n" - uid: azure.cosmos.aio.DatabaseProxy.create_container_if_not_exists name: create_container_if_not_exists summary: 'Create a container if it does not exist already. @@ -264,18 +241,6 @@ methods: exceptions: - type: azure.cosmos.exceptions.CosmosHttpResponseError description: If the given user couldn't be created. - examples: - - "Create a database user:\n\ - \n\n\n````python\n\n try:\n\ - \ await database.create_user(dict(id=\"Walter Harp\"))\n \ - \ print(\"Created user Walter Harp.\")\n except exceptions.CosmosResourceExistsError:\n\ - \ print(\"A user with that ID already exists.\")\n except\ - \ exceptions.CosmosHttpResponseError as failure:\n print(\"Failed\ - \ to create user. Status code:{}\".format(failure.status_code))\n\n ````\n" - uid: azure.cosmos.aio.DatabaseProxy.delete_container name: delete_container summary: Delete a container. @@ -366,15 +331,6 @@ methods: description: A *ContainerProxy* instance representing the container. types: - - examples: - - "Get an existing container, handling a failure if encountered:\n\n\n\n````python\n\ - \n database = client.get_database_client(database_name)\n \ - \ container = database.get_container_client(container_name)\n\n ````\n" - uid: azure.cosmos.aio.DatabaseProxy.get_throughput name: get_throughput summary: 'Get the ThroughputProperties object for this database. @@ -439,16 +395,6 @@ methods: description: An AsyncItemPaged of container properties (dicts). types: - [[, ]] - examples: - - "List all containers in the database:\n\n\n\n````python\n\n database\ - \ = client.get_database_client(database_name)\n async for container\ - \ in database.list_containers():\n print(\"Container ID: {}\".format(container['id']))\n\ - \n ````\n" - uid: azure.cosmos.aio.DatabaseProxy.list_users name: list_users summary: List all the users in the container. @@ -642,19 +588,6 @@ methods: description: 'Raised if the container couldn''t be replaced. This includes if the container with given id does not exist.' - examples: - - "Reset the TTL property on a container, and display the updated properties:\n\n\n\n````python\n\ - \n # Set the TTL on the container to 3600 seconds (one hour)\n \ - \ await database.replace_container(container, partition_key=PartitionKey(path='/productName'),\ - \ default_ttl=3600)\n\n # Display the new TTL setting for the container\n\ - \ container_props = await database.get_container_client(container_name).read()\n\ - \ print(\"New container TTL: {}\".format(json.dumps(container_props['defaultTtl'])))\n\ - \n ````\n" - uid: azure.cosmos.aio.DatabaseProxy.replace_throughput name: replace_throughput summary: 'Replace the database-level throughput. diff --git a/preview/docs-ref-autogen/azure-cosmos/azure.cosmos.container.ContainerProxy.yml b/preview/docs-ref-autogen/azure-cosmos/azure.cosmos.container.ContainerProxy.yml index 2c5319a8767e..9c0ea5d571df 100644 --- a/preview/docs-ref-autogen/azure-cosmos/azure.cosmos.container.ContainerProxy.yml +++ b/preview/docs-ref-autogen/azure-cosmos/azure.cosmos.container.ContainerProxy.yml @@ -428,26 +428,6 @@ methods: description: An Iterable of items (dicts). types: - [[, ]] - examples: - - "Get all products that have not been discontinued:\n\n\n\n````python\n\n import json\n\ - \n for item in container.query_items(\n query='SELECT * FROM products\ - \ p WHERE p.productModel <> \"DISCONTINUED\"',\n enable_cross_partition_query=True,\n\ - \ ):\n print(json.dumps(item, indent=True))\n\n ````\n\nParameterized\ - \ query to get all products that have been discontinued:\n\n\n\n````python\n\n discontinued_items\ - \ = container.query_items(\n query='SELECT * FROM products p WHERE p.productModel\ - \ = @model AND p.productName=\"Widget\"',\n parameters=[dict(name=\"@model\"\ - , value=\"DISCONTINUED\")],\n )\n for item in discontinued_items:\n \ - \ print(json.dumps(item, indent=True))\n\n ````\n" - uid: azure.cosmos.container.ContainerProxy.query_items_change_feed name: query_items_change_feed summary: Get a sorted list of items that were changed, in the order in which they @@ -601,15 +581,6 @@ methods: exceptions: - type: azure.cosmos.exceptions.CosmosHttpResponseError description: The given item couldn't be retrieved. - examples: - - "Get an item from the database and update one of its properties:\n\n\n\n````python\n\n item = container.read_item(\"\ - item2\", partition_key=\"Widget\")\n item[\"productModel\"] = \"DISCONTINUED\"\ - \n updated_item = container.upsert_item(item)\n\n ````\n" - uid: azure.cosmos.container.ContainerProxy.read_offer name: read_offer summary: "Get the ThroughputProperties object for this container.\nIf no ThroughputProperties\ diff --git a/preview/docs-ref-autogen/azure-cosmos/azure.cosmos.cosmos_client.CosmosClient.yml b/preview/docs-ref-autogen/azure-cosmos/azure.cosmos.cosmos_client.CosmosClient.yml index 21ef9ed71ff1..d5ef57398188 100644 --- a/preview/docs-ref-autogen/azure-cosmos/azure.cosmos.cosmos_client.CosmosClient.yml +++ b/preview/docs-ref-autogen/azure-cosmos/azure.cosmos.cosmos_client.CosmosClient.yml @@ -119,16 +119,6 @@ constructor: at INFO level.' types: - -examples: -- "Create a new instance of the Cosmos DB client:\n\n\n\n````python\n\n from azure.cosmos import exceptions,\ - \ CosmosClient, PartitionKey\n\n import os\n\n url = os.environ[\"ACCOUNT_URI\"\ - ]\n key = os.environ[\"ACCOUNT_KEY\"]\n client = CosmosClient(url, key)\n\n\ - \ ````\n" methods: - uid: azure.cosmos.cosmos_client.CosmosClient.create_database name: create_database @@ -174,16 +164,6 @@ methods: exceptions: - type: azure.cosmos.exceptions.CosmosResourceExistsError description: Database with the given ID already exists. - examples: - - "Create a database in the Cosmos DB account:\n\n\n\n````python\n\n database_name\ - \ = \"testDatabase\"\n try:\n database = client.create_database(id=database_name)\n\ - \ except exceptions.CosmosResourceExistsError:\n database = client.get_database_client(database=database_name)\n\ - \n ````\n" - uid: azure.cosmos.cosmos_client.CosmosClient.create_database_if_not_exists name: create_database_if_not_exists summary: "Create the database if it does not exist already.\n\nIf the database already\ diff --git a/preview/docs-ref-autogen/azure-cosmos/azure.cosmos.database.DatabaseProxy.yml b/preview/docs-ref-autogen/azure-cosmos/azure.cosmos.database.DatabaseProxy.yml index 3a77374df148..6b6d7cdce56f 100644 --- a/preview/docs-ref-autogen/azure-cosmos/azure.cosmos.database.DatabaseProxy.yml +++ b/preview/docs-ref-autogen/azure-cosmos/azure.cosmos.database.DatabaseProxy.yml @@ -117,28 +117,6 @@ methods: exceptions: - type: azure.cosmos.exceptions.CosmosHttpResponseError description: The container creation failed. - examples: - - "Create a container with default settings:\n\n\n\n````python\n\n container_name\ - \ = \"products\"\n try:\n container = database.create_container(\n \ - \ id=container_name, partition_key=PartitionKey(path=\"/productName\")\n\ - \ )\n except exceptions.CosmosResourceExistsError:\n container =\ - \ database.get_container_client(container_name)\n\n ````\n\nCreate a container\ - \ with specific settings; in this case, a custom partition key:\n\n\n\n````python\n\n customer_container_name\ - \ = \"customers\"\n try:\n customer_container = database.create_container(\n\ - \ id=customer_container_name,\n partition_key=PartitionKey(path=\"\ - /city\"),\n default_ttl=200,\n )\n except exceptions.CosmosResourceExistsError:\n\ - \ customer_container = database.get_container_client(customer_container_name)\n\ - \n ````\n" - uid: azure.cosmos.database.DatabaseProxy.create_container_if_not_exists name: create_container_if_not_exists summary: 'Create a container if it does not exist already. @@ -249,17 +227,6 @@ methods: exceptions: - type: azure.cosmos.exceptions.CosmosHttpResponseError description: If the given user couldn't be created. - examples: - - "Create a database user:\n\n\n\n````python\n\n try:\n database.create_user(dict(id=\"\ - Walter Harp\"))\n except exceptions.CosmosResourceExistsError:\n print(\"\ - A user with that ID already exists.\")\n except exceptions.CosmosHttpResponseError\ - \ as failure:\n print(\"Failed to create user. Status code:{}\".format(failure.status_code))\n\ - \n ````\n" - uid: azure.cosmos.database.DatabaseProxy.delete_container name: delete_container summary: Delete a container. @@ -343,15 +310,6 @@ methods: description: A *ContainerProxy* instance representing the retrieved database. types: - - examples: - - "Get an existing container, handling a failure if encountered:\n\n\n\n````python\n\n database =\ - \ client.get_database_client(database_name)\n container = database.get_container_client(container_name)\n\ - \n ````\n" - uid: azure.cosmos.database.DatabaseProxy.get_throughput name: get_throughput summary: "Get the ThroughputProperties object for this database.\nIf no ThroughputProperties\ @@ -403,15 +361,6 @@ methods: description: An Iterable of container properties (dicts). types: - [[, ]] - examples: - - "List all containers in the database:\n\n\n\n````python\n\n database =\ - \ client.get_database_client(database_name)\n for container in database.list_containers():\n\ - \ print(\"Container ID: {}\".format(container['id']))\n\n ````\n" - uid: azure.cosmos.database.DatabaseProxy.list_users name: list_users summary: List all the users in the container. @@ -602,18 +551,6 @@ methods: description: 'Raised if the container couldn''t be replaced. This includes if the container with given id does not exist.' - examples: - - "Reset the TTL property on a container, and display the updated properties:\n\n\n\n````python\n\n # Set the\ - \ TTL on the container to 3600 seconds (one hour)\n database.replace_container(container,\ - \ partition_key=PartitionKey(path='/productName'), default_ttl=3600)\n\n # Display\ - \ the new TTL setting for the container\n container_props = database.get_container_client(container_name).read()\n\ - \ print(\"New container TTL: {}\".format(json.dumps(container_props['defaultTtl'])))\n\ - \n ````\n" - uid: azure.cosmos.database.DatabaseProxy.replace_throughput name: replace_throughput summary: Replace the database-level throughput. diff --git a/preview/docs-ref-autogen/azure-eventgrid/azure.eventgrid.EventGridPublisherClient.yml b/preview/docs-ref-autogen/azure-eventgrid/azure.eventgrid.EventGridPublisherClient.yml index 7ae0c01b7696..5ada34f9ad01 100644 --- a/preview/docs-ref-autogen/azure-eventgrid/azure.eventgrid.EventGridPublisherClient.yml +++ b/preview/docs-ref-autogen/azure-eventgrid/azure.eventgrid.EventGridPublisherClient.yml @@ -26,29 +26,6 @@ constructor: - - - -examples: -- "Creating the EventGridPublisherClient with an endpoint and AzureKeyCredential.\n\n\n\n````python\n\n import os\n from azure.eventgrid\ - \ import EventGridPublisherClient\n from azure.core.credentials import AzureKeyCredential\n\ - \n topic_key = os.environ[\"EVENTGRID_TOPIC_KEY\"]\n endpoint = os.environ[\"\ - EVENTGRID_TOPIC_ENDPOINT\"]\n\n credential = AzureKeyCredential(topic_key)\n \ - \ client = EventGridPublisherClient(endpoint, credential)\n\n ````\n\nCreating\ - \ the EventGridPublisherClient with an endpoint and AzureSasCredential.\n\n\n\n````python\n\n import os\n from azure.eventgrid\ - \ import EventGridPublisherClient\n from azure.core.credentials import AzureSasCredential\n\ - \n signature = os.environ[\"EVENTGRID_SAS\"]\n endpoint = os.environ[\"EVENTGRID_TOPIC_ENDPOINT\"\ - ]\n\n credential = AzureSasCredential(signature)\n client = EventGridPublisherClient(endpoint,\ - \ credential)\n\n ````\n" methods: - uid: azure.eventgrid.EventGridPublisherClient.close name: close @@ -113,15 +90,3 @@ methods: return: types: - - examples: - - "Publishing a Custom Schema event.\n\n\n\n````python\n\n custom_schema_event\ - \ = {\n \"customSubject\": \"sample\",\n \"customEventType\": \"sample.event\"\ - ,\n \"customDataVersion\": \"2.0\",\n \"customId\": uuid.uuid4(),\n\ - \ \"customEventTime\": dt.datetime.now(UTC()).isoformat(),\n \"customData\"\ - : \"sample data\",\n }\n\n client.send(custom_schema_event)\n\n ````\n" diff --git a/preview/docs-ref-autogen/azure-eventgrid/azure.eventgrid.aio.EventGridPublisherClient.yml b/preview/docs-ref-autogen/azure-eventgrid/azure.eventgrid.aio.EventGridPublisherClient.yml index 5a5e383347b1..e60bee708689 100644 --- a/preview/docs-ref-autogen/azure-eventgrid/azure.eventgrid.aio.EventGridPublisherClient.yml +++ b/preview/docs-ref-autogen/azure-eventgrid/azure.eventgrid.aio.EventGridPublisherClient.yml @@ -27,29 +27,6 @@ constructor: - - - -examples: -- "Creating the EventGridPublisherClient with an endpoint and AzureKeyCredential.\n\n\n\n````python\n\n import os\n from\ - \ azure.eventgrid.aio import EventGridPublisherClient\n from azure.core.credentials\ - \ import AzureKeyCredential\n\n topic_key = os.environ[\"EVENTGRID_TOPIC_KEY\"\ - ]\n endpoint = os.environ[\"EVENTGRID_TOPIC_ENDPOINT\"]\n\n credential = AzureKeyCredential(topic_key)\n\ - \ client = EventGridPublisherClient(endpoint, credential)\n\n ````\n\nCreating\ - \ the EventGridPublisherClient with an endpoint and AzureSasCredential.\n\n\n\n````python\n\n import os\n from\ - \ azure.eventgrid.aio import EventGridPublisherClient\n from azure.core.credentials\ - \ import AzureSasCredential\n\n signature = os.environ[\"EVENTGRID_SAS\"]\n \ - \ endpoint = os.environ[\"EVENTGRID_TOPIC_ENDPOINT\"]\n\n credential = AzureSasCredential(signature)\n\ - \ client = EventGridPublisherClient(endpoint, credential)\n\n ````\n" methods: - uid: azure.eventgrid.aio.EventGridPublisherClient.close name: close @@ -114,18 +91,3 @@ methods: return: types: - - examples: - - "Publishing a Custom Schema event.\n\n\n\n````python\n\ - \n credential = AzureKeyCredential(key)\n client = EventGridPublisherClient(endpoint,\ - \ credential)\n\n custom_schema_event = {\n \"customSubject\": \"sample\"\ - ,\n \"customEventType\": \"sample.event\",\n \"customDataVersion\"\ - : \"2.0\",\n \"customId\": uuid.uuid4(),\n \"customEventTime\": dt.datetime.now(UTC()).isoformat(),\n\ - \ \"customData\": \"sample data\",\n }\n async with client:\n \ - \ # publish list of events\n await client.send(custom_schema_event)\n\n\n\ - \ ````\n" diff --git a/preview/docs-ref-autogen/azure-eventgrid/azure.eventgrid.yml b/preview/docs-ref-autogen/azure-eventgrid/azure.eventgrid.yml index 2bf1858a4927..c58035df9009 100644 --- a/preview/docs-ref-autogen/azure-eventgrid/azure.eventgrid.yml +++ b/preview/docs-ref-autogen/azure-eventgrid/azure.eventgrid.yml @@ -32,19 +32,6 @@ functions: return: types: - - examples: - - "Generate a shared access signature.\n\n\n\n````python\n\n import os\n from azure.eventgrid import\ - \ generate_sas\n from datetime import datetime, timedelta\n\n topic_key =\ - \ os.environ[\"EVENTGRID_TOPIC_KEY\"]\n endpoint = os.environ[\"EVENTGRID_TOPIC_ENDPOINT\"\ - ]\n\n # represents the expiration date for sas\n expiration_date_utc = datetime.utcnow()\ - \ + timedelta(hours=10)\n\n signature = generate_sas(endpoint, topic_key, expiration_date_utc)\n\ - \n\n ````\n" classes: - azure.eventgrid.EventGridClient - azure.eventgrid.EventGridEvent diff --git a/preview/docs-ref-autogen/azure-eventhub/azure.eventhub.EventData.yml b/preview/docs-ref-autogen/azure-eventhub/azure.eventhub.EventData.yml index 0e2735f3015b..a13717596ec8 100644 --- a/preview/docs-ref-autogen/azure-eventhub/azure.eventhub.EventData.yml +++ b/preview/docs-ref-autogen/azure-eventhub/azure.eventhub.EventData.yml @@ -16,15 +16,6 @@ constructor: types: - - -examples: -- "Create instances of EventData\n\n\n\n````python\n\n from azure.eventhub\ - \ import EventData\n\n event_data = EventData(\"String data\")\n event_data\ - \ = EventData(b\"Bytes data\")\n\n\n ````\n" methods: - uid: azure.eventhub.EventData.body_as_json name: body_as_json diff --git a/preview/docs-ref-autogen/azure-eventhub/azure.eventhub.EventHubConsumerClient.yml b/preview/docs-ref-autogen/azure-eventhub/azure.eventhub.EventHubConsumerClient.yml index 45ee70e87151..e27a995d5141 100644 --- a/preview/docs-ref-autogen/azure-eventhub/azure.eventhub.EventHubConsumerClient.yml +++ b/preview/docs-ref-autogen/azure-eventhub/azure.eventhub.EventHubConsumerClient.yml @@ -265,21 +265,6 @@ constructor: False and the Pure Python AMQP library will be used as the underlying transport.' types: - -examples: -- "Create a new instance of the EventHubConsumerClient.\n\n\n\n````python\n\n import os\n from azure.eventhub\ - \ import EventHubConsumerClient, EventHubSharedKeyCredential\n\n fully_qualified_namespace\ - \ = os.environ['EVENT_HUB_HOSTNAME']\n eventhub_name = os.environ['EVENT_HUB_NAME']\n\ - \ shared_access_policy = os.environ['EVENT_HUB_SAS_POLICY']\n shared_access_key\ - \ = os.environ['EVENT_HUB_SAS_KEY']\n\n credential = EventHubSharedKeyCredential(shared_access_policy,\ - \ shared_access_key)\n consumer = EventHubConsumerClient(\n fully_qualified_namespace=fully_qualified_namespace,\n\ - \ eventhub_name=eventhub_name,\n consumer_group='$Default',\n \ - \ credential=credential)\n\n ````\n" methods: - uid: azure.eventhub.EventHubConsumerClient.close name: close @@ -289,30 +274,6 @@ methods: return: types: - - examples: - - "Close down the client.\n\n\n\n````python\n\ - \n import os\n import threading\n\n event_hub_connection_str = os.environ['EVENT_HUB_CONN_STR']\n\ - \ eventhub_name = os.environ['EVENT_HUB_NAME']\n\n from azure.eventhub import\ - \ EventHubConsumerClient\n consumer = EventHubConsumerClient.from_connection_string(\n\ - \ conn_str=event_hub_connection_str,\n consumer_group=\"$Default\"\ - ,\n eventhub_name=eventhub_name # EventHub name should be specified if\ - \ it doesn't show up in connection string.\n )\n\n logger = logging.getLogger(\"\ - azure.eventhub\")\n\n def on_event(partition_context, event):\n # Put\ - \ your code here.\n # If the operation is i/o intensive, multi-thread will\ - \ have better performance.\n logger.info(\"Received event from partition:\ - \ {}\".format(partition_context.partition_id))\n\n # The 'receive' method is\ - \ a blocking call, it can be executed in a thread for\n # non-blocking behavior,\ - \ and combined with the 'close' method.\n\n worker = threading.Thread(\n \ - \ target=consumer.receive,\n kwargs={\n \"on_event\": on_event,\n\ - \ \"starting_position\": \"-1\", # \"-1\" is from the beginning of\ - \ the partition.\n }\n )\n worker.start()\n time.sleep(10) # Keep\ - \ receiving for 10s then close.\n # Close down the consumer handler explicitly.\n\ - \ consumer.close()\n\n ````\n" - uid: azure.eventhub.EventHubConsumerClient.from_connection_string name: from_connection_string summary: Create an EventHubConsumerClient from a connection string. @@ -519,19 +480,6 @@ methods: return: types: - - examples: - - "Create a new instance of the EventHubConsumerClient from connection string.\n\n\n\n````python\n\n import os\n from azure.eventhub\ - \ import EventHubConsumerClient\n event_hub_connection_str = os.environ['EVENT_HUB_CONN_STR']\n\ - \ eventhub_name = os.environ['EVENT_HUB_NAME']\n consumer = EventHubConsumerClient.from_connection_string(\n\ - \ conn_str=event_hub_connection_str,\n consumer_group='$Default',\n\ - \ eventhub_name=eventhub_name # EventHub name should be specified if it\ - \ doesn't show up in connection string.\n )\n\n ````\n" - uid: azure.eventhub.EventHubConsumerClient.get_eventhub_properties name: get_eventhub_properties summary: "Get properties of the Event Hub.\n\nKeys in the returned dictionary include:\n\ @@ -737,19 +685,6 @@ methods: return: types: - - examples: - - "Receive events from the EventHub.\n\n\n\n````python\n\n logger = logging.getLogger(\"azure.eventhub\"\ - )\n\n def on_event(partition_context, event):\n # Put your code\ - \ here.\n # If the operation is i/o intensive, multi-thread will have\ - \ better performance.\n logger.info(\"Received event from partition:\ - \ {}\".format(partition_context.partition_id))\n\n with consumer:\n \ - \ consumer.receive(on_event=on_event)\n\n ````\n" - uid: azure.eventhub.EventHubConsumerClient.receive_batch name: receive_batch summary: Receive events from partition(s), with optional load-balancing and checkpointing. @@ -930,16 +865,3 @@ methods: return: types: - - examples: - - "Receive events in batches from the EventHub.\n\n\n\n````python\n\n logger = logging.getLogger(\"azure.eventhub\"\ - )\n\n def on_event_batch(partition_context, event_batch):\n #\ - \ Put your code here.\n # If the operation is i/o intensive, multi-thread\ - \ will have better performance.\n logger.info(\"Received events from\ - \ partition: {}\".format(partition_context.partition_id))\n\n with consumer:\n\ - \ consumer.receive_batch(on_event_batch=on_event_batch)\n\n ````\n" diff --git a/preview/docs-ref-autogen/azure-eventhub/azure.eventhub.EventHubProducerClient.yml b/preview/docs-ref-autogen/azure-eventhub/azure.eventhub.EventHubProducerClient.yml index 02867273c4e5..89257808614e 100644 --- a/preview/docs-ref-autogen/azure-eventhub/azure.eventhub.EventHubProducerClient.yml +++ b/preview/docs-ref-autogen/azure-eventhub/azure.eventhub.EventHubProducerClient.yml @@ -216,22 +216,6 @@ constructor: False and the Pure Python AMQP library will be used as the underlying transport.' types: - -examples: -- "Create a new instance of the EventHubProducerClient.\n\n\n\n````python\n\n import os\n from azure.eventhub\ - \ import EventHubProducerClient, EventHubSharedKeyCredential\n\n fully_qualified_namespace\ - \ = os.environ['EVENT_HUB_HOSTNAME']\n eventhub_name = os.environ['EVENT_HUB_NAME']\n\ - \ shared_access_policy = os.environ['EVENT_HUB_SAS_POLICY']\n shared_access_key\ - \ = os.environ['EVENT_HUB_SAS_KEY']\n\n credential = EventHubSharedKeyCredential(shared_access_policy,\ - \ shared_access_key)\n producer = EventHubProducerClient(\n fully_qualified_namespace=fully_qualified_namespace,\n\ - \ eventhub_name=eventhub_name, # EventHub name should be specified if it\ - \ doesn't show up in connection string.\n credential=credential\n )\n\n\ - \ ````\n" methods: - uid: azure.eventhub.EventHubProducerClient.close name: close @@ -260,25 +244,6 @@ methods: to True or closing the underlying AMQP connections in buffered mode.' - examples: - - "Close down the client.\n\n\n\n````python\n\ - \n import os\n from azure.eventhub import EventHubProducerClient, EventData\n\ - \n event_hub_connection_str = os.environ['EVENT_HUB_CONN_STR']\n eventhub_name\ - \ = os.environ['EVENT_HUB_NAME']\n\n producer = EventHubProducerClient.from_connection_string(\n\ - \ conn_str=event_hub_connection_str,\n eventhub_name=eventhub_name\ - \ # EventHub name should be specified if it doesn't show up in connection string.\n\ - \ )\n try:\n event_data_batch = producer.create_batch()\n\n while\ - \ True:\n try:\n event_data_batch.add(EventData('Message\ - \ inside EventBatchData'))\n except ValueError:\n # EventDataBatch\ - \ object reaches max_size.\n # New EventDataBatch object can be\ - \ created here to send more data\n break\n\n producer.send_batch(event_data_batch)\n\ - \ finally:\n # Close down the producer handler.\n producer.close()\n\ - \n ````\n" - uid: azure.eventhub.EventHubProducerClient.create_batch name: create_batch summary: 'Create an EventDataBatch object with the max size of all content being @@ -327,19 +292,6 @@ methods: return: types: - - examples: - - "Create EventDataBatch object within limited size\n\n\n\n````python\n\n event_data_batch = producer.create_batch()\n\ - \ while True:\n try:\n event_data_batch.add(EventData('Message\ - \ inside EventBatchData'))\n except ValueError:\n # The\ - \ EventDataBatch object reaches its max_size.\n # You can send the\ - \ full EventDataBatch object and create a new one here.\n break\n\ - \n ````\n" - uid: azure.eventhub.EventHubProducerClient.flush name: flush summary: 'Buffered mode only. @@ -556,19 +508,6 @@ methods: return: types: - - examples: - - "Create a new instance of the EventHubProducerClient from connection string.\n\n\n\n````python\n\n import os\n from azure.eventhub\ - \ import EventHubProducerClient\n event_hub_connection_str = os.environ['EVENT_HUB_CONN_STR']\n\ - \ eventhub_name = os.environ['EVENT_HUB_NAME']\n producer = EventHubProducerClient.from_connection_string(\n\ - \ conn_str=event_hub_connection_str,\n eventhub_name=eventhub_name\ - \ # EventHub name should be specified if it doesn't show up in connection string.\n\ - \ )\n\n ````\n" - uid: azure.eventhub.EventHubProducerClient.get_buffered_event_count name: get_buffered_event_count summary: "The number of events that are buffered and waiting to be published for\ @@ -731,19 +670,6 @@ methods: sent in non-buffered mode or the events can not be enqueued into the buffered in buffered mode.' - examples: - - "Sends event data\n\n\n\n````python\n\ - \n with producer:\n event_data_batch = producer.create_batch()\n\ - \n while True:\n try:\n event_data_batch.add(EventData('Message\ - \ inside EventBatchData'))\n except ValueError:\n \ - \ # EventDataBatch object reaches max_size.\n # New EventDataBatch\ - \ object can be created here to send more data\n break\n\n \ - \ producer.send_batch(event_data_batch)\n\n ````\n" - uid: azure.eventhub.EventHubProducerClient.send_event name: send_event summary: "Sends an event data.\nBy default, the method will block until acknowledgement\ diff --git a/preview/docs-ref-autogen/azure-eventhub/azure.eventhub.aio.EventHubConsumerClient.yml b/preview/docs-ref-autogen/azure-eventhub/azure.eventhub.aio.EventHubConsumerClient.yml index 35510e4b870e..b52f3242c5f5 100644 --- a/preview/docs-ref-autogen/azure-eventhub/azure.eventhub.aio.EventHubConsumerClient.yml +++ b/preview/docs-ref-autogen/azure-eventhub/azure.eventhub.aio.EventHubConsumerClient.yml @@ -265,22 +265,6 @@ constructor: False and the Pure Python AMQP library will be used as the underlying transport.' types: - -examples: -- "Create a new instance of the EventHubConsumerClient.\n\n\n\n````python\n\n import os\n from azure.eventhub.aio\ - \ import EventHubConsumerClient, EventHubSharedKeyCredential\n\n fully_qualified_namespace\ - \ = os.environ['EVENT_HUB_HOSTNAME']\n eventhub_name = os.environ['EVENT_HUB_NAME']\n\ - \ shared_access_policy = os.environ['EVENT_HUB_SAS_POLICY']\n shared_access_key\ - \ = os.environ['EVENT_HUB_SAS_KEY']\n\n consumer = EventHubConsumerClient(fully_qualified_namespace=fully_qualified_namespace,\n\ - \ consumer_group='$Default',\n \ - \ eventhub_name=eventhub_name,\n \ - \ credential=EventHubSharedKeyCredential(shared_access_policy, shared_access_key))\n\ - \n ````\n" methods: - uid: azure.eventhub.aio.EventHubConsumerClient.close name: close @@ -290,29 +274,6 @@ methods: return: types: - - examples: - - "Close down the client.\n\n\n\n````python\n\ - \n import os\n\n event_hub_connection_str = os.environ['EVENT_HUB_CONN_STR']\n\ - \ eventhub_name = os.environ['EVENT_HUB_NAME']\n\n from azure.eventhub.aio\ - \ import EventHubConsumerClient\n consumer = EventHubConsumerClient.from_connection_string(\n\ - \ conn_str=event_hub_connection_str,\n consumer_group='$Default',\n\ - \ eventhub_name=eventhub_name # EventHub name should be specified if it\ - \ doesn't show up in connection string.\n )\n\n logger = logging.getLogger(\"\ - azure.eventhub\")\n\n async def on_event(partition_context, event):\n \ - \ # Put your code here.\n # If the operation is i/o intensive, async will\ - \ have better performance.\n logger.info(\"Received event from partition:\ - \ {}\".format(partition_context.partition_id))\n\n # The receive method is a\ - \ coroutine which will be blocking when awaited.\n # It can be executed in an\ - \ async task for non-blocking behavior, and combined with the 'close' method.\n\ - \n recv_task = asyncio.ensure_future(consumer.receive(on_event=on_event))\n\ - \ await asyncio.sleep(3) # keep receiving for 3 seconds\n recv_task.cancel()\ - \ # stop receiving\n\n # Close down the consumer handler explicitly.\n await\ - \ consumer.close()\n\n ````\n" - uid: azure.eventhub.aio.EventHubConsumerClient.from_connection_string name: from_connection_string summary: Create an EventHubConsumerClient from a connection string. @@ -523,20 +484,6 @@ methods: return: types: - - examples: - - "Create a new instance of the EventHubConsumerClient from connection string.\n\n\n\n````python\n\n import os\n from\ - \ azure.eventhub.aio import EventHubConsumerClient\n event_hub_connection_str\ - \ = os.environ['EVENT_HUB_CONN_STR']\n eventhub_name = os.environ['EVENT_HUB_NAME']\n\ - \ consumer = EventHubConsumerClient.from_connection_string(\n conn_str=event_hub_connection_str,\n\ - \ consumer_group='$Default',\n eventhub_name=eventhub_name # EventHub\ - \ name should be specified if it doesn't show up in connection string.\n )\n\ - \n ````\n" - uid: azure.eventhub.aio.EventHubConsumerClient.get_eventhub_properties name: get_eventhub_properties summary: "Get properties of the Event Hub.\n\nKeys in the returned dictionary include:\n\ @@ -747,21 +694,6 @@ methods: return: types: - - examples: - - "Receive events from the EventHub.\n\n\n\n````python\n\n logger = logging.getLogger(\"\ - azure.eventhub\")\n\n async def on_event(partition_context, event):\n \ - \ # Put your code here.\n # If the operation is i/o intensive,\ - \ async will have better performance.\n logger.info(\"Received event\ - \ from partition: {}\".format(partition_context.partition_id))\n\n async\ - \ with consumer:\n await consumer.receive(\n on_event=on_event,\n\ - \ starting_position=\"-1\", # \"-1\" is from the beginning of the\ - \ partition.\n )\n\n ````\n" - uid: azure.eventhub.aio.EventHubConsumerClient.receive_batch name: receive_batch summary: Receive events from partition(s) in batches, with optional load-balancing @@ -951,18 +883,3 @@ methods: return: types: - - examples: - - "Receive events in batches from the EventHub.\n\n\n\n````python\n\n logger = logging.getLogger(\"\ - azure.eventhub\")\n\n async def on_event_batch(partition_context, event_batch):\n\ - \ # Put your code here.\n # If the operation is i/o intensive,\ - \ async will have better performance.\n logger.info(\n \ - \ \"{} events received from partition: {}\".format(len(event_batch), partition_context.partition_id)\n\ - \ )\n\n async with consumer:\n await consumer.receive_batch(\n\ - \ on_event_batch=on_event_batch,\n starting_position=\"\ - -1\", # \"-1\" is from the beginning of the partition.\n )\n\n ````\n" diff --git a/preview/docs-ref-autogen/azure-eventhub/azure.eventhub.aio.EventHubProducerClient.yml b/preview/docs-ref-autogen/azure-eventhub/azure.eventhub.aio.EventHubProducerClient.yml index 5f5700b25cba..577e2c527a77 100644 --- a/preview/docs-ref-autogen/azure-eventhub/azure.eventhub.aio.EventHubProducerClient.yml +++ b/preview/docs-ref-autogen/azure-eventhub/azure.eventhub.aio.EventHubProducerClient.yml @@ -208,21 +208,6 @@ constructor: False and the Pure Python AMQP library will be used as the underlying transport.' types: - -examples: -- "Create a new instance of the EventHubProducerClient.\n\n\n\n````python\n\n import os\n from azure.eventhub.aio\ - \ import EventHubProducerClient, EventHubSharedKeyCredential\n\n fully_qualified_namespace\ - \ = os.environ['EVENT_HUB_HOSTNAME']\n eventhub_name = os.environ['EVENT_HUB_NAME']\n\ - \ shared_access_policy = os.environ['EVENT_HUB_SAS_POLICY']\n shared_access_key\ - \ = os.environ['EVENT_HUB_SAS_KEY']\n\n producer = EventHubProducerClient(fully_qualified_namespace=fully_qualified_namespace,\n\ - \ eventhub_name=eventhub_name,\n \ - \ credential=EventHubSharedKeyCredential(shared_access_policy,\ - \ shared_access_key))\n\n ````\n" methods: - uid: azure.eventhub.aio.EventHubProducerClient.close name: close @@ -251,25 +236,6 @@ methods: to True or closing the underlying AMQP connections in buffered mode.' - examples: - - "Close down the handler.\n\n\n\n````python\n\ - \n import os\n from azure.eventhub.aio import EventHubProducerClient\n from\ - \ azure.eventhub import EventData\n\n event_hub_connection_str = os.environ['EVENT_HUB_CONN_STR']\n\ - \ eventhub_name = os.environ['EVENT_HUB_NAME']\n\n producer = EventHubProducerClient.from_connection_string(\n\ - \ conn_str=event_hub_connection_str,\n eventhub_name=eventhub_name\ - \ # EventHub name should be specified if it doesn't show up in connection string.\n\ - \ )\n try:\n event_data_batch = await producer.create_batch()\n \ - \ while True:\n try:\n event_data_batch.add(EventData('Message\ - \ inside EventBatchData'))\n except ValueError:\n # The\ - \ EventDataBatch object reaches its max_size.\n # You can send the\ - \ full EventDataBatch object and create a new one here.\n break\n\ - \ await producer.send_batch(event_data_batch)\n finally:\n # Close\ - \ down the producer handler.\n await producer.close()\n\n ````\n" - uid: azure.eventhub.aio.EventHubProducerClient.create_batch name: create_batch summary: 'Create an EventDataBatch object with the max size of all content being @@ -322,20 +288,6 @@ methods: return: types: - - examples: - - "Create EventDataBatch object within limited size\n\n\n\n````python\n\n from azure.eventhub\ - \ import EventData\n event_data_batch = await producer.create_batch()\n\ - \ while True:\n try:\n event_data_batch.add(EventData('Message\ - \ inside EventBatchData'))\n except ValueError:\n # The\ - \ EventDataBatch object reaches its max_size.\n # You can send the\ - \ full EventDataBatch object and create a new one here.\n break\n\ - \n ````\n" - uid: azure.eventhub.aio.EventHubProducerClient.flush name: flush summary: 'Buffered mode only. @@ -539,19 +491,6 @@ methods: return: types: - - examples: - - "Create a new instance of the EventHubProducerClient from connection string.\n\n\n\n````python\n\n import os\n from\ - \ azure.eventhub.aio import EventHubProducerClient\n event_hub_connection_str\ - \ = os.environ['EVENT_HUB_CONN_STR']\n eventhub_name = os.environ['EVENT_HUB_NAME']\n\ - \ producer = EventHubProducerClient.from_connection_string(\n conn_str=event_hub_connection_str,\n\ - \ eventhub_name=eventhub_name # EventHub name should be specified if it\ - \ doesn't show up in connection string.\n )\n\n ````\n" - uid: azure.eventhub.aio.EventHubProducerClient.get_buffered_event_count name: get_buffered_event_count summary: "The number of events that are buffered and waiting to be published for\ @@ -713,20 +652,6 @@ methods: sent in non-buffered mode or the events can be enqueued into the buffered in buffered mode.' - examples: - - "Asynchronously sends event data\n\n\n\n````python\n\ - \n async with producer:\n event_data_batch = await producer.create_batch()\n\ - \ while True:\n try:\n event_data_batch.add(EventData('Message\ - \ inside EventBatchData'))\n except ValueError:\n \ - \ # The EventDataBatch object reaches its max_size.\n #\ - \ You can send the full EventDataBatch object and create a new one here.\n \ - \ break\n await producer.send_batch(event_data_batch)\n\ - \n ````\n" - uid: azure.eventhub.aio.EventHubProducerClient.send_event name: send_event summary: "Sends an event data.\nBy default, the method will block until acknowledgement\ diff --git a/preview/docs-ref-autogen/azure-identity/azure.identity.TokenCachePersistenceOptions.yml b/preview/docs-ref-autogen/azure-identity/azure.identity.TokenCachePersistenceOptions.yml index c50af928ed0b..f024823a33b9 100644 --- a/preview/docs-ref-autogen/azure-identity/azure.identity.TokenCachePersistenceOptions.yml +++ b/preview/docs-ref-autogen/azure-identity/azure.identity.TokenCachePersistenceOptions.yml @@ -60,15 +60,3 @@ constructor: always try to encrypt its data.' types: - -examples: -- "Configuring a credential for persistent caching\n\n\n\n````python\n\n cache_options\ - \ = TokenCachePersistenceOptions()\n credential = InteractiveBrowserCredential(cache_persistence_options=cache_options)\n\ - \n # specify a cache name to isolate the cache from other applications\n TokenCachePersistenceOptions(name=\"\ - my_application\")\n\n # configure the cache to fall back to unencrypted storage\ - \ when encryption isn't available\n TokenCachePersistenceOptions(allow_unencrypted_storage=True)\n\ - \n ````\n" diff --git a/preview/docs-ref-autogen/azure-keyvault-administration/azure.keyvault.administration.KeyVaultBackupClient.yml b/preview/docs-ref-autogen/azure-keyvault-administration/azure.keyvault.administration.KeyVaultBackupClient.yml index 00441f8dbbdc..e2b6a39081e2 100644 --- a/preview/docs-ref-autogen/azure-keyvault-administration/azure.keyvault.administration.KeyVaultBackupClient.yml +++ b/preview/docs-ref-autogen/azure-keyvault-administration/azure.keyvault.administration.KeyVaultBackupClient.yml @@ -71,17 +71,6 @@ methods: operation to complete and get a .' types: - [] - examples: - - "Create a vault backup\n\n\n\n````python\n\ - \n # begin a vault backup\n backup_poller = backup_client.begin_backup(container_uri,\ - \ sas_token)\n\n # check if the backup completed\n done = backup_poller.done()\n\ - \n # block until the backup completes\n # result() returns an object with\ - \ a URL of the backup\n backup_operation = backup_poller.result()\n\n ````\n" - uid: azure.keyvault.administration.KeyVaultBackupClient.begin_restore name: begin_restore summary: 'Restore a Key Vault backup. @@ -120,23 +109,3 @@ methods: return: types: - - examples: - - "Restore a vault backup\n\n\n\n````python\n\ - \n # begin a full vault restore\n restore_poller = backup_client.begin_restore(folder_url,\ - \ sas_token)\n\n # check if the restore completed\n done = restore_poller.done()\n\ - \n # wait for the restore to complete\n restore_poller.wait()\n\n ````\n\ - \nRestore a single key\n\n\n\n````python\n\ - \n # begin a restore of a single key from a backed up vault\n restore_poller\ - \ = backup_client.begin_restore(folder_url, sas_token, key_name=key_name)\n\n\ - \ # check if the restore completed\n done = restore_poller.done()\n\n #\ - \ wait for the restore to complete\n restore_poller.wait()\n\n ````\n" diff --git a/preview/docs-ref-autogen/azure-keyvault-administration/azure.keyvault.administration.aio.KeyVaultBackupClient.yml b/preview/docs-ref-autogen/azure-keyvault-administration/azure.keyvault.administration.aio.KeyVaultBackupClient.yml index 1d41c308e838..0d83f76ba258 100644 --- a/preview/docs-ref-autogen/azure-keyvault-administration/azure.keyvault.administration.aio.KeyVaultBackupClient.yml +++ b/preview/docs-ref-autogen/azure-keyvault-administration/azure.keyvault.administration.aio.KeyVaultBackupClient.yml @@ -70,18 +70,6 @@ methods: description: An AsyncLROPoller. Call *result()* on this object to get a . types: - [] - examples: - - "Create a vault backup\n\n\n\n````python\n\ - \n # begin a vault backup\n backup_poller = await backup_client.begin_backup(container_uri,\ - \ sas_token)\n\n # check if the backup completed\n done = backup_poller.done()\n\ - \n # yield until the backup completes\n # result() returns an object with\ - \ a URL of the backup\n backup_operation = await backup_poller.result()\n\n\ - \ ````\n" - uid: azure.keyvault.administration.aio.KeyVaultBackupClient.begin_restore name: begin_restore summary: 'Restore a Key Vault backup. @@ -123,23 +111,3 @@ methods: return: types: - - examples: - - "Restore a vault backup\n\n\n\n````python\n\ - \n # begin a full vault restore\n restore_poller = await backup_client.begin_restore(folder_url,\ - \ sas_token)\n\n # check if the restore completed\n done = restore_poller.done()\n\ - \n # wait for the restore to complete\n await restore_poller.wait()\n\n \ - \ ````\n\nRestore a single key\n\n\n\n````python\n\ - \n # begin a restore of a single key from a backed up vault\n restore_poller\ - \ = await backup_client.begin_restore(folder_url, sas_token, key_name=key_name)\n\ - \n # check if the restore completed\n done = restore_poller.done()\n\n #\ - \ wait for the restore to complete\n await restore_poller.wait()\n\n ````\n" diff --git a/preview/docs-ref-autogen/azure-keyvault-certificates/azure.keyvault.certificates.CertificateClient.yml b/preview/docs-ref-autogen/azure-keyvault-certificates/azure.keyvault.certificates.CertificateClient.yml index 15c1264b03ef..c979f866b90e 100644 --- a/preview/docs-ref-autogen/azure-keyvault-certificates/azure.keyvault.certificates.CertificateClient.yml +++ b/preview/docs-ref-autogen/azure-keyvault-certificates/azure.keyvault.certificates.CertificateClient.yml @@ -39,17 +39,6 @@ constructor: Vault domain. Defaults to True.' types: - -examples: -- "Create a new `CertificateClient`\n\n\n\n````python\n\n from azure.identity\ - \ import DefaultAzureCredential\n from azure.keyvault.certificates import CertificateClient\n\ - \n # Create a CertificateClient using default Azure credentials\n credential\ - \ = DefaultAzureCredential()\n certificate_client = CertificateClient(vault_url=vault_url,\ - \ credential=credential)\n\n ````\n" methods: - uid: azure.keyvault.certificates.CertificateClient.backup_certificate name: backup_certificate @@ -82,16 +71,6 @@ methods: description: if the certificate doesn't exist, - type: azure.core.exceptions.HttpResponseError description: for other errors - examples: - - "Get a certificate backup\n\n\n\n````python\n\ - \n # backup certificate\n certificate_backup = certificate_client.backup_certificate(cert_name)\n\ - \n # returns the raw bytes of the backed up certificate\n print(certificate_backup)\n\ - \n ````\n" - uid: azure.keyvault.certificates.CertificateClient.begin_create_certificate name: begin_create_certificate summary: "Creates a new certificate.\n\nIf this is the first version, the certificate\ @@ -136,28 +115,6 @@ methods: description: if the certificate policy is invalid, - type: azure.core.exceptions.HttpResponseError description: for other errors. - examples: - - "Create a certificate\n\n\n\n````python\n\ - \n from azure.keyvault.certificates import (CertificateContentType,\n \ - \ CertificatePolicy,\n \ - \ WellKnownIssuerNames)\n\n # specify the certificate\ - \ policy\n cert_policy = CertificatePolicy(\n issuer_name=WellKnownIssuerNames.self,\n\ - \ subject=\"CN=*.microsoft.com\",\n san_dns_names=[\"sdk.azure-int.net\"\ - ],\n exportable=True,\n key_type=\"RSA\",\n key_size=2048,\n\ - \ reuse_key=False,\n content_type=CertificateContentType.pkcs12,\n\ - \ validity_in_months=24,\n )\n\n # create a certificate with optional\ - \ arguments, returns a long running operation poller\n certificate_operation_poller\ - \ = certificate_client.begin_create_certificate(\n certificate_name=cert_name,\ - \ policy=cert_policy\n )\n\n # Here we are waiting for the certificate creation\ - \ operation to be completed\n certificate = certificate_operation_poller.result()\n\ - \n # You can get the final status of the certificate operation poller using\ - \ .result()\n print(certificate_operation_poller.result())\n\n print(certificate.id)\n\ - \ print(certificate.name)\n print(certificate.policy.issuer_name)\n\n ````\n" - uid: azure.keyvault.certificates.CertificateClient.begin_delete_certificate name: begin_delete_certificate summary: 'Delete all versions of a certificate. Requires certificates/delete permission. @@ -198,18 +155,6 @@ methods: description: if the certificate doesn't exist, - type: azure.core.exceptions.HttpResponseError description: for other errors - examples: - - "Delete a certificate\n\n\n\n````python\n\ - \n # delete a certificate\n deleted_certificate = certificate_client.begin_delete_certificate(certificate.name).result()\n\ - \n print(deleted_certificate.name)\n\n # if the vault has soft-delete enabled,\ - \ the certificate's deleted date,\n # scheduled purge date, and recovery id\ - \ are available\n print(deleted_certificate.deleted_on)\n print(deleted_certificate.scheduled_purge_date)\n\ - \ print(deleted_certificate.recovery_id)\n\n ````\n" - uid: azure.keyvault.certificates.CertificateClient.begin_recover_deleted_certificate name: begin_recover_deleted_certificate summary: 'Recover a deleted certificate to its latest version. Possible only in @@ -249,17 +194,6 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Recover a deleted certificate\n\n\n\n````python\n\ - \n # recover a deleted certificate to its latest version (requires soft-delete\ - \ enabled for the vault)\n recovered_certificate = certificate_client.begin_recover_deleted_certificate(cert_name).result()\n\ - \n print(recovered_certificate.id)\n print(recovered_certificate.name)\n\n\ - \ ````\n" - uid: azure.keyvault.certificates.CertificateClient.cancel_certificate_operation name: cancel_certificate_operation summary: Cancels an in-progress certificate operation. Requires the certificates/update @@ -321,23 +255,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Create an issuer\n\ - \n\n\n````python\n\ - \n from azure.keyvault.certificates import AdministratorContact\n\n # First\ - \ we specify the AdministratorContact for a issuer.\n admin_contacts = [\n \ - \ AdministratorContact(first_name=\"John\", last_name=\"Doe\", email=\"admin@microsoft.com\"\ - , phone=\"4255555555\")\n ]\n\n issuer = certificate_client.create_issuer(\n\ - \ issuer_name=\"issuer1\",\n provider=\"Test\",\n account_id=\"\ - keyvaultuser\",\n admin_contacts=admin_contacts,\n enabled=True,\n\ - \ )\n\n print(issuer.name)\n print(issuer.provider)\n print(issuer.account_id)\n\ - \n for contact in issuer.admin_contacts:\n print(contact.first_name)\n\ - \ print(contact.last_name)\n print(contact.email)\n print(contact.phone)\n\ - \n ````\n" - uid: azure.keyvault.certificates.CertificateClient.delete_certificate_operation name: delete_certificate_operation summary: 'Deletes and stops the creation operation for a specific certificate. @@ -368,16 +285,6 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Delete contacts\n\ - \n\n\n````python\n\ - \n deleted_contacts = certificate_client.delete_contacts()\n\n for deleted_contact\ - \ in deleted_contacts:\n print(deleted_contact.name)\n print(deleted_contact.email)\n\ - \ print(deleted_contact.phone)\n\n ````\n" - uid: azure.keyvault.certificates.CertificateClient.delete_issuer name: delete_issuer summary: 'Deletes the specified certificate issuer. @@ -397,18 +304,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Delete an issuer\n\ - \n\n\n````python\n\ - \n deleted_issuer = certificate_client.delete_issuer(\"issuer1\")\n\n print(deleted_issuer.name)\n\ - \ print(deleted_issuer.provider)\n print(deleted_issuer.account_id)\n\n \ - \ for contact in deleted_issuer.admin_contacts:\n print(contact.first_name)\n\ - \ print(contact.last_name)\n print(contact.email)\n print(contact.phone)\n\ - \n ````\n" - uid: azure.keyvault.certificates.CertificateClient.get_certificate name: get_certificate summary: 'Gets a certificate with its management policy attached. Requires certificates/get @@ -435,16 +330,6 @@ methods: description: if the certificate doesn't exist, - type: azure.core.exceptions.HttpResponseError description: for other errors - examples: - - "Get a certificate\n\ - \n\n\n````python\n\ - \n # get the certificate\n certificate = certificate_client.get_certificate(cert_name)\n\ - \n print(certificate.id)\n print(certificate.name)\n print(certificate.policy.issuer_name)\n\ - \n ````\n" - uid: azure.keyvault.certificates.CertificateClient.get_certificate_operation name: get_certificate_operation summary: Gets the creation operation of a certificate. Requires the certificates/get @@ -516,15 +401,6 @@ methods: description: if the certificate doesn't exist, - type: azure.core.exceptions.HttpResponseError description: for other errors - examples: - - "Get a certificate with a specific version\n\n\n\n````python\n\ - \n certificate = certificate_client.get_certificate_version(cert_name, version)\n\ - \n print(certificate.id)\n print(certificate.properties.version)\n\n ````\n" - uid: azure.keyvault.certificates.CertificateClient.get_contacts name: get_contacts summary: Gets the certificate contacts for the key vault. Requires the certificates/managecontacts @@ -536,16 +412,6 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Get contacts\n\n\ - \n\n````python\n\ - \n contacts = certificate_client.get_contacts()\n\n # Loop through the certificate\ - \ contacts for this key vault.\n for contact in contacts:\n print(contact.name)\n\ - \ print(contact.email)\n print(contact.phone)\n\n ````\n" - uid: azure.keyvault.certificates.CertificateClient.get_deleted_certificate name: get_deleted_certificate summary: 'Get a deleted certificate. Possible only in a vault with soft-delete enabled. @@ -572,19 +438,6 @@ methods: description: if the certificate doesn't exist, - type: azure.core.exceptions.HttpResponseError description: for other errors - examples: - - "Get a deleted certificate\n\n\n\n````python\n\ - \n # get a deleted certificate (requires soft-delete enabled for the vault)\n\ - \ deleted_certificate = certificate_client.get_deleted_certificate(cert_name)\n\ - \ print(deleted_certificate.name)\n\n # if the vault has soft-delete enabled,\ - \ the certificate's deleted date,\n # scheduled purge date, and recovery id\ - \ are available\n print(deleted_certificate.deleted_on)\n print(deleted_certificate.scheduled_purge_date)\n\ - \ print(deleted_certificate.recovery_id)\n\n ````\n" - uid: azure.keyvault.certificates.CertificateClient.get_issuer name: get_issuer summary: Gets the specified certificate issuer. Requires certificates/manageissuers/getissuers @@ -605,17 +458,6 @@ methods: description: if the issuer doesn't exist, - type: azure.core.exceptions.HttpResponseError description: for other errors - examples: - - "Get an issuer\n\ - \n\n\n````python\n\ - \n issuer = certificate_client.get_issuer(\"issuer1\")\n\n print(issuer.name)\n\ - \ print(issuer.provider)\n print(issuer.account_id)\n\n for contact in issuer.admin_contacts:\n\ - \ print(contact.first_name)\n print(contact.last_name)\n print(contact.email)\n\ - \ print(contact.phone)\n\n ````\n" - uid: azure.keyvault.certificates.CertificateClient.import_certificate name: import_certificate summary: 'Import a certificate created externally. Requires certificates/import @@ -703,19 +545,6 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "List all the deleted certificates\n\n\n\n````python\n\ - \n # get an iterator of deleted certificates (requires soft-delete enabled for\ - \ the vault)\n deleted_certificates = certificate_client.list_deleted_certificates()\n\ - \n for certificate in deleted_certificates:\n print(certificate.id)\n\ - \ print(certificate.name)\n print(certificate.deleted_on)\n \ - \ print(certificate.scheduled_purge_date)\n print(certificate.deleted_on)\n\ - \n ````\n" - uid: azure.keyvault.certificates.CertificateClient.list_properties_of_certificate_versions name: list_properties_of_certificate_versions summary: 'List the identifiers and properties of a certificate''s versions. @@ -736,18 +565,6 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "List all versions of a certificate\n\n\n\n````python\n\ - \n # get an iterator of a certificate's versions\n certificate_versions =\ - \ certificate_client.list_properties_of_certificate_versions(certificate_name)\n\ - \n for certificate in certificate_versions:\n print(certificate.id)\n\ - \ print(certificate.updated_on)\n print(certificate.version)\n\n \ - \ ````\n" - uid: azure.keyvault.certificates.CertificateClient.list_properties_of_certificates name: list_properties_of_certificates summary: 'List identifiers and properties of all certificates in the vault. @@ -769,17 +586,6 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "List all certificates\n\n\n\n````python\n\ - \n # get an iterator of certificates\n certificates = certificate_client.list_properties_of_certificates()\n\ - \n for certificate in certificates:\n print(certificate.id)\n print(certificate.created_on)\n\ - \ print(certificate.name)\n print(certificate.updated_on)\n \ - \ print(certificate.enabled)\n\n ````\n" - uid: azure.keyvault.certificates.CertificateClient.list_properties_of_issuers name: list_properties_of_issuers summary: 'Lists properties of the certificate issuers for the key vault. @@ -793,16 +599,6 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "List issuers of a vault\n\n\n\n````python\n\ - \n issuers = certificate_client.list_properties_of_issuers()\n\n for issuer\ - \ in issuers:\n print(issuer.name)\n print(issuer.provider)\n\n \ - \ ````\n" - uid: azure.keyvault.certificates.CertificateClient.merge_certificate name: merge_certificate summary: 'Merges a certificate or a certificate chain with a key pair existing on @@ -904,16 +700,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Restore a certificate backup\n\n\n\n````python\n\ - \n # restore a certificate backup\n restored_certificate = certificate_client.restore_certificate_backup(certificate_backup)\n\ - \n print(restored_certificate.id)\n print(restored_certificate.name)\n print(restored_certificate.properties.version)\n\ - \n ````\n" - uid: azure.keyvault.certificates.CertificateClient.set_contacts name: set_contacts summary: Sets the certificate contacts for the key vault. Requires certificates/managecontacts @@ -931,20 +717,6 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Create contacts\n\ - \n\n\n````python\n\ - \n from azure.keyvault.certificates import CertificateContact\n\n # Create\ - \ a list of the contacts that you want to set for this key vault.\n contact_list\ - \ = [\n CertificateContact(email=\"admin@contoso.com\", name=\"John Doe\"\ - , phone=\"1111111111\"),\n CertificateContact(email=\"admin2@contoso.com\"\ - , name=\"John Doe2\", phone=\"2222222222\"),\n ]\n\n contacts = certificate_client.set_contacts(contact_list)\n\ - \ for contact in contacts:\n print(contact.name)\n print(contact.email)\n\ - \ print(contact.phone)\n\n ````\n" - uid: azure.keyvault.certificates.CertificateClient.update_certificate_policy name: update_certificate_policy summary: 'Updates the policy for a certificate. Requires certificates/update permission. @@ -1000,18 +772,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Update a certificate's attributes\n\n\n\n````python\n\ - \n # update attributes of an existing certificate\n tags = {\"foo\": \"updated\ - \ tag\"}\n updated_certificate = certificate_client.update_certificate_properties(\n\ - \ certificate_name=certificate.name, tags=tags\n )\n\n print(updated_certificate.properties.version)\n\ - \ print(updated_certificate.properties.updated_on)\n print(updated_certificate.properties.tags)\n\ - \n ````\n" - uid: azure.keyvault.certificates.CertificateClient.update_issuer name: update_issuer summary: Updates the specified certificate issuer. Requires certificates/setissuers diff --git a/preview/docs-ref-autogen/azure-keyvault-certificates/azure.keyvault.certificates.KeyVaultCertificateIdentifier.yml b/preview/docs-ref-autogen/azure-keyvault-certificates/azure.keyvault.certificates.KeyVaultCertificateIdentifier.yml index 75469861900c..780cefa605c6 100644 --- a/preview/docs-ref-autogen/azure-keyvault-certificates/azure.keyvault.certificates.KeyVaultCertificateIdentifier.yml +++ b/preview/docs-ref-autogen/azure-keyvault-certificates/azure.keyvault.certificates.KeyVaultCertificateIdentifier.yml @@ -14,16 +14,6 @@ constructor: isRequired: true types: - -examples: -- "Parse a certificate's ID\n\n\n\n````python\n\n cert = client.get_certificate(cert_name)\n\ - \ parsed_certificate_id = KeyVaultCertificateIdentifier(cert.id)\n\n print(parsed_certificate_id.name)\n\ - \ print(parsed_certificate_id.vault_url)\n print(parsed_certificate_id.version)\n\ - \ print(parsed_certificate_id.source_id)\n\n ````\n" attributes: - uid: azure.keyvault.certificates.KeyVaultCertificateIdentifier.name name: name diff --git a/preview/docs-ref-autogen/azure-keyvault-certificates/azure.keyvault.certificates.aio.CertificateClient.yml b/preview/docs-ref-autogen/azure-keyvault-certificates/azure.keyvault.certificates.aio.CertificateClient.yml index f3cc75c9599a..941b09bce8bd 100644 --- a/preview/docs-ref-autogen/azure-keyvault-certificates/azure.keyvault.certificates.aio.CertificateClient.yml +++ b/preview/docs-ref-autogen/azure-keyvault-certificates/azure.keyvault.certificates.aio.CertificateClient.yml @@ -39,19 +39,6 @@ constructor: Vault domain. Defaults to True.' types: - -examples: -- "Creates a new instance of the Certificate client\n\n\n\n````python\n\n from azure.identity.aio\ - \ import DefaultAzureCredential\n from azure.keyvault.certificates.aio import\ - \ CertificateClient\n\n # Create a KeyVaultCertificate using default Azure credentials\n\ - \ credential = DefaultAzureCredential()\n certificate_client = CertificateClient(vault_url=vault_url,\ - \ credential=credential)\n\n # the client and credential should be closed when\ - \ no longer needed\n # (both are also async context managers)\n await certificate_client.close()\n\ - \ await credential.close()\n\n ````\n" methods: - uid: azure.keyvault.certificates.aio.CertificateClient.backup_certificate name: backup_certificate @@ -84,16 +71,6 @@ methods: description: if the certificate doesn't exist, - type: azure.core.exceptions.HttpResponseError description: for other errors - examples: - - "Get a certificate backup\n\n\n\n````python\n\ - \n # backup certificate\n certificate_backup = await certificate_client.backup_certificate(cert_name)\n\ - \n # returns the raw bytes of the backed up certificate\n print(certificate_backup)\n\ - \n ````\n" - uid: azure.keyvault.certificates.aio.CertificateClient.cancel_certificate_operation name: cancel_certificate_operation summary: Cancels an in-progress certificate operation. Requires the certificates/update @@ -162,22 +139,6 @@ methods: description: if the certificate policy is invalid, - type: azure.core.exceptions.HttpResponseError description: for other errors. - examples: - - "Create a certificate\n\n\n\n````python\n\ - \n from azure.keyvault.certificates import CertificatePolicy, CertificateContentType,\ - \ WellKnownIssuerNames\n\n # specify the certificate policy\n cert_policy\ - \ = CertificatePolicy(\n issuer_name=WellKnownIssuerNames.self,\n \ - \ subject=\"CN=*.microsoft.com\",\n san_dns_names=[\"sdk.azure-int.net\"\ - ],\n exportable=True,\n key_type=\"RSA\",\n key_size=2048,\n\ - \ reuse_key=False,\n content_type=CertificateContentType.pkcs12,\n\ - \ validity_in_months=24,\n )\n\n certificate = await certificate_client.create_certificate(certificate_name=cert_name,\ - \ policy=cert_policy)\n\n print(certificate.id)\n print(certificate.name)\n\ - \ print(certificate.policy.issuer_name)\n\n ````\n" - uid: azure.keyvault.certificates.aio.CertificateClient.create_issuer name: create_issuer summary: Sets the specified certificate issuer. Requires certificates/setissuers @@ -222,23 +183,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Create an issuer\n\n\n\n````python\n\ - \n from azure.keyvault.certificates import AdministratorContact\n\n # First\ - \ we specify the AdministratorContact for a issuer.\n admin_contacts = [\n \ - \ AdministratorContact(first_name=\"John\", last_name=\"Doe\", email=\"admin@microsoft.com\"\ - , phone=\"4255555555\")\n ]\n\n issuer = await certificate_client.create_issuer(\n\ - \ issuer_name=\"issuer1\",\n provider=\"Test\",\n account_id=\"\ - keyvaultuser\",\n admin_contacts=admin_contacts,\n enabled=True,\n\ - \ )\n\n print(issuer.name)\n print(issuer.provider)\n print(issuer.account_id)\n\ - \n for contact in issuer.admin_contacts:\n print(contact.first_name)\n\ - \ print(contact.last_name)\n print(contact.email)\n print(contact.phone)\n\ - \n ````\n" - uid: azure.keyvault.certificates.aio.CertificateClient.delete_certificate name: delete_certificate summary: 'Delete all versions of a certificate. Requires certificates/delete permission. @@ -261,18 +205,6 @@ methods: description: if the certificate doesn't exist, - type: azure.core.exceptions.HttpResponseError description: for other errors - examples: - - "Delete a certificate\n\n\n\n````python\n\ - \n # delete a certificate\n deleted_certificate = await certificate_client.delete_certificate(cert_name)\n\ - \n print(deleted_certificate.name)\n\n # if the vault has soft-delete enabled,\ - \ the certificate's\n # scheduled purge date, deleted_on, and recovery id are\ - \ available\n print(deleted_certificate.deleted_on)\n print(deleted_certificate.scheduled_purge_date)\n\ - \ print(deleted_certificate.recovery_id)\n\n ````\n" - uid: azure.keyvault.certificates.aio.CertificateClient.delete_certificate_operation name: delete_certificate_operation summary: 'Deletes and stops the creation operation for a specific certificate. @@ -307,16 +239,6 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Delete contacts\n\n\n\n````python\n\ - \n deleted_contacts = await certificate_client.delete_contacts()\n\n for deleted_contact\ - \ in deleted_contacts:\n print(deleted_contact.name)\n print(deleted_contact.email)\n\ - \ print(deleted_contact.phone)\n\n ````\n" - uid: azure.keyvault.certificates.aio.CertificateClient.delete_issuer name: delete_issuer summary: 'Deletes the specified certificate issuer. @@ -336,18 +258,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Delete an issuer\n\n\n\n````python\n\ - \n deleted_issuer = await certificate_client.delete_issuer(\"issuer1\")\n\n\ - \ print(deleted_issuer.name)\n print(deleted_issuer.provider)\n print(deleted_issuer.account_id)\n\ - \n for contact in deleted_issuer.admin_contacts:\n print(contact.first_name)\n\ - \ print(contact.last_name)\n print(contact.email)\n print(contact.phone)\n\ - \n ````\n" - uid: azure.keyvault.certificates.aio.CertificateClient.get_certificate name: get_certificate summary: 'Gets a certificate with its management policy attached. Requires certificates/get @@ -374,16 +284,6 @@ methods: description: if the certificate doesn't exist, - type: azure.core.exceptions.HttpResponseError description: for other errors - examples: - - "Get a certificate\n\n\n\n````python\n\ - \n # get the latest version of a certificate\n certificate = await certificate_client.get_certificate(cert_name)\n\ - \n print(certificate.id)\n print(certificate.name)\n print(certificate.policy.issuer_name)\n\ - \n ````\n" - uid: azure.keyvault.certificates.aio.CertificateClient.get_certificate_operation name: get_certificate_operation summary: Gets the creation operation of a certificate. Requires the certificates/get @@ -456,16 +356,6 @@ methods: description: if the certificate doesn't exist, - type: azure.core.exceptions.HttpResponseError description: for other errors - examples: - - "Get a certificate with a specific version\n\n\n\n````python\n\ - \n certificate = await certificate_client.get_certificate_version(cert_name,\ - \ version)\n\n print(certificate.id)\n print(certificate.properties.version)\n\ - \n ````\n" - uid: azure.keyvault.certificates.aio.CertificateClient.get_contacts name: get_contacts summary: Gets the certificate contacts for the key vault. Requires the certificates/managecontacts @@ -477,17 +367,6 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Get contacts\n\ - \n\n\n````python\n\ - \n contacts = await certificate_client.get_contacts()\n\n # Loop through the\ - \ certificate contacts for this key vault.\n for contact in contacts:\n \ - \ print(contact.name)\n print(contact.email)\n print(contact.phone)\n\ - \n ````\n" - uid: azure.keyvault.certificates.aio.CertificateClient.get_deleted_certificate name: get_deleted_certificate summary: 'Get a deleted certificate. Possible only in a vault with soft-delete enabled. @@ -514,16 +393,6 @@ methods: description: if the certificate doesn't exist, - type: azure.core.exceptions.HttpResponseError description: for other errors - examples: - - "Get a deleted certificate\n\n\n\n````python\n\ - \n # get a deleted certificate (requires soft-delete enabled for the vault)\n\ - \ deleted_certificate = await certificate_client.get_deleted_certificate(cert_name)\n\ - \ print(deleted_certificate.name)\n\n ````\n" - uid: azure.keyvault.certificates.aio.CertificateClient.get_issuer name: get_issuer summary: Gets the specified certificate issuer. Requires certificates/manageissuers/getissuers @@ -544,17 +413,6 @@ methods: description: if the issuer doesn't exist, - type: azure.core.exceptions.HttpResponseError description: for other errors - examples: - - "Get an issuer\n\ - \n\n\n````python\n\ - \n issuer = await certificate_client.get_issuer(\"issuer1\")\n\n print(issuer.name)\n\ - \ print(issuer.provider)\n print(issuer.account_id)\n\n for contact in issuer.admin_contacts:\n\ - \ print(contact.first_name)\n print(contact.last_name)\n print(contact.email)\n\ - \ print(contact.phone)\n\n ````\n" - uid: azure.keyvault.certificates.aio.CertificateClient.import_certificate name: import_certificate summary: 'Import a certificate created externally. Requires certificates/import @@ -642,19 +500,6 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "List all the deleted certificates\n\n\n\n````python\n\ - \n # get an iterator of deleted certificates (requires soft-delete enabled for\ - \ the vault)\n deleted_certificates = certificate_client.list_deleted_certificates()\n\ - \n async for certificate in deleted_certificates:\n print(certificate.id)\n\ - \ print(certificate.name)\n print(certificate.scheduled_purge_date)\n\ - \ print(certificate.recovery_id)\n print(certificate.deleted_on)\n\ - \n ````\n" - uid: azure.keyvault.certificates.aio.CertificateClient.list_properties_of_certificate_versions name: list_properties_of_certificate_versions summary: 'List the identifiers and properties of a certificate''s versions. @@ -675,18 +520,6 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "List all versions of a certificate\n\n\n\n````python\n\ - \n # get an iterator of all versions of a certificate\n certificate_versions\ - \ = certificate_client.list_properties_of_certificate_versions(certificate_name)\n\ - \n async for certificate in certificate_versions:\n print(certificate.id)\n\ - \ print(certificate.updated_on)\n print(certificate.version)\n\n \ - \ ````\n" - uid: azure.keyvault.certificates.aio.CertificateClient.list_properties_of_certificates name: list_properties_of_certificates summary: 'List identifiers and properties of all certificates in the vault. @@ -708,17 +541,6 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "List all certificates\n\n\n\n````python\n\ - \n # list certificates\n certificates = certificate_client.list_properties_of_certificates()\n\ - \n async for certificate in certificates:\n print(certificate.id)\n \ - \ print(certificate.created_on)\n print(certificate.name)\n print(certificate.updated_on)\n\ - \ print(certificate.enabled)\n\n ````\n" - uid: azure.keyvault.certificates.aio.CertificateClient.list_properties_of_issuers name: list_properties_of_issuers summary: 'Lists properties of the certificate issuers for the key vault. @@ -732,16 +554,6 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "List issuers of a vault\n\n\n\n````python\n\ - \n issuers = certificate_client.list_properties_of_issuers()\n\n async for\ - \ issuer in issuers:\n print(issuer.name)\n print(issuer.provider)\n\ - \n ````\n" - uid: azure.keyvault.certificates.aio.CertificateClient.merge_certificate name: merge_certificate summary: 'Merges a certificate or a certificate chain with a key pair existing on @@ -843,17 +655,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Recover a deleted certificate\n\n\n\n````python\n\ - \n # recover deleted certificate to its latest version (requires soft-delete\ - \ enabled for the vault)\n recovered_certificate = await certificate_client.recover_deleted_certificate(cert_name)\n\ - \ print(recovered_certificate.id)\n print(recovered_certificate.name)\n\n\ - \ ````\n" - uid: azure.keyvault.certificates.aio.CertificateClient.restore_certificate_backup name: restore_certificate_backup summary: 'Restore a certificate backup to the vault. Requires certificates/restore @@ -880,16 +681,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Restore a certificate backup\n\n\n\n````python\n\ - \n # restores a certificate backup\n restored_certificate = await certificate_client.restore_certificate_backup(certificate_backup)\n\ - \ print(restored_certificate.id)\n print(restored_certificate.name)\n print(restored_certificate.properties.version)\n\ - \n ````\n" - uid: azure.keyvault.certificates.aio.CertificateClient.set_contacts name: set_contacts summary: Sets the certificate contacts for the key vault. Requires certificates/managecontacts @@ -908,20 +699,6 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Create contacts\n\n\n\n````python\n\ - \n from azure.keyvault.certificates import CertificateContact\n\n # Create\ - \ a list of the contacts that you want to set for this key vault.\n contact_list\ - \ = [\n CertificateContact(email=\"admin@contoso.com\", name=\"John Doe\"\ - , phone=\"1111111111\"),\n CertificateContact(email=\"admin2@contoso.com\"\ - , name=\"John Doe2\", phone=\"2222222222\"),\n ]\n\n contacts = await certificate_client.set_contacts(contact_list)\n\ - \ for contact in contacts:\n print(contact.name)\n print(contact.email)\n\ - \ print(contact.phone)\n\n ````\n" - uid: azure.keyvault.certificates.aio.CertificateClient.update_certificate_policy name: update_certificate_policy summary: 'Updates the policy for a certificate. Requires certificates/update permission. @@ -977,18 +754,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Update a certificate's attributes\n\n\n\n````python\n\ - \n # update attributes of an existing certificate\n tags = {\"foo\": \"updated\ - \ tag\"}\n updated_certificate = await certificate_client.update_certificate_properties(\n\ - \ certificate_name=certificate.name, tags=tags\n )\n\n print(updated_certificate.properties.version)\n\ - \ print(updated_certificate.properties.updated_on)\n print(updated_certificate.properties.tags)\n\ - \n ````\n" - uid: azure.keyvault.certificates.aio.CertificateClient.update_issuer name: update_issuer summary: Updates the specified certificate issuer. Requires certificates/setissuers diff --git a/preview/docs-ref-autogen/azure-keyvault-keys/azure.keyvault.keys.KeyClient.yml b/preview/docs-ref-autogen/azure-keyvault-keys/azure.keyvault.keys.KeyClient.yml index c02c5a5ee3a7..9151a8d25c2b 100644 --- a/preview/docs-ref-autogen/azure-keyvault-keys/azure.keyvault.keys.KeyClient.yml +++ b/preview/docs-ref-autogen/azure-keyvault-keys/azure.keyvault.keys.KeyClient.yml @@ -40,16 +40,6 @@ constructor: Vault or Managed HSM domain. Defaults to True.' types: - -examples: -- "Create a new `KeyClient`\n\ - \n\n\n````python\n\n from azure.identity\ - \ import DefaultAzureCredential\n from azure.keyvault.keys import KeyClient\n\n\ - \ # Create a KeyClient using default Azure credentials\n credential = DefaultAzureCredential()\n\ - \ key_client = KeyClient(vault_url, credential)\n\n ````\n" methods: - uid: azure.keyvault.keys.KeyClient.backup_key name: backup_key @@ -81,15 +71,6 @@ methods: description: if the key doesn't exist, - type: azure.core.exceptions.HttpResponseError description: for other errors - examples: - - "Get a key backup\n\n\n\n````python\n\n # backup key\n\ - \ key_backup = key_client.backup_key(key_name)\n\n # returns the raw bytes\ - \ of the backed up key\n print(key_backup)\n\n ````\n" - uid: azure.keyvault.keys.KeyClient.begin_delete_key name: begin_delete_key summary: 'Delete all versions of a key and its cryptographic material. @@ -130,18 +111,6 @@ methods: description: if the key doesn't exist, - type: azure.core.exceptions.HttpResponseError description: for other errors - examples: - - "Delete a key\n\n\n\n````python\n\n # delete a key\n deleted_key_poller = key_client.begin_delete_key(key_name)\n\ - \ deleted_key = deleted_key_poller.result()\n\n print(deleted_key.name)\n\n\ - \ # if the vault has soft-delete enabled, the key's deleted_date,\n # scheduled\ - \ purge date and recovery id are set\n print(deleted_key.deleted_date)\n print(deleted_key.scheduled_purge_date)\n\ - \ print(deleted_key.recovery_id)\n\n # if you want to block until deletion\ - \ is complete, call wait() on the poller\n deleted_key_poller.wait()\n\n ````\n" - uid: azure.keyvault.keys.KeyClient.begin_recover_deleted_key name: begin_recover_deleted_key summary: 'Recover a deleted key to its latest version. Possible only in a vault @@ -180,18 +149,6 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Recover a deleted key\n\n\ - \n\n````python\n\n # recover\ - \ a deleted key to its latest version (requires soft-delete enabled for the vault)\n\ - \ recover_key_poller = key_client.begin_recover_deleted_key(key_name)\n recovered_key\ - \ = recover_key_poller.result()\n print(recovered_key.id)\n print(recovered_key.name)\n\ - \n # if you want to block until key is recovered server-side, call wait() on\ - \ the poller\n recover_key_poller.wait()\n\n ````\n" - uid: azure.keyvault.keys.KeyClient.create_ec_key name: create_ec_key summary: 'Create a new elliptic curve key or, if `name` is already in use, create @@ -261,17 +218,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Create an elliptic curve key\n\ - \n\n\n````python\n\n key_curve\ - \ = \"P-256\"\n\n # create an EC (Elliptic curve) key with curve specification\n\ - \ # EC key can be created with default curve of 'P-256'\n ec_key = key_client.create_ec_key(key_name,\ - \ curve=key_curve)\n\n print(ec_key.id)\n print(ec_key.properties.version)\n\ - \ print(ec_key.key_type)\n print(ec_key.key.crv)\n\n ````\n" - uid: azure.keyvault.keys.KeyClient.create_key name: create_key summary: 'Create a key or, if `name` is already in use, create a new version of @@ -359,17 +305,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Create a key\n\n\n\n````python\n\n from dateutil import parser as date_parse\n\n\ - \ expires_on = date_parse.parse(\"2050-02-02T08:00:00.000Z\")\n\n # create\ - \ a key with optional arguments\n key = key_client.create_key(key_name, KeyType.rsa_hsm,\ - \ expires_on=expires_on)\n\n print(key.name)\n print(key.id)\n print(key.key_type)\n\ - \ print(key.properties.expires_on)\n\n ````\n" - uid: azure.keyvault.keys.KeyClient.create_oct_key name: create_oct_key summary: 'Create a new octet sequence (symmetric) key or, if `name` is in use, create @@ -438,15 +373,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Create an octet sequence (symmetric) key\n\n\n\n````python\n\ - \n key = key_client.create_oct_key(key_name, size=256, hardware_protected=True)\n\ - \n print(key.id)\n print(key.name)\n print(key.key_type)\n\n ````\n" - uid: azure.keyvault.keys.KeyClient.create_rsa_key name: create_rsa_key summary: 'Create a new RSA key or, if `name` is already in use, create a new version @@ -521,18 +447,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Create RSA key\n\n\n\n````python\n\n key_size = 2048\n key_ops = [\"encrypt\", \"\ - decrypt\", \"sign\", \"verify\", \"wrapKey\", \"unwrapKey\"]\n\n # create an\ - \ rsa key with size specification\n # RSA key can be created with default size\ - \ of '2048'\n key = key_client.create_rsa_key(key_name, hardware_protected=True,\ - \ size=key_size, key_operations=key_ops)\n\n print(key.id)\n print(key.name)\n\ - \ print(key.key_type)\n print(key.key_operations)\n\n ````\n" - uid: azure.keyvault.keys.KeyClient.get_cryptography_client name: get_cryptography_client summary: Gets a for the given @@ -577,18 +491,6 @@ methods: description: if the key doesn't exist, - type: azure.core.exceptions.HttpResponseError description: for other errors - examples: - - "Get a deleted key\n\n\n\n````python\n\n # get a deleted\ - \ key (requires soft-delete enabled for the vault)\n deleted_key = key_client.get_deleted_key(key_name)\n\ - \ print(deleted_key.name)\n\n # if the vault has soft-delete enabled, the\ - \ key's deleted_date\n # scheduled purge date and recovery id are set\n print(deleted_key.deleted_date)\n\ - \ print(deleted_key.scheduled_purge_date)\n print(deleted_key.recovery_id)\n\ - \n ````\n" - uid: azure.keyvault.keys.KeyClient.get_key name: get_key summary: 'Get a key''s attributes and, if it''s an asymmetric key, its public material. @@ -619,17 +521,6 @@ methods: description: if the key doesn't exist, - type: azure.core.exceptions.HttpResponseError description: for other errors - examples: - - "Get a key\n\n\n\n````python\n\n # get the latest version of a key\n key = key_client.get_key(key_name)\n\ - \n # alternatively, specify a version\n key_version = key.properties.version\n\ - \ key = key_client.get_key(key_name, key_version)\n\n print(key.id)\n print(key.name)\n\ - \ print(key.properties.version)\n print(key.key_type)\n print(key.properties.vault_url)\n\ - \n ````\n" - uid: azure.keyvault.keys.KeyClient.get_key_rotation_policy name: get_key_rotation_policy summary: Get the rotation policy of a Key Vault key. @@ -665,14 +556,6 @@ methods: description: if less than one random byte is requested, - type: azure.core.exceptions.HttpResponseError description: for other errors - examples: - - "Get random bytes\n\n\n\n````python\n\n # get eight random bytes from a managed HSM\n\ - \ random_bytes = client.get_random_bytes(count=8)\n\n ````\n" - uid: azure.keyvault.keys.KeyClient.import_key name: import_key summary: 'Import a key created externally. @@ -745,17 +628,6 @@ methods: description: An iterator of deleted keys types: - [] - examples: - - "List all the deleted keys\n\ - \n\n\n````python\n\n # get an iterator\ - \ of deleted keys (requires soft-delete enabled for the vault)\n deleted_keys\ - \ = key_client.list_deleted_keys()\n\n for key in deleted_keys:\n print(key.id)\n\ - \ print(key.name)\n print(key.scheduled_purge_date)\n print(key.recovery_id)\n\ - \ print(key.deleted_date)\n\n ````\n" - uid: azure.keyvault.keys.KeyClient.list_properties_of_key_versions name: list_properties_of_key_versions summary: 'List the identifiers and properties of a key''s versions. @@ -773,16 +645,6 @@ methods: description: An iterator of keys without their cryptographic material types: - [] - examples: - - "List all versions of a key\n\ - \n\n\n````python\n\n # get an iterator\ - \ of a key's versions\n key_versions = key_client.list_properties_of_key_versions(\"\ - key-name\")\n\n for key in key_versions:\n print(key.id)\n print(key.name)\n\ - \n ````\n" - uid: azure.keyvault.keys.KeyClient.list_properties_of_keys name: list_properties_of_keys summary: 'List identifiers and properties of all keys in the vault. @@ -795,14 +657,6 @@ methods: information types: - [] - examples: - - "List all keys\n\n\n\n````python\n\n # get an iterator of keys\n keys = key_client.list_properties_of_keys()\n\ - \n for key in keys:\n print(key.id)\n print(key.name)\n\n ````\n" - uid: azure.keyvault.keys.KeyClient.purge_deleted_key name: purge_deleted_key summary: 'Permanently deletes a deleted key. Only possible in a vault with soft-delete @@ -914,15 +768,6 @@ methods: description: if the backed up key's name is already in use, - type: azure.core.exceptions.HttpResponseError description: for other errors - examples: - - "Restore a key backup\n\n\ - \n\n````python\n\n # restore\ - \ a key backup\n restored_key = key_client.restore_key_backup(key_backup)\n\ - \ print(restored_key.id)\n print(restored_key.properties.version)\n\n ````\n" - uid: azure.keyvault.keys.KeyClient.rotate_key name: rotate_key summary: 'Rotate the key based on the key policy by generating a new version of @@ -1004,18 +849,6 @@ methods: description: if the key doesn't exist, - type: azure.core.exceptions.HttpResponseError description: for other errors - examples: - - "Update a key's attributes\n\ - \n\n\n````python\n\n # update attributes\ - \ of an existing key\n expires_on = date_parse.parse(\"2050-01-02T08:00:00.000Z\"\ - )\n tags = {\"foo\": \"updated tag\"}\n updated_key = key_client.update_key_properties(key.name,\ - \ expires_on=expires_on, tags=tags)\n\n print(updated_key.properties.version)\n\ - \ print(updated_key.properties.updated_on)\n print(updated_key.properties.expires_on)\n\ - \ print(updated_key.properties.tags)\n print(key.key_type)\n\n ````\n" - uid: azure.keyvault.keys.KeyClient.update_key_rotation_policy name: update_key_rotation_policy summary: 'Updates the rotation policy of a Key Vault key. diff --git a/preview/docs-ref-autogen/azure-keyvault-keys/azure.keyvault.keys.KeyVaultKeyIdentifier.yml b/preview/docs-ref-autogen/azure-keyvault-keys/azure.keyvault.keys.KeyVaultKeyIdentifier.yml index 41b9dac14036..bf2f400fc8fa 100644 --- a/preview/docs-ref-autogen/azure-keyvault-keys/azure.keyvault.keys.KeyVaultKeyIdentifier.yml +++ b/preview/docs-ref-autogen/azure-keyvault-keys/azure.keyvault.keys.KeyVaultKeyIdentifier.yml @@ -14,15 +14,6 @@ constructor: isRequired: true types: - -examples: -- "Parse a key's ID\n\n\n\n````python\n\n key = client.get_key(key_name)\n parsed_key_id = KeyVaultKeyIdentifier(key.id)\n\ - \n print(parsed_key_id.name)\n print(parsed_key_id.vault_url)\n print(parsed_key_id.version)\n\ - \ print(parsed_key_id.source_id)\n\n ````\n" attributes: - uid: azure.keyvault.keys.KeyVaultKeyIdentifier.name name: name diff --git a/preview/docs-ref-autogen/azure-keyvault-keys/azure.keyvault.keys.aio.KeyClient.yml b/preview/docs-ref-autogen/azure-keyvault-keys/azure.keyvault.keys.aio.KeyClient.yml index 1847017d37d8..eadab5809a58 100644 --- a/preview/docs-ref-autogen/azure-keyvault-keys/azure.keyvault.keys.aio.KeyClient.yml +++ b/preview/docs-ref-autogen/azure-keyvault-keys/azure.keyvault.keys.aio.KeyClient.yml @@ -40,18 +40,6 @@ constructor: Vault or Managed HSM domain. Defaults to True.' types: - -examples: -- "Create a new `KeyClient`\n\ - \n\n\n````python\n\n from azure.identity.aio\ - \ import DefaultAzureCredential\n from azure.keyvault.keys.aio import KeyClient\n\ - \n # Create a KeyClient using default Azure credentials\n credential = DefaultAzureCredential()\n\ - \ key_client = KeyClient(vault_url, credential)\n\n # the client and credential\ - \ should be closed when no longer needed\n # (both are also async context managers)\n\ - \ await key_client.close()\n await credential.close()\n\n ````\n" methods: - uid: azure.keyvault.keys.aio.KeyClient.backup_key name: backup_key @@ -81,15 +69,6 @@ methods: description: if the key doesn't exist, - type: azure.core.exceptions.HttpResponseError description: for other errors - examples: - - "Get a key backup\n\ - \n\n\n````python\n\ - \n # backup key\n key_backup = await key_client.backup_key(key_name)\n\n \ - \ # returns the raw bytes of the backup\n print(key_backup)\n\n ````\n" - uid: azure.keyvault.keys.aio.KeyClient.create_ec_key name: create_ec_key summary: 'Create a new elliptic curve key or, if `name` is already in use, create @@ -159,17 +138,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Create an elliptic curve key\n\n\n\n````python\n\ - \n # create an elliptic curve (ec) key\n key_curve = \"P-256\"\n ec_key\ - \ = await key_client.create_ec_key(key_name, curve=key_curve)\n\n print(ec_key.id)\n\ - \ print(ec_key.name)\n print(ec_key.key_type)\n print(ec_key.key.crv)\n\n\ - \ ````\n" - uid: azure.keyvault.keys.aio.KeyClient.create_key name: create_key summary: 'Create a key or, if `name` is already in use, create a new version of @@ -257,20 +225,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Create a key\n\n\n\n````python\n\n from dateutil\ - \ import parser as date_parse\n\n key_size = 2048\n key_ops = [\"encrypt\"\ - , \"decrypt\", \"sign\", \"verify\", \"wrapKey\", \"unwrapKey\"]\n expires_on\ - \ = date_parse.parse(\"2050-02-02T08:00:00.000Z\")\n\n # create a key with optional\ - \ arguments\n key = await key_client.create_key(\n key_name, KeyType.rsa,\ - \ size=key_size, key_operations=key_ops, expires_on=expires_on\n )\n\n print(key.id)\n\ - \ print(key.name)\n print(key.key_type)\n print(key.properties.enabled)\n\ - \ print(key.properties.expires_on)\n\n ````\n" - uid: azure.keyvault.keys.aio.KeyClient.create_oct_key name: create_oct_key summary: 'Create a new octet sequence (symmetric) key or, if `name` is in use, create @@ -339,15 +293,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Create an octet sequence (symmetric) key\n\n\n\n````python\n\ - \n key = await key_client.create_oct_key(key_name, size=256, hardware_protected=True)\n\ - \n print(key.id)\n print(key.name)\n print(key.key_type)\n\n ````\n" - uid: azure.keyvault.keys.aio.KeyClient.create_rsa_key name: create_rsa_key summary: 'Create a new RSA key or, if `name` is already in use, create a new version @@ -422,16 +367,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Create RSA key\n\n\ - \n\n````python\n\ - \n # create an rsa key in a hardware security module\n key = await key_client.create_rsa_key(key_name,\ - \ hardware_protected=True, size=2048)\n\n print(key.id)\n print(key.name)\n\ - \ print(key.key_type)\n\n ````\n" - uid: azure.keyvault.keys.aio.KeyClient.delete_key name: delete_key summary: 'Delete all versions of a key and its cryptographic material. @@ -457,18 +392,6 @@ methods: description: if the key doesn't exist, - type: azure.core.exceptions.HttpResponseError description: for other errors - examples: - - "Delete a key\n\n\n\n````python\n\n # delete a\ - \ key\n deleted_key = await key_client.delete_key(key_name)\n\n print(deleted_key.name)\n\ - \n # if the vault has soft-delete enabled, the key's\n # scheduled purge date,\ - \ deleted_date and recovery id are set\n print(deleted_key.deleted_date)\n \ - \ print(deleted_key.scheduled_purge_date)\n print(deleted_key.recovery_id)\n\ - \n ````\n" - uid: azure.keyvault.keys.aio.KeyClient.get_cryptography_client name: get_cryptography_client summary: Gets a for the @@ -513,16 +436,6 @@ methods: description: if the key doesn't exist, - type: azure.core.exceptions.HttpResponseError description: for other errors - examples: - - "Get a deleted key\n\ - \n\n\n````python\n\ - \n # get a deleted key (requires soft-delete enabled for the vault)\n deleted_key\ - \ = await key_client.get_deleted_key(key_name)\n print(deleted_key.name)\n\n\ - \ ````\n" - uid: azure.keyvault.keys.aio.KeyClient.get_key name: get_key summary: 'Get a key''s attributes and, if it''s an asymmetric key, its public material. @@ -553,18 +466,6 @@ methods: description: if the key doesn't exist, - type: azure.core.exceptions.HttpResponseError description: for other errors - examples: - - "Get a key\n\n\n\n````python\n\n # get the\ - \ latest version of a key\n key = await key_client.get_key(key_name)\n\n #\ - \ alternatively, specify a version\n key_version = key.properties.version\n\ - \ key = await key_client.get_key(key_name, key_version)\n\n print(key.id)\n\ - \ print(key.name)\n print(key.properties.version)\n print(key.key_type)\n\ - \ print(key.properties.vault_url)\n\n ````\n" - uid: azure.keyvault.keys.aio.KeyClient.get_key_rotation_policy name: get_key_rotation_policy summary: Get the rotation policy of a Key Vault key. @@ -600,14 +501,6 @@ methods: description: if less than one random byte is requested, - type: azure.core.exceptions.HttpResponseError description: for other errors - examples: - - "Get random bytes\n\n\n\n````python\n\n # get eight random bytes from a managed HSM\n\ - \ random_bytes = await client.get_random_bytes(count=8)\n\n ````\n" - uid: azure.keyvault.keys.aio.KeyClient.import_key name: import_key summary: 'Import a key created externally. @@ -680,17 +573,6 @@ methods: description: An iterator of deleted keys types: - [] - examples: - - "List all the deleted keys\n\n\n\n````python\n\ - \n # get an iterator of deleted keys (requires soft-delete enabled for the vault)\n\ - \ deleted_keys = key_client.list_deleted_keys()\n\n async for key in deleted_keys:\n\ - \ print(key.id)\n print(key.name)\n print(key.scheduled_purge_date)\n\ - \ print(key.recovery_id)\n print(key.deleted_date)\n\n ````\n" - uid: azure.keyvault.keys.aio.KeyClient.list_properties_of_key_versions name: list_properties_of_key_versions summary: 'List the identifiers and properties of a key''s versions. @@ -708,17 +590,6 @@ methods: description: An iterator of keys without their cryptographic material types: - [] - examples: - - "List all versions of a key\n\n\n\n````python\n\ - \n # get an iterator of all versions of a key\n key_versions = key_client.list_properties_of_key_versions(\"\ - key-name\")\n\n async for key in key_versions:\n print(key.id)\n \ - \ print(key.updated_on)\n print(key.properties.version)\n print(key.expires_on)\n\ - \n ````\n" - uid: azure.keyvault.keys.aio.KeyClient.list_properties_of_keys name: list_properties_of_keys summary: 'List identifiers and properties of all keys in the vault. @@ -731,16 +602,6 @@ methods: information types: - [] - examples: - - "List all keys\n\n\ - \n\n````python\n\ - \n # list keys\n keys = key_client.list_properties_of_keys()\n\n async for\ - \ key in keys:\n print(key.id)\n print(key.created_on)\n print(key.name)\n\ - \ print(key.updated_on)\n print(key.enabled)\n\n ````\n" - uid: azure.keyvault.keys.aio.KeyClient.purge_deleted_key name: purge_deleted_key summary: 'Permanently deletes a deleted key. Only possible in a vault with soft-delete @@ -803,16 +664,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Recover a deleted key\n\ - \n\n\n````python\n\ - \n # recover deleted key to its latest version (requires soft-delete enabled\ - \ for the vault)\n recovered_key = await key_client.recover_deleted_key(key_name)\n\ - \ print(recovered_key.id)\n print(recovered_key.name)\n\n ````\n" - uid: azure.keyvault.keys.aio.KeyClient.release_key name: release_key summary: 'Releases a key. @@ -886,16 +737,6 @@ methods: description: if the backed up key's name is already in use, - type: azure.core.exceptions.HttpResponseError description: for other errors - examples: - - "Restore a key backup\n\ - \n\n\n````python\n\ - \n # restores a backup\n restored_key = await key_client.restore_key_backup(key_backup)\n\ - \ print(restored_key.id)\n print(restored_key.name)\n print(restored_key.properties.version)\n\ - \n ````\n" - uid: azure.keyvault.keys.aio.KeyClient.rotate_key name: rotate_key summary: 'Rotate the key based on the key policy by generating a new version of @@ -977,19 +818,6 @@ methods: description: if the key doesn't exist, - type: azure.core.exceptions.HttpResponseError description: for other errors - examples: - - "Update a key's attributes\n\n\n\n````python\n\ - \n # update attributes of an existing key\n expires_on = date_parse.parse(\"\ - 2050-01-02T08:00:00.000Z\")\n tags = {\"foo\": \"updated tag\"}\n updated_key\ - \ = await key_client.update_key_properties(key.name, expires_on=expires_on, tags=tags)\n\ - \n print(updated_key.properties.version)\n print(updated_key.properties.updated_on)\n\ - \ print(updated_key.properties.expires_on)\n print(updated_key.properties.tags)\n\ - \ print(updated_key.key_type)\n\n ````\n" - uid: azure.keyvault.keys.aio.KeyClient.update_key_rotation_policy name: update_key_rotation_policy summary: 'Updates the rotation policy of a Key Vault key. diff --git a/preview/docs-ref-autogen/azure-keyvault-keys/azure.keyvault.keys.crypto.CryptographyClient.yml b/preview/docs-ref-autogen/azure-keyvault-keys/azure.keyvault.keys.crypto.CryptographyClient.yml index 3d8d41acc144..e537efdb1c6e 100644 --- a/preview/docs-ref-autogen/azure-keyvault-keys/azure.keyvault.keys.crypto.CryptographyClient.yml +++ b/preview/docs-ref-autogen/azure-keyvault-keys/azure.keyvault.keys.crypto.CryptographyClient.yml @@ -5,20 +5,16 @@ fullName: azure.keyvault.keys.crypto.CryptographyClient module: azure.keyvault.keys.crypto inheritances: - azure.keyvault.keys._shared.client_base.KeyVaultClientBase -summary: "Performs cryptographic operations using Azure Key Vault keys.\n\nThis client\ - \ will perform operations locally when it's intialized with the necessary key material\ - \ or is able to get\nthat material from Key Vault. When the required key material\ - \ is unavailable, cryptographic operations are performed\nby the Key Vault service.\n\ - \nCreate a CryptographyClient\n\n\n\n````python\n\n # create a CryptographyClient\ - \ using a KeyVaultKey instance\n key = key_client.get_key(key_name)\n crypto_client\ - \ = CryptographyClient(key, credential)\n\n # or a key's id, which must include\ - \ a version\n key_id = \"https://.vault.azure.net/keys//fe4fdcab688c479a9aa80f01ffeac26\"\ - \n crypto_client = CryptographyClient(key_id, credential)\n\n ````" +summary: 'Performs cryptographic operations using Azure Key Vault keys. + + + This client will perform operations locally when it''s intialized with the necessary + key material or is able to get + + that material from Key Vault. When the required key material is unavailable, cryptographic + operations are performed + + by the Key Vault service.' constructor: syntax: 'CryptographyClient(key: KeyVaultKey | str, credential: TokenCredential, **kwargs)' @@ -57,17 +53,13 @@ constructor: methods: - uid: azure.keyvault.keys.crypto.CryptographyClient.decrypt name: decrypt - summary: "Decrypt a single block of encrypted data using the client's key.\n\nRequires\ - \ the keys/decrypt permission. This method decrypts only a single block of data,\ - \ whose size depends on\nthe key and encryption algorithm.\n\nDecrypt bytes\n\n\n\n````python\n\n from azure.keyvault.keys.crypto import EncryptionAlgorithm\n\ - \n result = client.decrypt(EncryptionAlgorithm.rsa_oaep, ciphertext)\n print(result.plaintext)\n\ - \n ````" + summary: 'Decrypt a single block of encrypted data using the client''s key. + + + Requires the keys/decrypt permission. This method decrypts only a single block + of data, whose size depends on + + the key and encryption algorithm.' signature: 'decrypt(algorithm: EncryptionAlgorithm, ciphertext: bytes, **kwargs) -> DecryptResult' parameters: @@ -117,19 +109,13 @@ methods: are provided. - uid: azure.keyvault.keys.crypto.CryptographyClient.encrypt name: encrypt - summary: "Encrypt bytes using the client's key.\n\nRequires the keys/encrypt permission.\ - \ This method encrypts only a single block of data, whose size depends on\nthe\ - \ key and encryption algorithm.\n\nEncrypt bytes\n\n\n\n````python\n\ - \n from azure.keyvault.keys.crypto import EncryptionAlgorithm\n\n # the result\ - \ holds the ciphertext and identifies the encryption key and algorithm used\n\ - \ result = client.encrypt(EncryptionAlgorithm.rsa_oaep, b\"plaintext\")\n \ - \ ciphertext = result.ciphertext\n print(result.key_id)\n print(result.algorithm)\n\ - \n ````" + summary: 'Encrypt bytes using the client''s key. + + + Requires the keys/encrypt permission. This method encrypts only a single block + of data, whose size depends on + + the key and encryption algorithm.' signature: 'encrypt(algorithm: EncryptionAlgorithm, plaintext: bytes, **kwargs) -> EncryptResult' parameters: @@ -189,18 +175,10 @@ methods: - - uid: azure.keyvault.keys.crypto.CryptographyClient.sign name: sign - summary: "Create a signature from a digest using the client's key.\n\nRequires the\ - \ keys/sign permission.\n\nSign bytes\n\n\n\n````python\n\ - \n import hashlib\n\n from azure.keyvault.keys.crypto import SignatureAlgorithm\n\ - \n digest = hashlib.sha256(b\"plaintext\").digest()\n\n # sign returns the\ - \ signature and the metadata required to verify it\n result = client.sign(SignatureAlgorithm.rs256,\ - \ digest)\n print(result.key_id)\n print(result.algorithm)\n signature =\ - \ result.signature\n\n ````" + summary: 'Create a signature from a digest using the client''s key. + + + Requires the keys/sign permission.' signature: 'sign(algorithm: SignatureAlgorithm, digest: bytes, **kwargs) -> SignResult' parameters: - name: algorithm @@ -218,15 +196,10 @@ methods: - - uid: azure.keyvault.keys.crypto.CryptographyClient.unwrap_key name: unwrap_key - summary: "Unwrap a key previously wrapped with the client's key.\n\nRequires the\ - \ keys/unwrapKey permission.\n\nUnwrap a key\n\n\n\n````python\n\ - \n from azure.keyvault.keys.crypto import KeyWrapAlgorithm\n\n result = client.unwrap_key(KeyWrapAlgorithm.rsa_oaep,\ - \ encrypted_key)\n key = result.key\n\n ````" + summary: 'Unwrap a key previously wrapped with the client''s key. + + + Requires the keys/unwrapKey permission.' signature: 'unwrap_key(algorithm: KeyWrapAlgorithm, encrypted_key: bytes, **kwargs) -> UnwrapResult' parameters: @@ -245,16 +218,10 @@ methods: - - uid: azure.keyvault.keys.crypto.CryptographyClient.verify name: verify - summary: "Verify a signature using the client's key.\n\nRequires the keys/verify\ - \ permission.\n\nVerify a signature\n\n\n\n````python\n\ - \n from azure.keyvault.keys.crypto import SignatureAlgorithm\n\n result =\ - \ client.verify(SignatureAlgorithm.rs256, digest, signature)\n assert result.is_valid\n\ - \n ````" + summary: 'Verify a signature using the client''s key. + + + Requires the keys/verify permission.' signature: 'verify(algorithm: SignatureAlgorithm, digest: bytes, signature: bytes, **kwargs) -> VerifyResult' parameters: @@ -281,17 +248,10 @@ methods: - - uid: azure.keyvault.keys.crypto.CryptographyClient.wrap_key name: wrap_key - summary: "Wrap a key with the client's key.\n\nRequires the keys/wrapKey permission.\n\ - \nWrap a key\n\n\n\n````python\n\n from azure.keyvault.keys.crypto import\ - \ KeyWrapAlgorithm\n\n # the result holds the encrypted key and identifies the\ - \ encryption key and algorithm used\n result = client.wrap_key(KeyWrapAlgorithm.rsa_oaep,\ - \ key_bytes)\n encrypted_key = result.encrypted_key\n print(result.key_id)\n\ - \ print(result.algorithm)\n\n ````" + summary: 'Wrap a key with the client''s key. + + + Requires the keys/wrapKey permission.' signature: 'wrap_key(algorithm: KeyWrapAlgorithm, key: bytes, **kwargs) -> WrapResult' parameters: - name: algorithm diff --git a/preview/docs-ref-autogen/azure-keyvault-keys/azure.keyvault.keys.crypto.aio.CryptographyClient.yml b/preview/docs-ref-autogen/azure-keyvault-keys/azure.keyvault.keys.crypto.aio.CryptographyClient.yml index f902d65b4310..73b2a8c2593a 100644 --- a/preview/docs-ref-autogen/azure-keyvault-keys/azure.keyvault.keys.crypto.aio.CryptographyClient.yml +++ b/preview/docs-ref-autogen/azure-keyvault-keys/azure.keyvault.keys.crypto.aio.CryptographyClient.yml @@ -5,23 +5,16 @@ fullName: azure.keyvault.keys.crypto.aio.CryptographyClient module: azure.keyvault.keys.crypto.aio inheritances: - azure.keyvault.keys._shared.async_client_base.AsyncKeyVaultClientBase -summary: "Performs cryptographic operations using Azure Key Vault keys.\n\nThis client\ - \ will perform operations locally when it's intialized with the necessary key material\ - \ or is able to get\nthat material from Key Vault. When the required key material\ - \ is unavailable, cryptographic operations are performed\nby the Key Vault service.\n\ - \nCreate a CryptographyClient\n\n\n\n````python\n\n # create a CryptographyClient\ - \ using a KeyVaultKey instance\n key = await key_client.get_key(key_name)\n \ - \ crypto_client = CryptographyClient(key, credential)\n\n # or a key's id, which\ - \ must include a version\n key_id = \"https://.vault.azure.net/keys//fe4fdcab688c479a9aa80f01ffeac26\"\n crypto_client = CryptographyClient(key_id,\ - \ credential)\n\n # the client and credential should be closed when no longer\ - \ needed\n # (both are also async context managers)\n await crypto_client.close()\n\ - \ await credential.close()\n\n ````" +summary: 'Performs cryptographic operations using Azure Key Vault keys. + + + This client will perform operations locally when it''s intialized with the necessary + key material or is able to get + + that material from Key Vault. When the required key material is unavailable, cryptographic + operations are performed + + by the Key Vault service.' constructor: syntax: 'CryptographyClient(key: KeyVaultKey | str, credential: AsyncTokenCredential, **kwargs)' @@ -60,17 +53,13 @@ constructor: methods: - uid: azure.keyvault.keys.crypto.aio.CryptographyClient.decrypt name: decrypt - summary: "Decrypt a single block of encrypted data using the client's key.\n\nRequires\ - \ the keys/decrypt permission. This method decrypts only a single block of data,\ - \ whose size depends on\nthe key and encryption algorithm.\n\nDecrypt bytes\n\n\n\n````python\n\n from azure.keyvault.keys.crypto import EncryptionAlgorithm\n\ - \n result = await client.decrypt(EncryptionAlgorithm.rsa_oaep, ciphertext)\n\ - \ print(result.plaintext)\n\n ````" + summary: 'Decrypt a single block of encrypted data using the client''s key. + + + Requires the keys/decrypt permission. This method decrypts only a single block + of data, whose size depends on + + the key and encryption algorithm.' signature: 'async decrypt(algorithm: EncryptionAlgorithm, ciphertext: bytes, **kwargs) -> DecryptResult' parameters: @@ -120,19 +109,13 @@ methods: are provided. - uid: azure.keyvault.keys.crypto.aio.CryptographyClient.encrypt name: encrypt - summary: "Encrypt bytes using the client's key.\n\nRequires the keys/encrypt permission.\ - \ This method encrypts only a single block of data, whose size depends on\nthe\ - \ key and encryption algorithm.\n\nEncrypt bytes\n\n\n\n````python\n\ - \n from azure.keyvault.keys.crypto import EncryptionAlgorithm\n\n # the result\ - \ holds the ciphertext and identifies the encryption key and algorithm used\n\ - \ result = await client.encrypt(EncryptionAlgorithm.rsa_oaep, b\"plaintext\"\ - )\n print(result.key_id)\n print(result.algorithm)\n ciphertext = result.ciphertext\n\ - \n ````" + summary: 'Encrypt bytes using the client''s key. + + + Requires the keys/encrypt permission. This method encrypts only a single block + of data, whose size depends on + + the key and encryption algorithm.' signature: 'async encrypt(algorithm: EncryptionAlgorithm, plaintext: bytes, **kwargs) -> EncryptResult' parameters: @@ -192,18 +175,10 @@ methods: - - uid: azure.keyvault.keys.crypto.aio.CryptographyClient.sign name: sign - summary: "Create a signature from a digest using the client's key.\n\nRequires the\ - \ keys/sign permission.\n\nSign bytes\n\n\n\n````python\n\ - \n import hashlib\n\n from azure.keyvault.keys.crypto import SignatureAlgorithm\n\ - \n digest = hashlib.sha256(b\"plaintext\").digest()\n\n # sign returns the\ - \ signature and the metadata required to verify it\n result = await client.sign(SignatureAlgorithm.rs256,\ - \ digest)\n print(result.key_id)\n print(result.algorithm)\n signature =\ - \ result.signature\n\n ````" + summary: 'Create a signature from a digest using the client''s key. + + + Requires the keys/sign permission.' signature: 'async sign(algorithm: SignatureAlgorithm, digest: bytes, **kwargs) -> SignResult' parameters: @@ -222,15 +197,10 @@ methods: - - uid: azure.keyvault.keys.crypto.aio.CryptographyClient.unwrap_key name: unwrap_key - summary: "Unwrap a key previously wrapped with the client's key.\n\nRequires the\ - \ keys/unwrapKey permission.\n\nUnwrap a key\n\n\n\n````python\n\ - \n from azure.keyvault.keys.crypto import KeyWrapAlgorithm\n\n result = await\ - \ client.unwrap_key(KeyWrapAlgorithm.rsa_oaep, encrypted_key)\n\n ````" + summary: 'Unwrap a key previously wrapped with the client''s key. + + + Requires the keys/unwrapKey permission.' signature: 'async unwrap_key(algorithm: KeyWrapAlgorithm, encrypted_key: bytes, **kwargs) -> UnwrapResult' parameters: @@ -249,16 +219,10 @@ methods: - - uid: azure.keyvault.keys.crypto.aio.CryptographyClient.verify name: verify - summary: "Verify a signature using the client's key.\n\nRequires the keys/verify\ - \ permission.\n\nVerify a signature\n\n\n\n````python\n\ - \n from azure.keyvault.keys.crypto import SignatureAlgorithm\n\n verified\ - \ = await client.verify(SignatureAlgorithm.rs256, digest, signature)\n assert\ - \ verified.is_valid\n\n ````" + summary: 'Verify a signature using the client''s key. + + + Requires the keys/verify permission.' signature: 'async verify(algorithm: SignatureAlgorithm, digest: bytes, signature: bytes, **kwargs) -> VerifyResult' parameters: @@ -285,17 +249,10 @@ methods: - - uid: azure.keyvault.keys.crypto.aio.CryptographyClient.wrap_key name: wrap_key - summary: "Wrap a key with the client's key.\n\nRequires the keys/wrapKey permission.\n\ - \nWrap a key\n\n\ - \n\n````python\n\ - \n from azure.keyvault.keys.crypto import KeyWrapAlgorithm\n\n # wrap returns\ - \ a tuple with the wrapped bytes and the metadata required to unwrap the key\n\ - \ result = await client.wrap_key(KeyWrapAlgorithm.rsa_oaep, key_bytes)\n print(result.key_id)\n\ - \ print(result.algorithm)\n encrypted_key = result.encrypted_key\n\n ````" + summary: 'Wrap a key with the client''s key. + + + Requires the keys/wrapKey permission.' signature: 'async wrap_key(algorithm: KeyWrapAlgorithm, key: bytes, **kwargs) -> WrapResult' parameters: diff --git a/preview/docs-ref-autogen/azure-keyvault-secrets/azure.keyvault.secrets.KeyVaultSecretIdentifier.yml b/preview/docs-ref-autogen/azure-keyvault-secrets/azure.keyvault.secrets.KeyVaultSecretIdentifier.yml index 585e4dbc8124..5113cdab89a8 100644 --- a/preview/docs-ref-autogen/azure-keyvault-secrets/azure.keyvault.secrets.KeyVaultSecretIdentifier.yml +++ b/preview/docs-ref-autogen/azure-keyvault-secrets/azure.keyvault.secrets.KeyVaultSecretIdentifier.yml @@ -14,16 +14,6 @@ constructor: isRequired: true types: - -examples: -- "Parse a secret's ID\n\n\n\n````python\n\n secret = client.get_secret(secret_name)\n parsed_secret_id\ - \ = KeyVaultSecretIdentifier(secret.id)\n\n print(parsed_secret_id.name)\n print(parsed_secret_id.vault_url)\n\ - \ print(parsed_secret_id.version)\n print(parsed_secret_id.source_id)\n\n \ - \ ````\n" attributes: - uid: azure.keyvault.secrets.KeyVaultSecretIdentifier.name name: name diff --git a/preview/docs-ref-autogen/azure-keyvault-secrets/azure.keyvault.secrets.SecretClient.yml b/preview/docs-ref-autogen/azure-keyvault-secrets/azure.keyvault.secrets.SecretClient.yml index 5a66a19cc98a..05a0b092bd15 100644 --- a/preview/docs-ref-autogen/azure-keyvault-secrets/azure.keyvault.secrets.SecretClient.yml +++ b/preview/docs-ref-autogen/azure-keyvault-secrets/azure.keyvault.secrets.SecretClient.yml @@ -39,16 +39,6 @@ constructor: Vault domain. Defaults to True.' types: - -examples: -- "Create a new `SecretClient`\n\ - \n\n\n````python\n\n from azure.identity\ - \ import DefaultAzureCredential\n from azure.keyvault.secrets import SecretClient\n\ - \n # Create a SecretClient using default Azure credentials\n credential = DefaultAzureCredential()\n\ - \ secret_client = SecretClient(vault_url, credential)\n\n ````\n" methods: - uid: azure.keyvault.secrets.SecretClient.backup_secret name: backup_secret @@ -69,16 +59,6 @@ methods: description: if the secret doesn't exist, - type: azure.core.exceptions.HttpResponseError description: for other errors - examples: - - "Back up a secret\n\n\ - \n\n````python\n\ - \n # backup secret\n # returns the raw bytes of the backed up secret\n secret_backup\ - \ = secret_client.backup_secret(secret_name)\n\n print(secret_backup)\n\n \ - \ ````\n" - uid: azure.keyvault.secrets.SecretClient.begin_delete_secret name: begin_delete_secret summary: 'Delete all versions of a secret. Requires secrets/delete permission. @@ -117,20 +97,6 @@ methods: description: if the secret doesn't exist, - type: azure.core.exceptions.HttpResponseError description: for other errors - examples: - - "Delete a secret\n\n\n\n````python\n\n # delete a\ - \ secret\n deleted_secret_poller = secret_client.begin_delete_secret(secret_name)\n\ - \ deleted_secret = deleted_secret_poller.result()\n\n print(deleted_secret.name)\n\ - \n # if the vault has soft-delete enabled, the secret's, deleted_date\n #\ - \ scheduled purge date and recovery id are set\n print(deleted_secret.deleted_date)\n\ - \ print(deleted_secret.scheduled_purge_date)\n print(deleted_secret.recovery_id)\n\ - \n # if you want to block until secret is deleted server-side, call wait() on\ - \ the poller\n deleted_secret_poller.wait()\n\n ````\n" - uid: azure.keyvault.secrets.SecretClient.begin_recover_deleted_secret name: begin_recover_deleted_secret summary: 'Recover a deleted secret to its latest version. Possible only in a vault @@ -175,18 +141,6 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Recover a deleted secret\n\ - \n\n\n````python\n\ - \n # recover deleted secret to the latest version\n recover_secret_poller\ - \ = secret_client.begin_recover_deleted_secret(secret_name)\n recovered_secret\ - \ = recover_secret_poller.result()\n print(recovered_secret.id)\n print(recovered_secret.name)\n\ - \n # if you want to block until secret is recovered server-side, call wait()\ - \ on the poller\n recover_secret_poller.wait()\n\n ````\n" - uid: azure.keyvault.secrets.SecretClient.get_deleted_secret name: get_deleted_secret summary: Get a deleted secret. Possible only in vaults with soft-delete enabled. @@ -206,16 +160,6 @@ methods: description: if the deleted secret doesn't exist, - type: azure.core.exceptions.HttpResponseError description: for other errors - examples: - - "Get a deleted secret\n\ - \n\n\n````python\n\ - \n # gets a deleted secret (requires soft-delete enabled for the vault)\n \ - \ deleted_secret = secret_client.get_deleted_secret(secret_name)\n print(deleted_secret.name)\n\ - \n ````\n" - uid: azure.keyvault.secrets.SecretClient.get_secret name: get_secret summary: Get a secret. Requires the secrets/get permission. @@ -240,18 +184,6 @@ methods: description: if the secret doesn't exist, - type: azure.core.exceptions.HttpResponseError description: for other errors - examples: - - "Get a secret\n\n\n\n````python\n\n # get the\ - \ latest version of a secret\n secret = secret_client.get_secret(secret_name)\n\ - \n # alternatively, specify a version\n secret = secret_client.get_secret(secret_name,\ - \ secret.properties.version)\n\n print(secret.id)\n print(secret.name)\n \ - \ print(secret.properties.version)\n print(secret.properties.vault_url)\n\n\ - \ ````\n" - uid: azure.keyvault.secrets.SecretClient.list_deleted_secrets name: list_deleted_secrets summary: 'Lists all deleted secrets. Possible only in vaults with soft-delete enabled. @@ -263,19 +195,6 @@ methods: description: An iterator of deleted secrets, excluding their values types: - [] - examples: - - "List deleted secrets\n\ - \n\n\n````python\n\ - \n # gets an iterator of deleted secrets (requires soft-delete enabled for the\ - \ vault)\n deleted_secrets = secret_client.list_deleted_secrets()\n\n for\ - \ secret in deleted_secrets:\n # the list doesn't include values or versions\ - \ of the deleted secrets\n print(secret.id)\n print(secret.name)\n\ - \ print(secret.scheduled_purge_date)\n print(secret.recovery_id)\n\ - \ print(secret.deleted_date)\n\n\n ````\n" - uid: azure.keyvault.secrets.SecretClient.list_properties_of_secret_versions name: list_properties_of_secret_versions summary: 'List properties of all versions of a secret, excluding their values. Requires @@ -295,17 +214,6 @@ methods: description: An iterator of secrets, excluding their values types: - [] - examples: - - "List all versions of a secret\n\n\n\n````python\n\ - \n secret_versions = secret_client.list_properties_of_secret_versions(\"secret-name\"\ - )\n\n for secret in secret_versions:\n # the list doesn't include the\ - \ values at each version\n print(secret.id)\n print(secret.enabled)\n\ - \ print(secret.updated_on)\n\n ````\n" - uid: azure.keyvault.secrets.SecretClient.list_properties_of_secrets name: list_properties_of_secrets summary: 'List identifiers and attributes of all secrets in the vault. Requires @@ -319,17 +227,6 @@ methods: description: An iterator of secrets, excluding their values types: - [] - examples: - - "List all secrets\n\n\ - \n\n````python\n\ - \n # list secrets\n secrets = secret_client.list_properties_of_secrets()\n\ - \n for secret in secrets:\n # the list doesn't include values or versions\ - \ of the secrets\n print(secret.id)\n print(secret.name)\n print(secret.enabled)\n\ - \n ````\n" - uid: azure.keyvault.secrets.SecretClient.purge_deleted_secret name: purge_deleted_secret summary: 'Permanently deletes a deleted secret. Possible only in vaults with soft-delete @@ -385,15 +282,6 @@ methods: description: if the secret's name is already in use, - type: azure.core.exceptions.HttpResponseError description: for other errors - examples: - - "Restore a backed up secret\n\n\n\n````python\n\ - \n # restores a backed up secret\n restored_secret = secret_client.restore_secret_backup(secret_backup)\n\ - \ print(restored_secret.id)\n print(restored_secret.version)\n\n ````\n" - uid: azure.keyvault.secrets.SecretClient.set_secret name: set_secret summary: 'Set a secret value. If *name* is in use, create a new version of the secret. @@ -439,18 +327,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Set a secret's value\n\ - \n\n\n````python\n\ - \n from dateutil import parser as date_parse\n\n expires_on = date_parse.parse(\"\ - 2050-02-02T08:00:00.000Z\")\n\n # create a secret, setting optional arguments\n\ - \ secret = secret_client.set_secret(secret_name, \"secret-value\", expires_on=expires_on)\n\ - \n print(secret.name)\n print(secret.properties.version)\n print(secret.properties.expires_on)\n\ - \n ````\n" - uid: azure.keyvault.secrets.SecretClient.update_secret_properties name: update_secret_properties summary: 'Update properties of a secret other than its value. Requires secrets/set @@ -505,15 +381,3 @@ methods: description: if the secret doesn't exist, - type: azure.core.exceptions.HttpResponseError description: for other errors - examples: - - "Update a secret's attributes\n\n\n\n````python\n\ - \n # update attributes of an existing secret\n\n content_type = \"text/plain\"\ - \n tags = {\"foo\": \"updated tag\"}\n updated_secret_properties = secret_client.update_secret_properties(\n\ - \ secret_name, content_type=content_type, tags=tags\n )\n\n print(updated_secret_properties.version)\n\ - \ print(updated_secret_properties.updated_on)\n print(updated_secret_properties.content_type)\n\ - \ print(updated_secret_properties.tags)\n\n ````\n" diff --git a/preview/docs-ref-autogen/azure-keyvault-secrets/azure.keyvault.secrets.aio.SecretClient.yml b/preview/docs-ref-autogen/azure-keyvault-secrets/azure.keyvault.secrets.aio.SecretClient.yml index c6894f34754c..62ab3f739257 100644 --- a/preview/docs-ref-autogen/azure-keyvault-secrets/azure.keyvault.secrets.aio.SecretClient.yml +++ b/preview/docs-ref-autogen/azure-keyvault-secrets/azure.keyvault.secrets.aio.SecretClient.yml @@ -39,18 +39,6 @@ constructor: Vault domain. Defaults to True.' types: - -examples: -- "Create a new `SecretClient`\n\n\n\n````python\n\n from azure.identity.aio\ - \ import DefaultAzureCredential\n from azure.keyvault.secrets.aio import SecretClient\n\ - \n # Create a SecretClient using default Azure credentials\n credential = DefaultAzureCredential()\n\ - \ secret_client = SecretClient(vault_url, credential)\n\n # the client and credential\ - \ should be closed when no longer needed\n # (both are also async context managers)\n\ - \ await secret_client.close()\n await credential.close()\n\n ````\n" methods: - uid: azure.keyvault.secrets.aio.SecretClient.backup_secret name: backup_secret @@ -71,16 +59,6 @@ methods: description: if the secret doesn't exist, - type: azure.core.exceptions.HttpResponseError description: for other errors - examples: - - "Back up a secret\n\ - \n\n\n````python\n\ - \n # backup secret\n secret_backup = await secret_client.backup_secret(secret_name)\n\ - \n # returns the raw bytes of the backed up secret\n print(secret_backup)\n\ - \n ````\n" - uid: azure.keyvault.secrets.aio.SecretClient.delete_secret name: delete_secret summary: 'Delete all versions of a secret. Requires secrets/delete permission. @@ -102,18 +80,6 @@ methods: description: if the secret doesn't exist, - type: azure.core.exceptions.HttpResponseError description: for other errors - examples: - - "Delete a secret\n\ - \n\n\n````python\n\ - \n # delete a secret\n deleted_secret = await secret_client.delete_secret(secret_name)\n\ - \n print(deleted_secret.name)\n\n # if the vault has soft-delete enabled,\ - \ the secret's deleted_date,\n # scheduled purge date and recovery id are\ - \ set\n print(deleted_secret.deleted_date)\n print(deleted_secret.scheduled_purge_date)\n\ - \ print(deleted_secret.recovery_id)\n\n ````\n" - uid: azure.keyvault.secrets.aio.SecretClient.get_deleted_secret name: get_deleted_secret summary: Get a deleted secret. Possible only in vaults with soft-delete enabled. @@ -133,16 +99,6 @@ methods: description: if the deleted secret doesn't exist, - type: azure.core.exceptions.HttpResponseError description: for other errors - examples: - - "Get a deleted secret\n\n\n\n````python\n\ - \n # gets a deleted secret (requires soft-delete enabled for the vault)\n\ - \ deleted_secret = await secret_client.get_deleted_secret(secret_name)\n\ - \ print(deleted_secret.name)\n\n ````\n" - uid: azure.keyvault.secrets.aio.SecretClient.get_secret name: get_secret summary: Get a secret. Requires the secrets/get permission. @@ -168,18 +124,6 @@ methods: description: if the secret doesn't exist, - type: azure.core.exceptions.HttpResponseError description: for other errors - examples: - - "Get a secret\n\n\ - \n\n````python\n\ - \n # get the latest version of a secret\n secret = await secret_client.get_secret(secret_name)\n\ - \n # alternatively, specify a version\n secret = await secret_client.get_secret(secret_name,\ - \ secret_version)\n\n print(secret.id)\n print(secret.name)\n \ - \ print(secret.properties.version)\n print(secret.properties.vault_url)\n\ - \n ````\n" - uid: azure.keyvault.secrets.aio.SecretClient.list_deleted_secrets name: list_deleted_secrets summary: 'Lists all deleted secrets. Possible only in vaults with soft-delete enabled. @@ -191,20 +135,6 @@ methods: description: An iterator of deleted secrets, excluding their values types: - [] - examples: - - "Lists deleted secrets\n\n\n\n````python\n\ - \n # gets a list of deleted secrets (requires soft-delete enabled for the\ - \ vault)\n deleted_secrets = secret_client.list_deleted_secrets()\n\n \ - \ async for secret in deleted_secrets:\n # the list doesn't include\ - \ values or versions of the deleted secrets\n print(secret.id)\n \ - \ print(secret.name)\n print(secret.scheduled_purge_date)\n \ - \ print(secret.recovery_id)\n print(secret.deleted_date)\n\n\ - \ ````\n" - uid: azure.keyvault.secrets.aio.SecretClient.list_properties_of_secret_versions name: list_properties_of_secret_versions summary: 'List properties of all versions of a secret, excluding their values. Requires @@ -224,17 +154,6 @@ methods: description: An iterator of secrets, excluding their values types: - [] - examples: - - "List all versions of a secret\n\n\n\n````python\n\ - \n # gets a list of all versions of a secret\n secret_versions = secret_client.list_properties_of_secret_versions(\"\ - secret-name\")\n\n async for secret in secret_versions:\n # the\ - \ list doesn't include the versions' values\n print(secret.id)\n \ - \ print(secret.enabled)\n print(secret.updated_on)\n\n ````\n" - uid: azure.keyvault.secrets.aio.SecretClient.list_properties_of_secrets name: list_properties_of_secrets summary: 'List identifiers and attributes of all secrets in the vault. Requires @@ -248,17 +167,6 @@ methods: description: An iterator of secrets types: - [] - examples: - - "Lists all secrets\n\ - \n\n\n````python\n\ - \n # gets a list of secrets in the vault\n secrets = secret_client.list_properties_of_secrets()\n\ - \n async for secret in secrets:\n # the list doesn't include values\ - \ or versions of the secrets\n print(secret.id)\n print(secret.name)\n\ - \ print(secret.enabled)\n\n ````\n" - uid: azure.keyvault.secrets.aio.SecretClient.purge_deleted_secret name: purge_deleted_secret summary: 'Permanently delete a deleted secret. Possible only in vaults with soft-delete @@ -320,16 +228,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Recover a deleted secret\n\n\n\n````python\n\ - \n # recover deleted secret to the latest version\n recovered_secret\ - \ = await secret_client.recover_deleted_secret(secret_name)\n print(recovered_secret.id)\n\ - \ print(recovered_secret.name)\n\n ````\n" - uid: azure.keyvault.secrets.aio.SecretClient.restore_secret_backup name: restore_secret_backup summary: Restore a backed up secret. Requires the secrets/restore permission. @@ -349,16 +247,6 @@ methods: description: if the secret's name is already in use, - type: azure.core.exceptions.HttpResponseError description: for other errors - examples: - - "Restore a backed up secret\n\n\n\n````python\n\ - \n # restores a backed up secret\n restored_secret = await secret_client.restore_secret_backup(secret_backup)\n\ - \ print(restored_secret.id)\n print(restored_secret.version)\n\n \ - \ ````\n" - uid: azure.keyvault.secrets.aio.SecretClient.set_secret name: set_secret summary: 'Set a secret value. If *name* is in use, create a new version of the secret. @@ -404,19 +292,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Set a secret's value\n\n\n\n````python\n\ - \n from dateutil import parser as date_parse\n\n expires_on = date_parse.parse(\"\ - 2050-02-02T08:00:00.000Z\")\n async with secret_client:\n # create a secret,\ - \ setting optional arguments\n secret = await secret_client.set_secret(secret_name,\ - \ \"secret-value\", enabled=True, expires_on=expires_on)\n\n print(secret.id)\n\ - \ print(secret.name)\n print(secret.properties.enabled)\n print(secret.properties.expires_on)\n\ - \n ````\n" - uid: azure.keyvault.secrets.aio.SecretClient.update_secret_properties name: update_secret_properties summary: 'Update properties of a secret other than its value. Requires secrets/set @@ -471,16 +346,3 @@ methods: description: if the secret doesn't exist, - type: azure.core.exceptions.HttpResponseError description: for other errors - examples: - - "Updates a secret's attributes\n\n\n\n````python\n\ - \n # update attributes of an existing secret\n content_type = \"text/plain\"\ - \n tags = {\"foo\": \"updated tag\"}\n updated_secret_properties =\ - \ await secret_client.update_secret_properties(\n secret_name, content_type=content_type,\ - \ tags=tags\n )\n\n print(updated_secret_properties.version)\n \ - \ print(updated_secret_properties.updated_on)\n print(updated_secret_properties.content_type)\n\ - \ print(updated_secret_properties.tags)\n\n ````\n" diff --git a/preview/docs-ref-autogen/azure-maps-geolocation/azure.maps.geolocation.MapsGeolocationClient.yml b/preview/docs-ref-autogen/azure-maps-geolocation/azure.maps.geolocation.MapsGeolocationClient.yml index e7bb2e6302b5..d8cb2ef7acc5 100644 --- a/preview/docs-ref-autogen/azure-maps-geolocation/azure.maps.geolocation.MapsGeolocationClient.yml +++ b/preview/docs-ref-autogen/azure-maps-geolocation/azure.maps.geolocation.MapsGeolocationClient.yml @@ -30,27 +30,6 @@ constructor: Setting to an older version may result in reduced feature compatibility.' types: - -examples: -- "Creating the MapsGeolocationClient with an subscription key.\n\n\n\n````python\n\n from azure.core.credentials import AzureKeyCredential\n\ - \ from azure.maps.geolocation import MapsGeolocationClient\n\n subscription_key\ - \ = os.getenv(\"AZURE_SUBSCRIPTION_KEY\")\n\n maps_geolocation_client = MapsGeolocationClient(credential=AzureKeyCredential(subscription_key))\n\ - \n ````\n\nCreating the MapsGeolocationClient with a token credential.\n\n\n\n````python\n\n from azure.identity import DefaultAzureCredential\n \ - \ from azure.maps.geolocation import MapsGeolocationClient\n\n credential = DefaultAzureCredential()\n\ - \ maps_client_id = os.getenv(\"AZURE_MAPS_CLIENT_ID\")\n\n maps_geolocation_client\ - \ = MapsGeolocationClient(client_id=maps_client_id, credential=credential)\n\n \ - \ ````\n" methods: - uid: azure.maps.geolocation.MapsGeolocationClient.get_country_code name: get_country_code @@ -74,16 +53,3 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Return the ISO country code for the provided IP address.\n\n\n\n````python\n\n from azure.core.credentials import AzureKeyCredential\n\ - \ from azure.maps.geolocation import MapsGeolocationClient\n\n maps_geolocation_client\ - \ = MapsGeolocationClient(credential=AzureKeyCredential(subscription_key))\n\n\ - \ result = maps_geolocation_client.get_country_code(ip_address=\"2001:4898:80e8:b::189\"\ - )\n\n print(\"Get Country code with Geolocation:\")\n print(result.iso_code)\n\ - \n\n ````\n" diff --git a/preview/docs-ref-autogen/azure-maps-geolocation/azure.maps.geolocation.aio.MapsGeolocationClient.yml b/preview/docs-ref-autogen/azure-maps-geolocation/azure.maps.geolocation.aio.MapsGeolocationClient.yml index 4a92339f1e7b..e50dbe88f6c5 100644 --- a/preview/docs-ref-autogen/azure-maps-geolocation/azure.maps.geolocation.aio.MapsGeolocationClient.yml +++ b/preview/docs-ref-autogen/azure-maps-geolocation/azure.maps.geolocation.aio.MapsGeolocationClient.yml @@ -30,28 +30,6 @@ constructor: Setting to an older version may result in reduced feature compatibility.' types: - -examples: -- "Creating the MapsGeolocationClient with an subscription key.\n\n\n\n````python\n\n from azure.core.credentials\ - \ import AzureKeyCredential\n from azure.maps.geolocation.aio import MapsGeolocationClient\n\ - \n subscription_key = os.getenv(\"AZURE_SUBSCRIPTION_KEY\")\n\n maps_geolocation_client\ - \ = MapsGeolocationClient(credential=AzureKeyCredential(subscription_key))\n\n \ - \ ````\n\nCreating the MapsGeolocationClient with a token credential.\n\n\n\n````python\n\n from azure.identity.aio\ - \ import DefaultAzureCredential\n from azure.maps.geolocation.aio import MapsGeolocationClient\n\ - \n credential = DefaultAzureCredential()\n maps_client_id = os.getenv(\"AZURE_MAPS_CLIENT_ID\"\ - )\n\n maps_geolocation_client = MapsGeolocationClient(client_id=maps_client_id,\ - \ credential=credential)\n\n ````\n" methods: - uid: azure.maps.geolocation.aio.MapsGeolocationClient.get_country_code name: get_country_code @@ -75,16 +53,3 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Return the ISO country code for the provided IP address.\n\n\n\n````python\n\n from azure.core.credentials\ - \ import AzureKeyCredential\n from azure.maps.geolocation.aio import MapsGeolocationClient\n\ - \n maps_geolocation_client = MapsGeolocationClient(credential=AzureKeyCredential(subscription_key))\n\ - \n async with maps_geolocation_client:\n result = await maps_geolocation_client.get_country_code(ip_address=\"\ - 2001:4898:80e8:b::189\")\n\n print(\"Get Country code with Geolocation:\")\n\ - \ print(result.iso_code)\n\n ````\n" diff --git a/preview/docs-ref-autogen/azure-maps-render/azure.maps.render.MapsRenderClient.yml b/preview/docs-ref-autogen/azure-maps-render/azure.maps.render.MapsRenderClient.yml index 59380cb395d0..e73e4854082f 100644 --- a/preview/docs-ref-autogen/azure-maps-render/azure.maps.render.MapsRenderClient.yml +++ b/preview/docs-ref-autogen/azure-maps-render/azure.maps.render.MapsRenderClient.yml @@ -23,26 +23,6 @@ constructor: Setting to an older version may result in reduced feature compatibility.' types: - -examples: -- "Creating the MapsRenderClient with an subscription key.\n\n\n\ - \n````python\n\n from azure.core.credentials import AzureKeyCredential\n from\ - \ azure.maps.render import MapsRenderClient\n\n subscription_key = os.getenv(\"\ - AZURE_SUBSCRIPTION_KEY\")\n\n maps_render_client = MapsRenderClient(credential=AzureKeyCredential(subscription_key))\n\ - \n ````\n\nCreating the MapsRenderClient with a token credential.\n\n\n\ - \n````python\n\n from azure.identity import DefaultAzureCredential\n from azure.maps.render\ - \ import MapsRenderClient\n\n credential = DefaultAzureCredential()\n maps_client_id\ - \ = os.getenv(\"AZURE_MAPS_CLIENT_ID\")\n\n maps_render_client = MapsRenderClient(client_id=maps_client_id,\ - \ credential=credential)\n\n ````\n" methods: - uid: azure.maps.render.MapsRenderClient.get_copyright_caption name: get_copyright_caption @@ -63,18 +43,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Return serve copyright information for Render Tile service.\n\n\n\n````python\n\n from azure.core.credentials import AzureKeyCredential\n\ - \ from azure.maps.render import MapsRenderClient\n\n maps_render_client =\ - \ MapsRenderClient(credential=AzureKeyCredential(subscription_key))\n\n result\ - \ = maps_render_client.get_copyright_caption()\n\n print(\"Get copyright caption\ - \ result:\")\n print(result.copyrights_caption)\n\n ````\n" - uid: azure.maps.render.MapsRenderClient.get_copyright_for_tile name: get_copyright_for_tile summary: 'Copyrights API is designed to serve copyright information for Render Tile service. @@ -122,19 +90,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Returns the copyright information for a given tile.\n\n\n\n````python\n\n from azure.core.credentials\ - \ import AzureKeyCredential\n from azure.maps.render import MapsRenderClient\n\ - \n maps_render_client = MapsRenderClient(credential=AzureKeyCredential(subscription_key))\n\ - \n result = maps_render_client.get_copyright_for_tile(z=6, x=9, y=22)\n\n \ - \ print(\"Get copyright for tile result:\")\n print(result.general_copyrights[0])\n\ - \n ````\n" - uid: azure.maps.render.MapsRenderClient.get_copyright_for_world name: get_copyright_for_world summary: 'Copyrights API is designed to serve copyright information for Render Tile service. @@ -164,18 +119,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Returns the copyright information for the world.\n\n\n\n````python\n\n from azure.core.credentials\ - \ import AzureKeyCredential\n from azure.maps.render import MapsRenderClient\n\ - \n maps_render_client = MapsRenderClient(credential=AzureKeyCredential(subscription_key))\n\ - \n result = maps_render_client.get_copyright_for_world()\n\n print(\"Get copyright\ - \ for the world result:\")\n print(result.general_copyrights[0])\n\n ````\n" - uid: azure.maps.render.MapsRenderClient.get_copyright_from_bounding_box name: get_copyright_from_bounding_box summary: 'Returns copyright information for a given bounding box. Bounding-box requests @@ -205,22 +148,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Return copyright information for a given bounding box.\n\n\n\n````python\n\n from azure.core.credentials\ - \ import AzureKeyCredential\n from azure.maps.render import MapsRenderClient\n\ - \ from azure.maps.render.models import BoundingBox\n\n maps_render_client\ - \ = MapsRenderClient(credential=AzureKeyCredential(subscription_key))\n\n result\ - \ = maps_render_client.get_copyright_from_bounding_box(\n bounding_box=BoundingBox(\n\ - \ south=42.982261,\n west=24.980233,\n north=56.526017,\n\ - \ east=1.355233\n )\n )\n\n print(\"Get copyright from bounding\ - \ box result:\")\n print(result.general_copyrights[0])\n print(\"Result country\ - \ code:\")\n print(result.regions[0].country.iso3)\n\n ````\n" - uid: azure.maps.render.MapsRenderClient.get_map_attribution name: get_map_attribution summary: 'The Get Map Attribution API allows users to request map copyright attribution @@ -262,21 +189,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Return map copyright attribution information for a section of a tileset.\n\n\n\n````python\n\n from azure.core.credentials import AzureKeyCredential\n\ - \ from azure.maps.render import MapsRenderClient\n from azure.maps.render.models\ - \ import TilesetID, BoundingBox\n\n maps_render_client = MapsRenderClient(credential=AzureKeyCredential(subscription_key))\n\ - \n result = maps_render_client.get_map_attribution(\n tileset_id=TilesetID.MICROSOFT_BASE,\n\ - \ zoom=6,\n bounds=BoundingBox(\n south=42.982261,\n \ - \ west=24.980233,\n north=56.526017,\n east=1.355233\n\ - \ )\n )\n\n print(\"Get map attribution result:\")\n print(result.copyrights[0])\n\ - \n ````\n" - uid: azure.maps.render.MapsRenderClient.get_map_state_tile name: get_map_state_tile summary: 'Fetches state tiles in vector format typically to be integrated into indoor @@ -414,23 +326,6 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Return static image service renders a user-defined,\nrectangular image containing\ - \ a map section using a zoom level from 0 to 20.\n\n\n\n````python\n\n from azure.core.credentials import AzureKeyCredential\n\ - \ from azure.maps.render import MapsRenderClient\n from azure.maps.render.models\ - \ import BoundingBox\n\n maps_render_client = MapsRenderClient(credential=AzureKeyCredential(subscription_key))\n\ - \n result = maps_render_client.get_map_static_image(\n img_format=\"png\"\ - ,\n layer=\"basic\",\n style=\"dark\",\n zoom=10,\n bounding_box_private=\ - \ BoundingBox(\n 13.228, 52.4559, 13.5794, 52.629\n )\n )\n\n\ - \ print(\"Get map tile result to png file as 'map_static_image.png'\")\n #\ - \ Save result to file as png\n with open('map_static_image.png', 'wb') as file:\n\ - \ file.write(next(result))\n file.close()\n\n ````\n" - uid: azure.maps.render.MapsRenderClient.get_map_tile name: get_map_tile summary: 'The Get Map Tiles API allows users to request map tiles in vector or raster @@ -501,21 +396,6 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Return map tiles in vector or raster formats.\n\n\n\n````python\n\ - \n from azure.core.credentials import AzureKeyCredential\n from azure.maps.render\ - \ import MapsRenderClient\n from azure.maps.render.models import TilesetID\n\ - \n maps_render_client = MapsRenderClient(credential=AzureKeyCredential(subscription_key))\n\ - \n result = maps_render_client.get_map_tile(\n tileset_id=TilesetID.MICROSOFT_BASE,\n\ - \ z=6,\n x=9,\n y=22,\n tile_size=\"512\"\n )\n\n \ - \ print(\"Get map tile result store in file name 'map_tile.png'\")\n # print(result)\n\ - \ with open('map_tile.png', 'wb') as file:\n file.write(next(result))\n\ - \ file.close()\n\n ````\n" - uid: azure.maps.render.MapsRenderClient.get_map_tileset name: get_map_tileset summary: The Get Map Tileset API allows users to request metadata for a tileset. @@ -539,16 +419,3 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Return metadata for a tileset.\n\n\n\n````python\n\ - \n from azure.core.credentials import AzureKeyCredential\n from azure.maps.render\ - \ import MapsRenderClient\n from azure.maps.render.models import TilesetID\n\ - \n maps_render_client = MapsRenderClient(credential=AzureKeyCredential(subscription_key))\n\ - \n result = maps_render_client.get_map_tileset(tileset_id=TilesetID.MICROSOFT_BASE)\n\ - \n print(\"Get map tileset result:\")\n print(result.map_attribution)\n \ - \ print(result.bounds)\n print(result.version)\n\n ````\n" diff --git a/preview/docs-ref-autogen/azure-maps-render/azure.maps.render.aio.MapsRenderClient.yml b/preview/docs-ref-autogen/azure-maps-render/azure.maps.render.aio.MapsRenderClient.yml index 54bf49869714..699e1387bb5c 100644 --- a/preview/docs-ref-autogen/azure-maps-render/azure.maps.render.aio.MapsRenderClient.yml +++ b/preview/docs-ref-autogen/azure-maps-render/azure.maps.render.aio.MapsRenderClient.yml @@ -23,28 +23,6 @@ constructor: Setting to an older version may result in reduced feature compatibility.' types: - -examples: -- "Creating the MapsRenderClient with an subscription key.\n\n\n\n````python\n\n from azure.core.credentials\ - \ import AzureKeyCredential\n from azure.maps.render.aio import MapsRenderClient\n\ - \n subscription_key = os.getenv(\"AZURE_SUBSCRIPTION_KEY\")\n\n maps_render_client\ - \ = MapsRenderClient(credential=AzureKeyCredential(subscription_key))\n\n ````\n\ - \nCreating the MapsRenderClient with a token credential.\n\n\n\n````python\n\n from azure.identity.aio\ - \ import DefaultAzureCredential\n from azure.maps.render.aio import MapsRenderClient\n\ - \n credential = DefaultAzureCredential()\n maps_client_id = os.getenv(\"AZURE_MAPS_CLIENT_ID\"\ - )\n\n maps_render_client = MapsRenderClient(client_id=maps_client_id, credential=credential)\n\ - \n ````\n" methods: - uid: azure.maps.render.aio.MapsRenderClient.get_copyright_caption name: get_copyright_caption @@ -65,19 +43,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Return serve copyright information for Render Tile service.\n\n\n\n````python\n\n from azure.core.credentials\ - \ import AzureKeyCredential\n from azure.maps.render.aio import MapsRenderClient\n\ - \n maps_render_client = MapsRenderClient(credential=AzureKeyCredential(subscription_key))\n\ - \n async with maps_render_client:\n result = await maps_render_client.get_copyright_caption()\n\ - \n print(\"Get copyright caption result:\")\n print(result.copyrights_caption)\n\ - \n ````\n" - uid: azure.maps.render.aio.MapsRenderClient.get_copyright_for_tile name: get_copyright_for_tile summary: 'Copyrights API is designed to serve copyright information for Render Tile service. @@ -126,19 +91,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Returns the copyright information for a given tile.\n\n\n\n````python\n\n from azure.core.credentials\ - \ import AzureKeyCredential\n from azure.maps.render.aio import MapsRenderClient\n\ - \n maps_render_client = MapsRenderClient(credential=AzureKeyCredential(subscription_key))\n\ - \n async with maps_render_client:\n result = await maps_render_client.get_copyright_for_tile(z=6,\ - \ x=9, y=22)\n\n print(\"Get copyright for tile result:\")\n print(result.general_copyrights[0])\n\ - \n ````\n" - uid: azure.maps.render.aio.MapsRenderClient.get_copyright_for_world name: get_copyright_for_world summary: 'Copyrights API is designed to serve copyright information for Render Tile service. @@ -168,19 +120,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Returns the copyright information for the world.\n\n\n\n````python\n\n from azure.core.credentials\ - \ import AzureKeyCredential\n from azure.maps.render.aio import MapsRenderClient\n\ - \n maps_render_client = MapsRenderClient(credential=AzureKeyCredential(subscription_key))\n\ - \n async with maps_render_client:\n result = await maps_render_client.get_copyright_for_world()\n\ - \n print(\"Get copyright for the world result:\")\n print(result.general_copyrights[0])\n\ - \n ````\n" - uid: azure.maps.render.aio.MapsRenderClient.get_copyright_from_bounding_box name: get_copyright_from_bounding_box summary: 'Returns copyright information for a given bounding box. Bounding-box requests @@ -251,23 +190,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Return map copyright attribution information for a section of a tileset.\n\n\n\n````python\n\n from azure.core.credentials\ - \ import AzureKeyCredential\n from azure.maps.render.aio import MapsRenderClient\n\ - \ from azure.maps.render.models import TilesetID, BoundingBox\n\n maps_render_client\ - \ = MapsRenderClient(credential=AzureKeyCredential(subscription_key))\n\n async\ - \ with maps_render_client:\n result = await maps_render_client.get_map_attribution(\n\ - \ tileset_id=TilesetID.MICROSOFT_BASE,\n zoom=6,\n \ - \ bounds=BoundingBox(\n south=42.982261,\n west=24.980233,\n\ - \ north=56.526017,\n east=1.355233\n )\n\ - \ )\n\n print(\"Get map attribution result:\")\n print(result.copyrights[0])\n\ - \n ````\n" - uid: azure.maps.render.aio.MapsRenderClient.get_map_state_tile name: get_map_state_tile summary: 'Fetches state tiles in vector format typically to be integrated into indoor @@ -405,19 +327,6 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Return static image service renders a user-defined,\nrectangular image containing\ - \ a map section using a zoom level from 0 to 20.\n\n\n\n````python\n\n from azure.core.credentials\ - \ import AzureKeyCredential\n from azure.maps.render.aio import MapsRenderClient\n\ - \n maps_render_client = MapsRenderClient(credential=AzureKeyCredential(subscription_key))\n\ - \n async with maps_render_client:\n result = await maps_render_client.get_map_static_image(img_format=\"\ - png\", center=(52.41064,4.84228))\n\n ````\n" - uid: azure.maps.render.aio.MapsRenderClient.get_map_tile name: get_map_tile summary: 'The Get Map Tiles API allows users to request map tiles in vector or raster @@ -488,19 +397,6 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Return map tiles in vector or raster formats.\n\n\n\n````python\n\n from azure.core.credentials\ - \ import AzureKeyCredential\n from azure.maps.render.aio import MapsRenderClient\n\ - \ from azure.maps.render.models import TilesetID\n\n maps_render_client =\ - \ MapsRenderClient(credential=AzureKeyCredential(subscription_key))\n\n\n async\ - \ with maps_render_client:\n result = await maps_render_client.get_map_tile(tileset_id=TilesetID.MICROSOFT_BASE,\ - \ z=6, x=9, y=22, tile_size=\"512\")\n\n\n ````\n" - uid: azure.maps.render.aio.MapsRenderClient.get_map_tileset name: get_map_tileset summary: The Get Map Tileset API allows users to request metadata for a tileset. diff --git a/preview/docs-ref-autogen/azure-schemaregistry/azure.schemaregistry.SchemaRegistryClient.yml b/preview/docs-ref-autogen/azure-schemaregistry/azure.schemaregistry.SchemaRegistryClient.yml index d44e258bc5af..90a874f9f4a5 100644 --- a/preview/docs-ref-autogen/azure-schemaregistry/azure.schemaregistry.SchemaRegistryClient.yml +++ b/preview/docs-ref-autogen/azure-schemaregistry/azure.schemaregistry.SchemaRegistryClient.yml @@ -29,18 +29,6 @@ constructor: Default value is "2022-10".' types: - -examples: -- "Create a new instance of the SchemaRegistryClient.\n\n\n\n````python\n\n SCHEMAREGISTRY_FQN\ - \ = os.environ[\"SCHEMAREGISTRY_AVRO_FULLY_QUALIFIED_NAMESPACE\"]\n token_credential\ - \ = DefaultAzureCredential()\n schema_registry_client = SchemaRegistryClient(\n\ - \ fully_qualified_namespace=SCHEMAREGISTRY_FQN, credential=token_credential\n\ - \ )\n\n ````\n" methods: - uid: azure.schemaregistry.SchemaRegistryClient.close name: close @@ -89,25 +77,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Get schema by id.\n\n\n\n````python\n\n schema = schema_registry_client.get_schema(schema_id)\n\ - \ definition = schema.definition\n properties = schema.properties\n\n ````\n\ - \nGet schema by version.\n\n\n\n````python\n\n group_name = os.environ[\"SCHEMAREGISTRY_GROUP\"\ - ]\n name = \"your-schema-name\"\n schema = schema_registry_client.get_schema(group_name=group_name,\ - \ name=name, version=version)\n definition = schema.definition\n properties\ - \ = schema.properties\n\n ````\n" - uid: azure.schemaregistry.SchemaRegistryClient.get_schema_properties name: get_schema_properties summary: 'Gets the schema properties corresponding to an existing schema within @@ -143,23 +112,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Get schema id.\n\n\n\n````python\n\n group_name = os.environ[\"SCHEMAREGISTRY_GROUP\"\ - ]\n name = \"your-schema-name\"\n format = \"Avro\"\n schema_json = {\n\ - \ \"namespace\": \"example.avro\",\n \"type\": \"record\",\n \ - \ \"name\": \"User\",\n \"fields\": [\n {\"name\": \"name\",\ - \ \"type\": \"string\"},\n {\"name\": \"favorite_number\", \"type\"\ - : [\"int\", \"null\"]},\n {\"name\": \"favorite_color\", \"type\": [\"\ - string\", \"null\"]},\n ],\n }\n definition = json.dumps(schema_json,\ - \ separators=(\",\", \":\"))\n schema_properties = schema_registry_client.get_schema_properties(\n\ - \ group_name, name, definition, format\n )\n schema_id = schema_properties.id\n\ - \n ````\n" - uid: azure.schemaregistry.SchemaRegistryClient.register_schema name: register_schema summary: 'Register new schema. If schema of specified name does not exist in specified @@ -199,20 +151,3 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Register a new schema.\n\n\n\n````python\n\n GROUP_NAME = os.environ[\"SCHEMAREGISTRY_GROUP\"\ - ]\n NAME = \"your-schema-name\"\n FORMAT = \"Avro\"\n SCHEMA_JSON = {\n\ - \ \"namespace\": \"example.avro\",\n \"type\": \"record\",\n \ - \ \"name\": \"User\",\n \"fields\": [\n {\"name\": \"name\",\ - \ \"type\": \"string\"},\n {\"name\": \"favorite_number\", \"type\"\ - : [\"int\", \"null\"]},\n {\"name\": \"favorite_color\", \"type\": [\"\ - string\", \"null\"]},\n ],\n }\n DEFINITION = json.dumps(SCHEMA_JSON,\ - \ separators=(\",\", \":\"))\n schema_properties = schema_registry_client.register_schema(\n\ - \ GROUP_NAME, NAME, DEFINITION, FORMAT\n )\n schema_id = schema_properties.id\n\ - \n ````\n" diff --git a/preview/docs-ref-autogen/azure-schemaregistry/azure.schemaregistry.aio.SchemaRegistryClient.yml b/preview/docs-ref-autogen/azure-schemaregistry/azure.schemaregistry.aio.SchemaRegistryClient.yml index 58370d70bb6a..448881c671de 100644 --- a/preview/docs-ref-autogen/azure-schemaregistry/azure.schemaregistry.aio.SchemaRegistryClient.yml +++ b/preview/docs-ref-autogen/azure-schemaregistry/azure.schemaregistry.aio.SchemaRegistryClient.yml @@ -29,18 +29,6 @@ constructor: Default value is "2022-10".' types: - -examples: -- "Create a new instance of the SchemaRegistryClient.\n\n\n\n````python\n\n SCHEMAREGISTRY_FQN\ - \ = os.environ[\"SCHEMAREGISTRY_AVRO_FULLY_QUALIFIED_NAMESPACE\"]\n token_credential\ - \ = DefaultAzureCredential()\n schema_registry_client = SchemaRegistryClient(\n\ - \ fully_qualified_namespace=SCHEMAREGISTRY_FQN, credential=token_credential\n\ - \ )\n\n ````\n" methods: - uid: azure.schemaregistry.aio.SchemaRegistryClient.close name: close @@ -89,25 +77,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Get schema by id.\n\n\n\n````python\n\n schema = await schema_registry_client.get_schema(schema_id)\n\ - \ definition = schema.definition\n properties = schema.properties\n\n ````\n\ - \nGet schema by version.\n\n\n\n````python\n\n group_name = os.environ[\"SCHEMAREGISTRY_GROUP\"\ - ]\n name = \"your-schema-name\"\n schema = await schema_registry_client.get_schema(group_name=group_name,\ - \ name=name, version=version)\n definition = schema.definition\n properties\ - \ = schema.properties\n\n ````\n" - uid: azure.schemaregistry.aio.SchemaRegistryClient.get_schema_properties name: get_schema_properties summary: 'Gets the schema properties corresponding to an existing schema within @@ -143,23 +112,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Get schema by id.\n\n\n\n````python\n\n group_name = os.environ[\"SCHEMAREGISTRY_GROUP\"\ - ]\n name = \"your-schema-name\"\n format = \"Avro\"\n schema_json = {\n\ - \ \"namespace\": \"example.avro\",\n \"type\": \"record\",\n \ - \ \"name\": \"User\",\n \"fields\": [\n {\"name\": \"name\",\ - \ \"type\": \"string\"},\n {\"name\": \"favorite_number\", \"type\"\ - : [\"int\", \"null\"]},\n {\"name\": \"favorite_color\", \"type\": [\"\ - string\", \"null\"]},\n ],\n }\n definition = json.dumps(schema_json,\ - \ separators=(\",\", \":\"))\n schema_properties = await schema_registry_client.get_schema_properties(\n\ - \ group_name, name, definition, format\n )\n schema_id = schema_properties.id\n\ - \n ````\n" - uid: azure.schemaregistry.aio.SchemaRegistryClient.register_schema name: register_schema summary: 'Register new schema. If schema of specified name does not exist in specified @@ -199,20 +151,3 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Register a new schema.\n\n\n\n````python\n\n GROUP_NAME = os.environ[\"SCHEMAREGISTRY_GROUP\"\ - ]\n NAME = \"your-schema-name\"\n FORMAT = \"Avro\"\n SCHEMA_JSON = {\n\ - \ \"namespace\": \"example.avro\",\n \"type\": \"record\",\n \ - \ \"name\": \"User\",\n \"fields\": [\n {\"name\": \"name\",\ - \ \"type\": \"string\"},\n {\"name\": \"favorite_number\", \"type\"\ - : [\"int\", \"null\"]},\n {\"name\": \"favorite_color\", \"type\": [\"\ - string\", \"null\"]},\n ],\n }\n DEFINITION = json.dumps(SCHEMA_JSON,\ - \ separators=(\",\", \":\"))\n schema_properties = await schema_registry_client.register_schema(\n\ - \ GROUP_NAME, NAME, DEFINITION, FORMAT\n )\n schema_id = schema_properties.id\n\ - \n ````\n" diff --git a/preview/docs-ref-autogen/azure-search-documents/azure.search.documents.SearchClient.yml b/preview/docs-ref-autogen/azure-search-documents/azure.search.documents.SearchClient.yml index fb07c76fcec6..b8ce58d0834e 100644 --- a/preview/docs-ref-autogen/azure-search-documents/azure.search.documents.SearchClient.yml +++ b/preview/docs-ref-autogen/azure-search-documents/azure.search.documents.SearchClient.yml @@ -40,18 +40,6 @@ constructor: will be assumed.' types: - -examples: -- "Creating the SearchClient with an API key.\n\n\n\n````python\n\n from azure.core.credentials\ - \ import AzureKeyCredential\n from azure.search.documents import SearchClient\n\ - \n service_endpoint = os.getenv(\"AZURE_SEARCH_SERVICE_ENDPOINT\")\n index_name\ - \ = os.getenv(\"AZURE_SEARCH_INDEX_NAME\")\n key = os.getenv(\"AZURE_SEARCH_API_KEY\"\ - )\n\n search_client = SearchClient(service_endpoint, index_name, AzureKeyCredential(key))\n\ - \n ````\n" methods: - uid: azure.search.documents.SearchClient.autocomplete name: autocomplete @@ -129,19 +117,6 @@ methods: return: types: - [] - examples: - - "Get a auto-completions.\n\ - \n\n\n````python\n\ - \n from azure.core.credentials import AzureKeyCredential\n from azure.search.documents\ - \ import SearchClient\n\n search_client = SearchClient(service_endpoint, index_name,\ - \ AzureKeyCredential(key))\n\n results = search_client.autocomplete(search_text=\"\ - bo\", suggester_name=\"sg\")\n\n print(\"Autocomplete suggestions for 'bo'\"\ - )\n for result in results:\n print(\" Completion: {}\".format(result[\"\ - text\"]))\n\n ````\n" - uid: azure.search.documents.SearchClient.close name: close summary: Close the session. @@ -175,16 +150,6 @@ methods: return: types: - [] - examples: - - "Delete existing documents to an index\n\n\n\n````python\n\ - \n result = search_client.delete_documents(documents=[{\"HotelId\": \"1000\"\ - }])\n\n print(\"Delete new document succeeded: {}\".format(result[0].succeeded))\n\ - \n ````\n" - uid: azure.search.documents.SearchClient.get_document name: get_document summary: Retrieve a document from the Azure search index by its key. @@ -204,20 +169,6 @@ methods: return: types: - - examples: - - "Get a specific document from the search index.\n\n\n\n````python\n\ - \n from azure.core.credentials import AzureKeyCredential\n from azure.search.documents\ - \ import SearchClient\n\n search_client = SearchClient(service_endpoint, index_name,\ - \ AzureKeyCredential(key))\n\n result = search_client.get_document(key=\"23\"\ - )\n\n print(\"Details for hotel '23' are:\")\n print(\" Name: {}\"\ - .format(result[\"HotelName\"]))\n print(\" Rating: {}\".format(result[\"\ - Rating\"]))\n print(\" Category: {}\".format(result[\"Category\"]))\n\n \ - \ ````\n" - uid: azure.search.documents.SearchClient.get_document_count name: get_document_count summary: Return the number of documents in the Azure search index. @@ -263,16 +214,6 @@ methods: return: types: - [] - examples: - - "Merge fields into existing documents to an index\n\n\n\n````python\n\n result = search_client.merge_documents(documents=[{\"\ - HotelId\": \"1000\", \"Rating\": 4.5}])\n\n print(\"Merge into new document\ - \ succeeded: {}\".format(result[0].succeeded))\n\n ````\n" - uid: azure.search.documents.SearchClient.merge_or_upload_documents name: merge_or_upload_documents summary: 'Merge documents in to existing documents in the Azure search index, @@ -588,19 +529,6 @@ methods: return: types: - [] - examples: - - "Get search result facets.\n\ - \n\n\n````python\n\ - \n from azure.core.credentials import AzureKeyCredential\n from azure.search.documents\ - \ import SearchClient\n\n search_client = SearchClient(service_endpoint, index_name,\ - \ AzureKeyCredential(key))\n\n results = search_client.search(search_text=\"\ - WiFi\", facets=[\"Category,count:3\", \"ParkingIncluded\"])\n\n facets = results.get_facets()\n\ - \n print(\"Catgory facet counts for hotels:\")\n for facet in facets[\"Category\"\ - ]:\n print(\" {}\".format(facet))\n\n ````\n" - uid: azure.search.documents.SearchClient.suggest name: suggest summary: "Get search suggestion results from the Azure search index.\n\ncharacter,\ @@ -687,20 +615,6 @@ methods: return: types: - [] - examples: - - "Get search suggestions.\n\ - \n\n\n````python\n\ - \n from azure.core.credentials import AzureKeyCredential\n from azure.search.documents\ - \ import SearchClient\n\n search_client = SearchClient(service_endpoint, index_name,\ - \ AzureKeyCredential(key))\n\n results = search_client.suggest(search_text=\"\ - coffee\", suggester_name=\"sg\")\n\n print(\"Search suggestions for 'coffee'\"\ - )\n for result in results:\n hotel = search_client.get_document(key=result[\"\ - HotelId\"])\n print(\" Text: {} for Hotel: {}\".format(repr(result[\"\ - text\"]), hotel[\"HotelName\"]))\n\n ````\n" - uid: azure.search.documents.SearchClient.upload_documents name: upload_documents summary: 'Upload documents to the Azure search index. @@ -721,15 +635,3 @@ methods: return: types: - [] - examples: - - "Upload new documents to an index\n\n\n\n````python\n\ - \n DOCUMENT = {\n 'Category': 'Hotel',\n 'HotelId': '1000',\n \ - \ 'Rating': 4.0,\n 'Rooms': [],\n 'HotelName': 'Azure Inn',\n\ - \ }\n\n result = search_client.upload_documents(documents=[DOCUMENT])\n\n\ - \ print(\"Upload of new document succeeded: {}\".format(result[0].succeeded))\n\ - \n ````\n" diff --git a/preview/docs-ref-autogen/azure-search-documents/azure.search.documents.aio.SearchClient.yml b/preview/docs-ref-autogen/azure-search-documents/azure.search.documents.aio.SearchClient.yml index 3f7d506a5ea4..2e512f754346 100644 --- a/preview/docs-ref-autogen/azure-search-documents/azure.search.documents.aio.SearchClient.yml +++ b/preview/docs-ref-autogen/azure-search-documents/azure.search.documents.aio.SearchClient.yml @@ -40,19 +40,6 @@ constructor: will be assumed.' types: - -examples: -- "Creating the SearchClient with an API key.\n\n\n\n````python\n\n from azure.core.credentials import\ - \ AzureKeyCredential\n from azure.search.documents.aio import SearchClient\n \ - \ service_endpoint = os.getenv(\"AZURE_SEARCH_SERVICE_ENDPOINT\")\n index_name\ - \ = os.getenv(\"AZURE_SEARCH_INDEX_NAME\")\n key = os.getenv(\"AZURE_SEARCH_API_KEY\"\ - )\n\n search_client = SearchClient(service_endpoint, index_name, AzureKeyCredential(key))\n\ - \n ````\n" methods: - uid: azure.search.documents.aio.SearchClient.autocomplete name: autocomplete @@ -130,20 +117,6 @@ methods: return: types: - [] - examples: - - "Get a auto-completions.\n\n\n\n````python\n\n from azure.core.credentials import AzureKeyCredential\n\ - \ from azure.search.documents.aio import SearchClient\n\n search_client =\ - \ SearchClient(service_endpoint, index_name, AzureKeyCredential(key))\n\n async\ - \ with search_client:\n results = await search_client.autocomplete(search_text=\"\ - bo\", suggester_name=\"sg\")\n\n print(\"Autocomplete suggestions for 'bo'\"\ - )\n for result in results:\n print(\" Completion: {}\".format(result[\"\ - text\"]))\n\n ````\n" - uid: azure.search.documents.aio.SearchClient.close name: close summary: Close the session. @@ -177,16 +150,6 @@ methods: return: types: - [] - examples: - - "Delete existing documents to an index\n\n\n\n````python\n\n result = await\ - \ search_client.upload_documents(documents=[{\"HotelId\": \"1000\"}])\n\n print(\"\ - Delete new document succeeded: {}\".format(result[0].succeeded))\n\n ````\n" - uid: azure.search.documents.aio.SearchClient.get_document name: get_document summary: Retrieve a document from the Azure search index by its key. @@ -206,21 +169,6 @@ methods: return: types: - - examples: - - "Get a specific document from the search index.\n\n\n\n````python\n\n from azure.core.credentials\ - \ import AzureKeyCredential\n from azure.search.documents.aio import SearchClient\n\ - \n search_client = SearchClient(service_endpoint, index_name, AzureKeyCredential(key))\n\ - \n async with search_client:\n result = await search_client.get_document(key=\"\ - 23\")\n\n print(\"Details for hotel '23' are:\")\n print(\" \ - \ Name: {}\".format(result[\"HotelName\"]))\n print(\" Rating: {}\"\ - .format(result[\"Rating\"]))\n print(\" Category: {}\".format(result[\"\ - Category\"]))\n\n ````\n" - uid: azure.search.documents.aio.SearchClient.get_document_count name: get_document_count summary: Return the number of documents in the Azure search index. @@ -267,17 +215,6 @@ methods: return: types: - [] - examples: - - "Merge fields into existing documents to an index\n\n\n\n````python\n\n result = await\ - \ search_client.upload_documents(documents=[{\"HotelId\": \"1000\", \"Rating\"\ - : 4.5}])\n\n print(\"Merge into new document succeeded: {}\".format(result[0].succeeded))\n\ - \n ````\n" - uid: azure.search.documents.aio.SearchClient.merge_or_upload_documents name: merge_or_upload_documents summary: 'Merge documents in to existing documents in the Azure search index, @@ -594,21 +531,6 @@ methods: - - name: scoring_statistics description: A value that specifies whether we want to calculate scoring - examples: - - "Get search result facets.\n\n\n\n````python\n\n from azure.core.credentials import AzureKeyCredential\n\ - \ from azure.search.documents.aio import SearchClient\n\n search_client =\ - \ SearchClient(service_endpoint, index_name, AzureKeyCredential(key))\n\n async\ - \ with search_client:\n results = await search_client.search(search_text=\"\ - WiFi\", facets=[\"Category,count:3\", \"ParkingIncluded\"])\n\n facets =\ - \ await results.get_facets()\n\n print(\"Catgory facet counts for hotels:\"\ - )\n for facet in facets[\"Category\"]:\n print(\" {}\".format(facet))\n\ - \n ````\n" - uid: azure.search.documents.aio.SearchClient.suggest name: suggest summary: "Get search suggestion results from the Azure search index.\n\ncharacter,\ @@ -695,21 +617,6 @@ methods: return: types: - [] - examples: - - "Get search suggestions.\n\n\n\n````python\n\n from azure.core.credentials import AzureKeyCredential\n\ - \ from azure.search.documents.aio import SearchClient\n\n search_client =\ - \ SearchClient(service_endpoint, index_name, AzureKeyCredential(key))\n\n async\ - \ with search_client:\n results = await search_client.suggest(search_text=\"\ - coffee\", suggester_name=\"sg\")\n\n print(\"Search suggestions for 'coffee'\"\ - )\n for result in results:\n hotel = await search_client.get_document(key=result[\"\ - HotelId\"])\n print(\" Text: {} for Hotel: {}\".format(repr(result[\"\ - text\"]), hotel[\"HotelName\"]))\n\n ````\n" - uid: azure.search.documents.aio.SearchClient.upload_documents name: upload_documents summary: 'Upload documents to the Azure search index. @@ -730,15 +637,3 @@ methods: return: types: - [] - examples: - - "Upload new documents to an index\n\n\n\n````python\n\n DOCUMENT =\ - \ {\n 'Category': 'Hotel',\n 'HotelId': '1000',\n 'Rating':\ - \ 4.0,\n 'Rooms': [],\n 'HotelName': 'Azure Inn',\n }\n\n result\ - \ = await search_client.upload_documents(documents=[DOCUMENT])\n\n print(\"\ - Upload of new document succeeded: {}\".format(result[0].succeeded))\n\n ````\n" diff --git a/preview/docs-ref-autogen/azure-search-documents/azure.search.documents.indexes.SearchIndexClient.yml b/preview/docs-ref-autogen/azure-search-documents/azure.search.documents.indexes.SearchIndexClient.yml index f6792fe67dee..e2458ab05776 100644 --- a/preview/docs-ref-autogen/azure-search-documents/azure.search.documents.indexes.SearchIndexClient.yml +++ b/preview/docs-ref-autogen/azure-search-documents/azure.search.documents.indexes.SearchIndexClient.yml @@ -58,19 +58,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Analyze text\n\n\n\n````python\n\ - \n from azure.core.credentials import AzureKeyCredential\n from azure.search.documents.indexes\ - \ import SearchIndexClient\n from azure.search.documents.indexes.models import\ - \ AnalyzeTextOptions\n\n client = SearchIndexClient(service_endpoint, AzureKeyCredential(key))\n\ - \n analyze_request = AnalyzeTextOptions(text=\"One's \", analyzer_name=\"\ - standard.lucene\")\n\n result = client.analyze_text(index_name, analyze_request)\n\ - \ print(result.as_dict())\n\n ````\n" - uid: azure.search.documents.indexes.SearchIndexClient.close name: close summary: Close the session. @@ -107,24 +94,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Creating a new index.\n\n\n\n````python\n\ - \n name = \"hotels\"\n fields = [\n SimpleField(name=\"hotelId\", type=SearchFieldDataType.String,\ - \ key=True),\n SimpleField(name=\"baseRate\", type=SearchFieldDataType.Double),\n\ - \ SearchableField(name=\"description\", type=SearchFieldDataType.String,\ - \ collection=True),\n ComplexField(name=\"address\", fields=[\n \ - \ SimpleField(name=\"streetAddress\", type=SearchFieldDataType.String),\n \ - \ SimpleField(name=\"city\", type=SearchFieldDataType.String),\n \ - \ ], collection=True)\n ]\n cors_options = CorsOptions(allowed_origins=[\"\ - *\"], max_age_in_seconds=60)\n scoring_profiles = []\n index = SearchIndex(\n\ - \ name=name,\n fields=fields,\n scoring_profiles=scoring_profiles,\n\ - \ cors_options=cors_options)\n\n result = client.create_index(index)\n\ - \n ````\n" - uid: azure.search.documents.indexes.SearchIndexClient.create_or_update_alias name: create_or_update_alias summary: Creates a new search alias or updates an alias if it already exists. @@ -150,29 +119,6 @@ methods: - type: azure.core.exceptions.ResourceNotModifiedError - type: azure.core.exceptions.ResourceNotFoundError - type: azure.core.exceptions.ResourceExistsError - examples: - - "Updating an alias.\n\n\n\n````python\n\ - \n new_index_name = \"hotels\"\n fields = [\n SimpleField(name=\"hotelId\"\ - , type=SearchFieldDataType.String, key=True),\n SimpleField(name=\"baseRate\"\ - , type=SearchFieldDataType.Double),\n SearchableField(name=\"description\"\ - , type=SearchFieldDataType.String, collection=True),\n SearchableField(name=\"\ - hotelName\", type=SearchFieldDataType.String),\n ComplexField(name=\"address\"\ - , fields=[\n SimpleField(name=\"streetAddress\", type=SearchFieldDataType.String),\n\ - \ SimpleField(name=\"city\", type=SearchFieldDataType.String),\n \ - \ SimpleField(name=\"state\", type=SearchFieldDataType.String),\n \ - \ ], collection=True)\n ]\n cors_options = CorsOptions(allowed_origins=[\"\ - *\"], max_age_in_seconds=60)\n scoring_profile = ScoringProfile(\n name=\"\ - MyProfile\"\n )\n scoring_profiles = []\n scoring_profiles.append(scoring_profile)\n\ - \ index = SearchIndex(\n name=new_index_name,\n fields=fields,\n\ - \ scoring_profiles=scoring_profiles,\n cors_options=cors_options)\n\ - \n result_index = client.create_or_update_index(index=index)\n\n alias = SearchAlias(name\ - \ = alias_name, indexes = [new_index_name])\n result = client.create_or_update_alias(alias)\n\ - \n\n ````\n" - uid: azure.search.documents.indexes.SearchIndexClient.create_or_update_index name: create_or_update_index summary: Creates a new search index or updates an index if it already exists. @@ -215,27 +161,6 @@ methods: - type: azure.core.exceptions.ResourceNotModifiedError - type: azure.core.exceptions.ResourceNotFoundError - type: azure.core.exceptions.ResourceExistsError - examples: - - "Update an index.\n\n\n\n````python\n\ - \n name = \"hotels\"\n fields = [\n SimpleField(name=\"hotelId\", type=SearchFieldDataType.String,\ - \ key=True),\n SimpleField(name=\"baseRate\", type=SearchFieldDataType.Double),\n\ - \ SearchableField(name=\"description\", type=SearchFieldDataType.String,\ - \ collection=True),\n SearchableField(name=\"hotelName\", type=SearchFieldDataType.String),\n\ - \ ComplexField(name=\"address\", fields=[\n SimpleField(name=\"\ - streetAddress\", type=SearchFieldDataType.String),\n SimpleField(name=\"\ - city\", type=SearchFieldDataType.String),\n SimpleField(name=\"state\"\ - , type=SearchFieldDataType.String),\n ], collection=True)\n ]\n cors_options\ - \ = CorsOptions(allowed_origins=[\"*\"], max_age_in_seconds=60)\n scoring_profile\ - \ = ScoringProfile(\n name=\"MyProfile\"\n )\n scoring_profiles = []\n\ - \ scoring_profiles.append(scoring_profile)\n index = SearchIndex(\n \ - \ name=name,\n fields=fields,\n scoring_profiles=scoring_profiles,\n\ - \ cors_options=cors_options)\n\n result = client.create_or_update_index(index=index)\n\ - \n ````\n" - uid: azure.search.documents.indexes.SearchIndexClient.create_or_update_synonym_map name: create_or_update_synonym_map summary: 'Create a new Synonym Map in an Azure Search service, or update an @@ -271,17 +196,6 @@ methods: description: The created Synonym Map types: - - examples: - - "Create a Synonym Map\n\n\n\n````python\n\ - \n synonyms = [\n \"USA, United States, United States of America\",\n\ - \ \"Washington, Wash. => WA\",\n ]\n synonym_map = SynonymMap(name=\"\ - test-syn-map\", synonyms=synonyms)\n result = client.create_synonym_map(synonym_map)\n\ - \ print(\"Create new Synonym Map 'test-syn-map succeeded\")\n\n ````\n" - uid: azure.search.documents.indexes.SearchIndexClient.delete_alias name: delete_alias summary: 'Deletes a search alias and its associated mapping to an index. This operation @@ -303,14 +217,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Deleting an alias.\n\n\n\n````python\n\ - \n\n client.delete_alias(alias_name)\n\n ````\n" - uid: azure.search.documents.indexes.SearchIndexClient.delete_index name: delete_index summary: 'Deletes a search index and all the documents it contains. The model must @@ -332,14 +238,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Delete an index.\n\n\n\n````python\n\ - \n name = \"hotels\"\n client.delete_index(name)\n\n ````\n" - uid: azure.search.documents.indexes.SearchIndexClient.delete_synonym_map name: delete_synonym_map summary: 'Delete a named Synonym Map in an Azure Search service. To use access conditions, @@ -364,15 +262,6 @@ methods: description: None types: - - examples: - - "Delete a Synonym Map\n\n\n\n````python\n\ - \n client.delete_synonym_map(\"test-syn-map\")\n print(\"Synonym Map 'test-syn-map'\ - \ deleted\")\n\n ````\n" - uid: azure.search.documents.indexes.SearchIndexClient.get_alias name: get_alias signature: 'get_alias(name: str, **kwargs: Any) -> SearchAlias' @@ -403,14 +292,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Get an index.\n\ - \n\n\n````python\n\ - \n name = \"hotels\"\n result = client.get_index(name)\n\n ````\n" - uid: azure.search.documents.indexes.SearchIndexClient.get_index_statistics name: get_index_statistics summary: 'Returns statistics for the given index, including a document count @@ -463,16 +344,6 @@ methods: - exceptions: - type: azure.core.exceptions.ResourceNotFoundError - examples: - - "Get a Synonym Map\n\n\n\n````python\n\ - \n result = client.get_synonym_map(\"test-syn-map\")\n print(\"Retrived Synonym\ - \ Map 'test-syn-map' with synonyms\")\n for syn in result.synonyms:\n \ - \ print(\" {}\".format(syn))\n\n ````\n" - uid: azure.search.documents.indexes.SearchIndexClient.get_synonym_map_names name: get_synonym_map_names summary: List the Synonym Map names in an Azure Search service. @@ -503,16 +374,6 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "List Synonym Maps\n\n\n\n````python\n\ - \n result = client.get_synonym_maps()\n names = [x.name for x in result]\n\ - \ print(\"Found {} Synonym Maps in the service: {}\".format(len(result), \"\ - , \".join(names)))\n\n ````\n" - uid: azure.search.documents.indexes.SearchIndexClient.list_alias_names name: list_alias_names summary: List the alias names in an Azure Search service. diff --git a/preview/docs-ref-autogen/azure-search-documents/azure.search.documents.indexes.SearchIndexerClient.yml b/preview/docs-ref-autogen/azure-search-documents/azure.search.documents.indexes.SearchIndexerClient.yml index 24e20068dd16..23308a80418d 100644 --- a/preview/docs-ref-autogen/azure-search-documents/azure.search.documents.indexes.SearchIndexerClient.yml +++ b/preview/docs-ref-autogen/azure-search-documents/azure.search.documents.indexes.SearchIndexerClient.yml @@ -55,19 +55,6 @@ methods: description: The created SearchIndexerDataSourceConnection types: - - examples: - - "Create a Data Source\n\n\n\n````python\n\ - \n container = SearchIndexerDataContainer(name='searchcontainer')\n data_source_connection\ - \ = SearchIndexerDataSourceConnection(\n name=\"sample-data-source-connection\"\ - ,\n type=\"azureblob\",\n connection_string=connection_string,\n \ - \ container=container\n )\n result = client.create_data_source_connection(data_source_connection)\n\ - \ print(result)\n print(\"Create new Data Source Connection - sample-data-source-connection\"\ - )\n\n ````\n" - uid: azure.search.documents.indexes.SearchIndexerClient.create_indexer name: create_indexer summary: Creates a new SearchIndexer. @@ -207,16 +194,6 @@ methods: description: None types: - - examples: - - "Delete a SearchIndexerDataSourceConnection\n\n\n\n````python\n\ - \n client.delete_data_source_connection(\"sample-data-source-connection\")\n\ - \ print(\"Data Source Connection 'sample-data-source-connection' successfully\ - \ deleted\")\n\n ````\n" - uid: azure.search.documents.indexes.SearchIndexerClient.delete_indexer name: delete_indexer summary: 'Deletes an indexer. To use access conditions, the SearchIndexer model @@ -277,16 +254,6 @@ methods: description: The SearchIndexerDataSourceConnection that is fetched. types: - - examples: - - "Retrieve a SearchIndexerDataSourceConnection\n\n\n\n````python\n\ - \n result = client.get_data_source_connection(\"sample-data-source-connection\"\ - )\n print(\"Retrived Data Source Connection 'sample-data-source-connection'\"\ - )\n\n ````\n" - uid: azure.search.documents.indexes.SearchIndexerClient.get_data_source_connection_names name: get_data_source_connection_names summary: Lists all data source connection names available for a search service. @@ -314,16 +281,6 @@ methods: description: List of all the data source connections. types: - [] - examples: - - "List all the SearchIndexerDataSourceConnections\n\n\n\n````python\n\n result = client.get_data_source_connections()\n\ - \ names = [ds.name for ds in result]\n print(\"Found {} Data Source Connections\ - \ in the service: {}\".format(len(result), \", \".join(names)))\n\n ````\n" - uid: azure.search.documents.indexes.SearchIndexerClient.get_indexer name: get_indexer summary: Retrieves an indexer definition. diff --git a/preview/docs-ref-autogen/azure-search-documents/azure.search.documents.indexes.aio.SearchIndexClient.yml b/preview/docs-ref-autogen/azure-search-documents/azure.search.documents.indexes.aio.SearchIndexClient.yml index 40a65cc162e0..54f2da33b0c9 100644 --- a/preview/docs-ref-autogen/azure-search-documents/azure.search.documents.indexes.aio.SearchIndexClient.yml +++ b/preview/docs-ref-autogen/azure-search-documents/azure.search.documents.indexes.aio.SearchIndexClient.yml @@ -58,20 +58,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Analyze text\n\n\n\n````python\n\n from azure.core.credentials import AzureKeyCredential\n\ - \ from azure.search.documents.indexes.aio import SearchIndexClient\n from\ - \ azure.search.documents.indexes.models import AnalyzeTextOptions\n\n client\ - \ = SearchIndexClient(service_endpoint, AzureKeyCredential(key))\n\n analyze_request\ - \ = AnalyzeTextOptions(text=\"One's \", analyzer_name=\"standard.lucene\"\ - )\n\n async with client:\n result = await client.analyze_text(index_name,\ - \ analyze_request)\n print(result.as_dict())\n\n ````\n" - uid: azure.search.documents.indexes.aio.SearchIndexClient.close name: close summary: Close the session. @@ -90,16 +76,6 @@ methods: :raises: ~azure.core.exceptions.HttpResponseError' signature: 'create_alias(alias: SearchIndex, **kwargs: Any) -> SearchAlias' - examples: - - "Create an alias.\n\n\n\n````python\n\n alias = SearchAlias(name = alias_name,\ - \ indexes = [index_name])\n result = await client.create_alias(alias)\n\n \ - \ ````\n" - uid: azure.search.documents.indexes.aio.SearchIndexClient.create_index name: create_index summary: Creates a new search index. @@ -116,24 +92,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Creating a new index.\n\n\n\n````python\n\n name = \"hotels\"\n fields = [\n \ - \ SimpleField(name=\"hotelId\", type=SearchFieldDataType.String, key=True),\n\ - \ SimpleField(name=\"baseRate\", type=SearchFieldDataType.Double),\n \ - \ SearchableField(name=\"description\", type=SearchFieldDataType.String, collection=True),\n\ - \ ComplexField(name=\"address\", fields=[\n SimpleField(name=\"\ - streetAddress\", type=SearchFieldDataType.String),\n SimpleField(name=\"\ - city\", type=SearchFieldDataType.String),\n ], collection=True)\n ]\n\n\ - \ cors_options = CorsOptions(allowed_origins=[\"*\"], max_age_in_seconds=60)\n\ - \ scoring_profiles = []\n index = SearchIndex(\n name=name,\n \ - \ fields=fields,\n scoring_profiles=scoring_profiles,\n cors_options=cors_options)\n\ - \n result = await client.create_index(index)\n\n ````\n" - uid: azure.search.documents.indexes.aio.SearchIndexClient.create_or_update_alias name: create_or_update_alias summary: Creates a new search alias or updates an alias if it already exists. @@ -159,29 +117,6 @@ methods: - type: azure.core.exceptions.ResourceNotModifiedError - type: azure.core.exceptions.ResourceNotFoundError - type: azure.core.exceptions.ResourceExistsError - examples: - - "Update an alias.\n\n\n\n````python\n\n new_index_name = \"hotels\"\n\ - \ fields = [\n SimpleField(name=\"hotelId\", type=SearchFieldDataType.String,\ - \ key=True),\n SimpleField(name=\"baseRate\", type=SearchFieldDataType.Double),\n\ - \ SearchableField(name=\"description\", type=SearchFieldDataType.String,\ - \ collection=True),\n SearchableField(name=\"hotelName\", type=SearchFieldDataType.String),\n\ - \ ComplexField(name=\"address\", fields=[\n SimpleField(name=\"\ - streetAddress\", type=SearchFieldDataType.String),\n SimpleField(name=\"\ - city\", type=SearchFieldDataType.String),\n SimpleField(name=\"state\"\ - , type=SearchFieldDataType.String),\n ], collection=True)\n ]\n cors_options\ - \ = CorsOptions(allowed_origins=[\"*\"], max_age_in_seconds=60)\n scoring_profile\ - \ = ScoringProfile(\n name=\"MyProfile\"\n )\n scoring_profiles = []\n\ - \ scoring_profiles.append(scoring_profile)\n index = SearchIndex(\n \ - \ name=new_index_name,\n fields=fields,\n scoring_profiles=scoring_profiles,\n\ - \ cors_options=cors_options)\n\n result_index = await client.create_or_update_index(index=index)\n\ - \n alias = SearchAlias(name = alias_name, indexes = [new_index_name])\n result\ - \ = await client.create_or_update_alias(alias)\n\n\n ````\n" - uid: azure.search.documents.indexes.aio.SearchIndexClient.create_or_update_index name: create_or_update_index summary: Creates a new search index or updates an index if it already exists. @@ -224,28 +159,6 @@ methods: - type: azure.core.exceptions.ResourceNotModifiedError - type: azure.core.exceptions.ResourceNotFoundError - type: azure.core.exceptions.ResourceExistsError - examples: - - "Update an index.\n\n\n\n````python\n\n name = \"hotels\"\n fields = [\n \ - \ SimpleField(name=\"hotelId\", type=SearchFieldDataType.String, key=True),\n\ - \ SimpleField(name=\"baseRate\", type=SearchFieldDataType.Double),\n \ - \ SearchableField(name=\"description\", type=SearchFieldDataType.String, collection=True),\n\ - \ SearchableField(name=\"hotelName\", type=SearchFieldDataType.String),\n\ - \ ComplexField(name=\"address\", fields=[\n SimpleField(name=\"\ - streetAddress\", type=SearchFieldDataType.String),\n SimpleField(name=\"\ - city\", type=SearchFieldDataType.String),\n SimpleField(name=\"state\"\ - , type=SearchFieldDataType.String),\n ], collection=True)\n ]\n\n cors_options\ - \ = CorsOptions(allowed_origins=[\"*\"], max_age_in_seconds=60)\n scoring_profile\ - \ = ScoringProfile(\n name=\"MyProfile\"\n )\n scoring_profiles = []\n\ - \ scoring_profiles.append(scoring_profile)\n index = SearchIndex(\n \ - \ name=name,\n fields=fields,\n scoring_profiles=scoring_profiles,\n\ - \ cors_options=cors_options)\n\n result = await client.create_or_update_index(index=index)\n\ - \n ````\n" - uid: azure.search.documents.indexes.aio.SearchIndexClient.create_or_update_synonym_map name: create_or_update_synonym_map summary: 'Create a new Synonym Map in an Azure Search service, or update an @@ -282,17 +195,6 @@ methods: description: The created Synonym Map types: - - examples: - - "Create a Synonym Map\n\n\n\n````python\n\n synonyms = [\n \"USA, United States,\ - \ United States of America\",\n \"Washington, Wash. => WA\",\n ]\n synonym_map\ - \ = SynonymMap(name=\"test-syn-map\", synonyms=synonyms)\n result = await client.create_synonym_map(synonym_map)\n\ - \ print(\"Create new Synonym Map 'test-syn-map succeeded\")\n\n ````\n" - uid: azure.search.documents.indexes.aio.SearchIndexClient.delete_alias name: delete_alias summary: 'Deletes a search alias and its associated mapping to an index. @@ -311,15 +213,6 @@ methods: :raises: ~azure.core.exceptions.HttpResponseError' signature: 'delete_alias(alias: str | SearchAlias, *, match_condition: MatchConditions = MatchConditions.Unconditionally, **kwargs: Any) -> None' - examples: - - "Delete an alias.\n\n\n\n````python\n\n\n await client.delete_alias(alias_name)\n\ - \n ````\n" - uid: azure.search.documents.indexes.aio.SearchIndexClient.delete_index name: delete_index summary: 'Deletes a search index and all the documents it contains. The model must @@ -340,15 +233,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Delete an index.\n\n\n\n````python\n\n name = \"hotels\"\n await client.delete_index(name)\n\ - \n ````\n" - uid: azure.search.documents.indexes.aio.SearchIndexClient.delete_synonym_map name: delete_synonym_map summary: 'Delete a named Synonym Map in an Azure Search service. To use access conditions, @@ -373,15 +257,6 @@ methods: description: None types: - - examples: - - "Delete a Synonym Map\n\n\n\n````python\n\n await client.delete_synonym_map(\"test-syn-map\"\ - )\n print(\"Synonym Map 'test-syn-map' deleted\")\n\n ````\n" - uid: azure.search.documents.indexes.aio.SearchIndexClient.get_alias name: get_alias signature: 'get_alias(name: str, **kwargs) -> SearchAlias' @@ -412,15 +287,6 @@ methods: - exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "Get an index.\n\n\n\n````python\n\n name = \"hotels\"\n result = await\ - \ client.get_index(name)\n\n ````\n" - uid: azure.search.documents.indexes.aio.SearchIndexClient.get_index_statistics name: get_index_statistics summary: 'Returns statistics for the given index, including a document count @@ -473,17 +339,6 @@ methods: - exceptions: - type: azure.core.exceptions.ResourceNotFoundError - examples: - - "Get a Synonym Map\n\n\n\n````python\n\n result = await client.get_synonym_map(\"\ - test-syn-map\")\n print(\"Retrived Synonym Map 'test-syn-map' with synonyms\"\ - )\n for syn in result.synonyms:\n print(\" {}\".format(syn))\n\n \ - \ ````\n" - uid: azure.search.documents.indexes.aio.SearchIndexClient.get_synonym_map_names name: get_synonym_map_names summary: List the Synonym Map names in an Azure Search service. @@ -515,16 +370,6 @@ methods: - [] exceptions: - type: azure.core.exceptions.HttpResponseError - examples: - - "List Synonym Maps\n\n\n\n````python\n\n result = await client.get_synonym_maps()\n\ - \ names = [x.name for x in result]\n print(\"Found {} Synonym Maps in the\ - \ service: {}\".format(len(result), \", \".join(names)))\n\n ````\n" - uid: azure.search.documents.indexes.aio.SearchIndexClient.list_alias_names name: list_alias_names summary: List the alias names in an Azure Search service. diff --git a/preview/docs-ref-autogen/azure-search-documents/azure.search.documents.indexes.aio.SearchIndexerClient.yml b/preview/docs-ref-autogen/azure-search-documents/azure.search.documents.indexes.aio.SearchIndexerClient.yml index f42a27e6ce80..469cd84d8737 100644 --- a/preview/docs-ref-autogen/azure-search-documents/azure.search.documents.indexes.aio.SearchIndexerClient.yml +++ b/preview/docs-ref-autogen/azure-search-documents/azure.search.documents.indexes.aio.SearchIndexerClient.yml @@ -55,20 +55,6 @@ methods: :rtype: ~azure.search.documents.indexes.models.SearchIndexerDataSourceConnection' signature: 'async create_data_source_connection(data_source_connection: SearchIndexerDataSourceConnection, **kwargs: Any) -> SearchIndexerDataSourceConnection' - examples: - - "Create a SearchIndexerDataSourceConnection\n\n\n\n````python\n\n container\ - \ = SearchIndexerDataContainer(name='searchcontainer')\n data_source = SearchIndexerDataSourceConnection(\n\ - \ name=\"async-sample-data-source-connection\",\n type=\"azureblob\"\ - ,\n connection_string=connection_string,\n container=container\n \ - \ )\n result = await client.create_data_source_connection(data_source)\n \ - \ print(\"Create new Data Source Connection - async-sample-data-source-connection\"\ - )\n\n ````\n" - uid: azure.search.documents.indexes.aio.SearchIndexerClient.create_indexer name: create_indexer summary: Creates a new SearchIndexer. @@ -274,15 +260,7 @@ methods: return: description: The SearchIndexerDataSourceConnection that is fetched. types: - - '[[]()][], [], [], [], [], , - , , , - , ()()' + - - uid: azure.search.documents.indexes.aio.SearchIndexerClient.get_data_source_connection_names name: get_data_source_connection_names summary: Lists all data source connection names available for a search service. @@ -299,17 +277,6 @@ methods: description: List of all the data source connections. types: - [] - examples: - - "List all SearchIndexerDataSourceConnections\n\n\n\n````python\n\n result = await\ - \ client.get_data_source_connections()\n names = [x.name for x in result]\n\ - \ print(\"Found {} Data Source Connections in the service: {}\".format(len(result),\ - \ \", \".join(names)))\n\n ````\n" - uid: azure.search.documents.indexes.aio.SearchIndexerClient.get_indexer name: get_indexer summary: Retrieves a indexer definition. diff --git a/preview/docs-ref-autogen/azure-storage-blob-changefeed/azure.storage.blob.changefeed.ChangeFeedClient.yml b/preview/docs-ref-autogen/azure-storage-blob-changefeed/azure.storage.blob.changefeed.ChangeFeedClient.yml index f8428fffef65..9246dfd53963 100644 --- a/preview/docs-ref-autogen/azure-storage-blob-changefeed/azure.storage.blob.changefeed.ChangeFeedClient.yml +++ b/preview/docs-ref-autogen/azure-storage-blob-changefeed/azure.storage.blob.changefeed.ChangeFeedClient.yml @@ -54,16 +54,6 @@ constructor: feature compatibility.' types: - -examples: -- "Creating the ChangeFeedClient from a URL to a public blob (no auth needed).\n\n\n\ - \n````python\n\n cf_client = ChangeFeedClient(\"https://{}.blob.core.windows.net\"\ - .format(self.ACCOUNT_NAME),\n credential=self.ACCOUNT_KEY)\n\ - \n ````\n" methods: - uid: azure.storage.blob.changefeed.ChangeFeedClient.from_connection_string name: from_connection_string @@ -124,27 +114,3 @@ methods: description: An iterable (auto-paging) response of events whose type is dictionary. types: - [] - examples: - - "List all change feed events.\n\n\n\n````python\n\ - \n cf_client = ChangeFeedClient(\"https://{}.blob.core.windows.net\".format(self.ACCOUNT_NAME),\n\ - \ credential=self.ACCOUNT_KEY)\n change_feed\ - \ = cf_client.list_changes()\n\n # print all events\n for event in change_feed:\n\ - \ print(event)\n\n ````\n\nList change feed events by page.\n\n\n\n````python\n\n # [START create_change_feed_client]\n\ - \ cf_client = ChangeFeedClient(\"https://{}.blob.core.windows.net\".format(self.ACCOUNT_NAME),\n\ - \ credential=self.ACCOUNT_KEY)\n # [END create_change_feed_client]\n\ - \n change_feed = cf_client.list_changes(results_per_page=10).by_page()\n\n \ - \ # print first page of events\n change_feed_page1 = next(change_feed)\n \ - \ for event in change_feed_page1:\n print(event)\n\n # print second page\ - \ of events\n change_feed_page2 = next(change_feed)\n for event in change_feed_page2:\n\ - \ print(event)\n\n ````\n" diff --git a/preview/docs-ref-autogen/azure-storage-blob/azure.storage.blob.BlobClient.yml b/preview/docs-ref-autogen/azure-storage-blob/azure.storage.blob.BlobClient.yml index 9cb1eae542a6..86f443c40ef4 100644 --- a/preview/docs-ref-autogen/azure-storage-blob/azure.storage.blob.BlobClient.yml +++ b/preview/docs-ref-autogen/azure-storage-blob/azure.storage.blob.BlobClient.yml @@ -128,24 +128,6 @@ constructor: or 4MB.' types: - -examples: -- "Creating the BlobClient from a URL to a public blob (no auth needed).\n\n\n\n````python\n\n from azure.storage.blob import BlobClient\n blob_client\ - \ = BlobClient.from_blob_url(blob_url=\"https://account.blob.core.windows.net/container/blob-name\"\ - )\n\n ````\n\nCreating the BlobClient from a SAS URL to a blob.\n\n\n\n````python\n\n from azure.storage.blob import BlobClient\n\n \ - \ sas_url = \"https://account.blob.core.windows.net/container/blob-name?sv=2015-04-05&st=2015-04-29T22%3A18%3A26Z&se=2015-04-30T02%3A23%3A26Z&sr=b&sp=rw&sip=168.1.5.60-168.1.5.70&spr=https&sig=Z%2FRHIX5Xcg0Mq2rqI3OlWTjEg2tYkboXr1P9ZUXDtkk%3D\"\ - \n blob_client = BlobClient.from_blob_url(sas_url)\n\n ````\n" methods: - uid: azure.storage.blob.BlobClient.abort_copy name: abort_copy @@ -170,17 +152,6 @@ methods: return: types: - - examples: - - "Abort copying a blob from URL.\n\n\n\n````python\n\ - \n # Passing in copy id to abort copy operation\n if props.copy.status !=\ - \ \"success\":\n copied_blob.abort_copy(copy_id)\n\n # check copy status\n\ - \ props = copied_blob.get_blob_properties()\n print(props.copy.status)\n\n\ - \ ````\n" - uid: azure.storage.blob.BlobClient.acquire_lease name: acquire_lease summary: 'Requests a new lease. @@ -273,16 +244,6 @@ methods: description: A BlobLeaseClient object. types: - - examples: - - "Acquiring a lease on a blob.\n\n\n\n````python\n\ - \n # Acquire a lease on the blob\n lease = blob_client.acquire_lease()\n\n\ - \ # Delete blob by passing in the lease\n blob_client.delete_blob(lease=lease)\n\ - \n ````\n" - uid: azure.storage.blob.BlobClient.append_block name: append_block summary: Commits a new block of data to the end of the existing append blob. @@ -1356,16 +1317,6 @@ methods: description: Blob-updated property dict (Snapshot ID, Etag, and last modified). types: - [, ] - examples: - - "Create a snapshot of the blob.\n\n\n\n````python\n\ - \n # Create a read-only snapshot of the blob at this point in time\n snapshot_blob\ - \ = blob_client.create_snapshot()\n\n # Get the snapshot ID\n print(snapshot_blob.get('snapshot'))\n\ - \n ````\n" - uid: azure.storage.blob.BlobClient.delete_blob name: delete_blob summary: 'Marks the specified blob for deletion. @@ -1484,14 +1435,6 @@ methods: return: types: - - examples: - - "Delete a blob.\n\ - \n\n\n````python\n\ - \n blob_client.delete_blob()\n\n ````\n" - uid: azure.storage.blob.BlobClient.delete_immutability_policy name: delete_immutability_policy summary: 'The Delete Immutability Policy operation deletes the immutability policy @@ -1681,15 +1624,6 @@ methods: description: A streaming object (StorageStreamDownloader) types: - - examples: - - "Download a blob.\n\ - \n\n\n````python\n\ - \n with open(DEST_FILE, \"wb\") as my_blob:\n download_stream = blob_client.download_blob()\n\ - \ my_blob.write(download_stream.readall())\n\n ````\n" - uid: azure.storage.blob.BlobClient.exists name: exists summary: 'Returns True if a blob exists with the defined parameters, and returns @@ -1829,16 +1763,6 @@ methods: description: A Blob client. types: - - examples: - - "Creating the BlobClient from a connection string.\n\n\n\n````python\n\n from azure.storage.blob import BlobClient\n \ - \ blob_client = BlobClient.from_connection_string(\n self.connection_string,\ - \ container_name=\"mycontainer\", blob_name=\"blobname.txt\")\n\n ````\n" - uid: azure.storage.blob.BlobClient.get_account_information name: get_account_information summary: 'Gets information related to the storage account in which the blob resides. @@ -1951,14 +1875,6 @@ methods: description: BlobProperties types: - - examples: - - "Getting the properties for a blob.\n\n\n\n````python\n\ - \n properties = blob_client.get_blob_properties()\n\n ````\n" - uid: azure.storage.blob.BlobClient.get_blob_tags name: get_blob_tags summary: 'The Get Tags operation enables users to get tags on a blob or specific @@ -2554,22 +2470,6 @@ methods: description: A streaming object (BlobQueryReader) types: - - examples: - - "select/project on blob/or blob snapshot data by providing simple query expressions.\n\n\n\ - \n````python\n\n errors = []\n def on_error(error):\n errors.append(error)\n\ - \n # upload the csv file\n blob_client = blob_service_client.get_blob_client(container_name,\ - \ \"csvfile\")\n with open(\"./sample-blobs/quick_query.csv\", \"rb\") as stream:\n\ - \ blob_client.upload_blob(stream, overwrite=True)\n\n # select the second\ - \ column of the csv file\n query_expression = \"SELECT _2 from BlobStorage\"\ - \n input_format = DelimitedTextDialect(delimiter=',', quotechar='\"', lineterminator='\\\ - n', escapechar=\"\", has_header=False)\n output_format = DelimitedJsonDialect(delimiter='\\\ - n')\n reader = blob_client.query_blob(query_expression, on_error=on_error, blob_format=input_format,\ - \ output_format=output_format)\n content = reader.readall()\n\n ````\n" - uid: azure.storage.blob.BlobClient.resize_blob name: resize_blob summary: 'Resizes a page blob to the specified size. @@ -3821,18 +3721,6 @@ methods: description: A dictionary of copy properties (etag, last_modified, copy_id, copy_status). types: - [, [, ]] - examples: - - "Copy a blob from a URL.\n\ - \n\n\n````python\n\n # Get the\ - \ blob client with the source blob\n source_blob = \"https://www.gutenberg.org/files/59466/59466-0.txt\"\ - \n copied_blob = blob_service_client.get_blob_client(\"copyblobcontainer\",\ - \ '59466-0.txt')\n\n # start copy and check copy status\n copy = copied_blob.start_copy_from_url(source_blob)\n\ - \ props = copied_blob.get_blob_properties()\n print(props.copy.status)\n\n\ - \ ````\n" - uid: azure.storage.blob.BlobClient.undelete_blob name: undelete_blob summary: 'Restores soft-deleted blobs or snapshots. @@ -3866,15 +3754,6 @@ methods: return: types: - - examples: - - "Undeleting a blob.\n\ - \n\n\n````python\n\n # Undelete\ - \ the blob before the retention policy expires\n blob_client.undelete_blob()\n\ - \n ````\n" - uid: azure.storage.blob.BlobClient.upload_blob name: upload_blob summary: Creates a new blob from a data source with automatic chunking. @@ -4135,15 +4014,6 @@ methods: description: Blob-updated property dict (Etag and last modified) types: - [, ] - examples: - - "Upload a blob to the container.\n\n\n\n````python\n\ - \n # Upload content to block blob\n with open(SOURCE_FILE, \"rb\") as data:\n\ - \ blob_client.upload_blob(data, blob_type=\"BlockBlob\")\n\n ````\n" - uid: azure.storage.blob.BlobClient.upload_blob_from_url name: upload_blob_from_url summary: 'Creates a new Block Blob where the content of the blob is read from a diff --git a/preview/docs-ref-autogen/azure-storage-blob/azure.storage.blob.BlobServiceClient.yml b/preview/docs-ref-autogen/azure-storage-blob/azure.storage.blob.BlobServiceClient.yml index 2db9189cc282..3859b4c4d0bb 100644 --- a/preview/docs-ref-autogen/azure-storage-blob/azure.storage.blob.BlobServiceClient.yml +++ b/preview/docs-ref-autogen/azure-storage-blob/azure.storage.blob.BlobServiceClient.yml @@ -117,28 +117,6 @@ constructor: or 4MB.' types: - -examples: -- "Creating the BlobServiceClient with account url and credential.\n\n\n\n````python\n\n from azure.storage.blob import BlobServiceClient\n\ - \ blob_service_client = BlobServiceClient(account_url=self.url, credential=self.shared_access_key)\n\ - \n ````\n\nCreating the BlobServiceClient with Azure Identity credentials.\n\n\n\n````python\n\n # Get a token credential for authentication\n \ - \ from azure.identity import ClientSecretCredential\n token_credential = ClientSecretCredential(\n\ - \ self.active_directory_tenant_id,\n self.active_directory_application_id,\n\ - \ self.active_directory_application_secret\n )\n\n # Instantiate a BlobServiceClient\ - \ using a token credential\n from azure.storage.blob import BlobServiceClient\n\ - \ blob_service_client = BlobServiceClient(account_url=self.oauth_url, credential=token_credential)\n\ - \n ````\n" methods: - uid: azure.storage.blob.BlobServiceClient.create_container name: create_container @@ -197,16 +175,6 @@ methods: return: types: - - examples: - - "Creating a container in the blob service.\n\n\n\n````python\n\ - \n try:\n new_container = blob_service_client.create_container(\"containerfromblobservice\"\ - )\n properties = new_container.get_container_properties()\n except ResourceExistsError:\n\ - \ print(\"Container already exists.\")\n\n ````\n" - uid: azure.storage.blob.BlobServiceClient.delete_container name: delete_container summary: 'Marks the specified container for deletion. @@ -284,16 +252,6 @@ methods: return: types: - - examples: - - "Deleting a container in the blob service.\n\n\n\n````python\n\ - \n # Delete container if it exists\n try:\n blob_service_client.delete_container(\"\ - containerfromblobservice\")\n except ResourceNotFoundError:\n print(\"\ - Container already deleted.\")\n\n ````\n" - uid: azure.storage.blob.BlobServiceClient.find_blobs_by_tags name: find_blobs_by_tags summary: 'The Filter Blobs operation enables callers to list blobs across all @@ -371,16 +329,6 @@ methods: description: A Blob service client. types: - - examples: - - "Creating the BlobServiceClient from a connection string.\n\n\n\n````python\n\n from azure.storage.blob import BlobServiceClient\n\ - \ blob_service_client = BlobServiceClient.from_connection_string(self.connection_string)\n\ - \n ````\n" - uid: azure.storage.blob.BlobServiceClient.get_account_information name: get_account_information summary: 'Gets information related to the storage account. @@ -395,15 +343,6 @@ methods: description: A dict of account information (SKU and account type). types: - (, ) - examples: - - "Getting account information for the blob service.\n\n\n\n````python\n\n account_info = blob_service_client.get_account_information()\n\ - \ print('Using Storage SKU: {}'.format(account_info['sku_name']))\n\n ````\n" - uid: azure.storage.blob.BlobServiceClient.get_blob_client name: get_blob_client summary: 'Get a client to interact with the specified blob. @@ -444,16 +383,6 @@ methods: description: A BlobClient. types: - - examples: - - "Getting the blob client to interact with a specific blob.\n\n\n\n````python\n\n blob_client = blob_service_client.get_blob_client(container=\"\ - containertest\", blob=\"my_blob\")\n try:\n stream = blob_client.download_blob()\n\ - \ except ResourceNotFoundError:\n print(\"No blob found.\")\n\n ````\n" - uid: azure.storage.blob.BlobServiceClient.get_container_client name: get_container_client summary: 'Get a client to interact with the specified container. @@ -474,18 +403,6 @@ methods: description: A ContainerClient. types: - - examples: - - "Getting the container client to interact with a specific container.\n\n\n\n````python\n\n # Get a client to interact with a specific container\ - \ - though it may not yet exist\n container_client = blob_service_client.get_container_client(\"\ - containertest\")\n try:\n for blob in container_client.list_blobs():\n\ - \ print(\"Found blob: \", blob.name)\n except ResourceNotFoundError:\n\ - \ print(\"Container not found.\")\n\n ````\n" - uid: azure.storage.blob.BlobServiceClient.get_service_properties name: get_service_properties summary: 'Gets the properties of a storage account''s Blob service, including @@ -511,15 +428,6 @@ methods: analytics logging, hour/minute metrics, cors rules, etc.' types: - [, ] - examples: - - "Getting service properties for the blob service.\n\n\n\n````python\n\n properties = blob_service_client.get_service_properties()\n\ - \n ````\n" - uid: azure.storage.blob.BlobServiceClient.get_service_stats name: get_service_stats summary: 'Retrieves statistics related to replication for the Blob service. @@ -571,14 +479,6 @@ methods: description: The blob service stats. types: - [, ] - examples: - - "Getting service stats for the blob service.\n\n\n\n````python\n\ - \n stats = blob_service_client.get_service_stats()\n\n ````\n" - uid: azure.storage.blob.BlobServiceClient.get_user_delegation_key name: get_user_delegation_key summary: 'Obtain a user delegation key for the purpose of signing SAS tokens. @@ -675,18 +575,6 @@ methods: description: An iterable (auto-paging) of ContainerProperties. types: - [] - examples: - - "Listing the containers in the blob service.\n\n\n\n````python\n\ - \n # List all containers\n all_containers = blob_service_client.list_containers(include_metadata=True)\n\ - \ for container in all_containers:\n print(container['name'], container['metadata'])\n\ - \n # Filter results with name prefix\n test_containers = blob_service_client.list_containers(name_starts_with='test-')\n\ - \ for container in test_containers:\n print(container['name'], container['metadata'])\n\ - \n ````\n" - uid: azure.storage.blob.BlobServiceClient.set_service_properties name: set_service_properties summary: 'Sets the properties of a storage account''s Blob service, including @@ -768,23 +656,6 @@ methods: return: types: - - examples: - - "Setting service properties for the blob service.\n\n\n\n````python\n\n # Create service properties\n from azure.storage.blob\ - \ import BlobAnalyticsLogging, Metrics, CorsRule, RetentionPolicy\n\n # Create\ - \ logging settings\n logging = BlobAnalyticsLogging(read=True, write=True, delete=True,\ - \ retention_policy=RetentionPolicy(enabled=True, days=5))\n\n # Create metrics\ - \ for requests statistics\n hour_metrics = Metrics(enabled=True, include_apis=True,\ - \ retention_policy=RetentionPolicy(enabled=True, days=5))\n minute_metrics =\ - \ Metrics(enabled=True, include_apis=True,\n retention_policy=RetentionPolicy(enabled=True,\ - \ days=5))\n\n # Create CORS rules\n cors_rule = CorsRule(['www.xyz.com'],\ - \ ['GET'])\n cors = [cors_rule]\n\n # Set the service properties\n blob_service_client.set_service_properties(logging,\ - \ hour_metrics, minute_metrics, cors)\n\n ````\n" - uid: azure.storage.blob.BlobServiceClient.undelete_container name: undelete_container summary: 'Restores soft-deleted container. diff --git a/preview/docs-ref-autogen/azure-storage-blob/azure.storage.blob.ContainerClient.yml b/preview/docs-ref-autogen/azure-storage-blob/azure.storage.blob.ContainerClient.yml index 6ae4f0b25127..311faa211075 100644 --- a/preview/docs-ref-autogen/azure-storage-blob/azure.storage.blob.ContainerClient.yml +++ b/preview/docs-ref-autogen/azure-storage-blob/azure.storage.blob.ContainerClient.yml @@ -119,25 +119,6 @@ constructor: or 4MB.' types: - -examples: -- "Get a ContainerClient from an existing BlobServiceClient.\n\n\n\n````python\n\n # Instantiate a BlobServiceClient using a connection string\n\ - \ from azure.storage.blob import BlobServiceClient\n blob_service_client = BlobServiceClient.from_connection_string(self.connection_string)\n\ - \n # Instantiate a ContainerClient\n container_client = blob_service_client.get_container_client(\"\ - mynewcontainer\")\n\n ````\n\nCreating the container client directly.\n\n\n\n````python\n\n from azure.storage.blob import ContainerClient\n\n sas_url\ - \ = \"https://account.blob.core.windows.net/mycontainer?sv=2015-04-05&st=2015-04-29T22%3A18%3A26Z&se=2015-04-30T02%3A23%3A26Z&sr=b&sp=rw&sip=168.1.5.60-168.1.5.70&spr=https&sig=Z%2FRHIX5Xcg0Mq2rqI3OlWTjEg2tYkboXr1P9ZUXDtkk%3D\"\ - \n container = ContainerClient.from_container_url(sas_url)\n\n ````\n" methods: - uid: azure.storage.blob.ContainerClient.acquire_lease name: acquire_lease @@ -218,16 +199,6 @@ methods: description: A BlobLeaseClient object, that can be run in a context manager. types: - - examples: - - "Acquiring a lease on the container.\n\n\n\n````python\n\ - \n # Acquire a lease on the container\n lease = container_client.acquire_lease()\n\ - \n # Delete container by passing in the lease\n container_client.delete_container(lease=lease)\n\ - \n ````\n" - uid: azure.storage.blob.ContainerClient.create_container name: create_container summary: 'Creates a new container under the specified account. If the container @@ -275,14 +246,6 @@ methods: description: A dictionary of response headers. types: - [, [, ]] - examples: - - "Creating a container to store blobs.\n\n\n\n````python\n\ - \n container_client.create_container()\n\n ````\n" - uid: azure.storage.blob.ContainerClient.delete_blob name: delete_blob summary: 'Marks the specified blob or snapshot for deletion. @@ -521,17 +484,6 @@ methods: description: An iterator of responses, one for each blob in order types: - [] - examples: - - "Deleting multiple blobs.\n\ - \n\n\n````python\n\n # Delete multiple\ - \ blobs in the container by name\n container_client.delete_blobs(\"my_blob1\"\ - , \"my_blob2\")\n\n # Delete multiple blobs by properties iterator\n my_blobs\ - \ = container_client.list_blobs(name_starts_with=\"my_blob\")\n container_client.delete_blobs(*my_blobs)\n\ - \n ````\n" - uid: azure.storage.blob.ContainerClient.delete_container name: delete_container summary: 'Marks the specified container for deletion. The container and any blobs @@ -598,14 +550,6 @@ methods: return: types: - - examples: - - "Delete a container.\n\ - \n\n\n````python\n\ - \n container_client.delete_container()\n\n ````\n" - uid: azure.storage.blob.ContainerClient.download_blob name: download_blob summary: 'Downloads a blob to the StorageStreamDownloader. The readall() method @@ -879,16 +823,6 @@ methods: description: A container client. types: - - examples: - - "Creating the ContainerClient from a connection string.\n\n\n\n````python\n\n from azure.storage.blob import ContainerClient\n\ - \ container_client = ContainerClient.from_connection_string(\n self.connection_string,\ - \ container_name=\"mycontainer\")\n\n ````\n" - uid: azure.storage.blob.ContainerClient.from_container_url name: from_container_url summary: Create ContainerClient from a container url. @@ -974,16 +908,6 @@ methods: description: A BlobClient. types: - - examples: - - "Get the blob client.\n\ - \n\n\n````python\n\ - \n # Get the BlobClient from the ContainerClient to interact with a specific\ - \ blob\n blob_client = container_client.get_blob_client(\"mynewblob\")\n\n \ - \ ````\n" - uid: azure.storage.blob.ContainerClient.get_container_access_policy name: get_container_access_policy summary: 'Gets the permissions for the specified container. @@ -1014,14 +938,6 @@ methods: description: Access policy information in a dict. types: - [, ] - examples: - - "Getting the access policy on the container.\n\n\n\n````python\n\ - \n policy = container_client.get_container_access_policy()\n\n ````\n" - uid: azure.storage.blob.ContainerClient.get_container_properties name: get_container_properties summary: 'Returns all user-defined metadata and system properties for the specified @@ -1052,14 +968,6 @@ methods: description: Properties for the specified container within a container object. types: - - examples: - - "Getting properties on the container.\n\n\n\n````python\n\ - \n properties = container_client.get_container_properties()\n\n ````\n" - uid: azure.storage.blob.ContainerClient.list_blob_names name: list_blob_names summary: 'Returns a generator to list the names of blobs under the specified container. @@ -1144,15 +1052,6 @@ methods: description: An iterable (auto-paging) response of BlobProperties. types: - [] - examples: - - "List the blobs in the container.\n\n\n\n````python\n\ - \n blobs_list = container_client.list_blobs()\n for blob in blobs_list:\n\ - \ print(blob.name + '\\n')\n\n ````\n" - uid: azure.storage.blob.ContainerClient.set_container_access_policy name: set_container_access_policy summary: 'Sets the permissions for the specified container or stored access @@ -1228,20 +1127,6 @@ methods: types: - [, - ] - examples: - - "Setting access policy on the container.\n\n\n\n````python\n\ - \n # Create access policy\n from azure.storage.blob import AccessPolicy, ContainerSasPermissions\n\ - \ access_policy = AccessPolicy(permission=ContainerSasPermissions(read=True),\n\ - \ expiry=datetime.utcnow() + timedelta(hours=1),\n\ - \ start=datetime.utcnow() - timedelta(minutes=1))\n\ - \n identifiers = {'test': access_policy}\n\n # Set the access policy on the\ - \ container\n container_client.set_container_access_policy(signed_identifiers=identifiers)\n\ - \n ````\n" - uid: azure.storage.blob.ContainerClient.set_container_metadata name: set_container_metadata summary: 'Sets one or more user-defined name-value pairs for the specified @@ -1317,16 +1202,6 @@ methods: types: - [, - ] - examples: - - "Setting metadata on the container.\n\n\n\n````python\n\ - \n # Create key, value pairs for metadata\n metadata = {'type': 'test'}\n\n\ - \ # Set metadata on the container\n container_client.set_container_metadata(metadata=metadata)\n\ - \n ````\n" - uid: azure.storage.blob.ContainerClient.set_premium_page_blob_tier_blobs name: set_premium_page_blob_tier_blobs summary: 'Sets the page blob tiers on all blobs. This API is only supported for @@ -1725,16 +1600,6 @@ methods: description: A BlobClient to interact with the newly uploaded blob. types: - - examples: - - "Upload blob to the container.\n\n\n\n````python\n\ - \n with open(SOURCE_FILE, \"rb\") as data:\n blob_client = container_client.upload_blob(name=\"\ - myblob\", data=data)\n\n properties = blob_client.get_blob_properties()\n\n\ - \ ````\n" - uid: azure.storage.blob.ContainerClient.walk_blobs name: walk_blobs summary: 'Returns a generator to list the blobs under the specified container. diff --git a/preview/docs-ref-autogen/azure-storage-blob/azure.storage.blob.StorageStreamDownloader.yml b/preview/docs-ref-autogen/azure-storage-blob/azure.storage.blob.StorageStreamDownloader.yml index 8c1f80977f1a..6b53b20ee64c 100644 --- a/preview/docs-ref-autogen/azure-storage-blob/azure.storage.blob.StorageStreamDownloader.yml +++ b/preview/docs-ref-autogen/azure-storage-blob/azure.storage.blob.StorageStreamDownloader.yml @@ -64,19 +64,6 @@ methods: return: types: - [] - examples: - - "Download a blob using chunks().\n\n\n\n````python\n\ - \n # This returns a StorageStreamDownloader.\n stream = source_blob_client.download_blob()\n\ - \ block_list = []\n\n # Read data in chunks to avoid loading all into memory\ - \ at once\n for chunk in stream.chunks():\n # process your data (anything\ - \ can be done here really. `chunk` is a byte array).\n block_id = str(uuid.uuid4())\n\ - \ destination_blob_client.stage_block(block_id=block_id, data=chunk)\n \ - \ block_list.append(BlobBlock(block_id=block_id))\n\n\n ````\n" - uid: azure.storage.blob.StorageStreamDownloader.content_as_bytes name: content_as_bytes summary: 'DEPRECATED: Download the contents of this file. diff --git a/preview/docs-ref-autogen/azure-storage-blob/azure.storage.blob.aio.BlobClient.yml b/preview/docs-ref-autogen/azure-storage-blob/azure.storage.blob.aio.BlobClient.yml index 5ac7e978b277..613d34e98a70 100644 --- a/preview/docs-ref-autogen/azure-storage-blob/azure.storage.blob.aio.BlobClient.yml +++ b/preview/docs-ref-autogen/azure-storage-blob/azure.storage.blob.aio.BlobClient.yml @@ -124,24 +124,6 @@ constructor: or 4MB.' types: - -examples: -- "Creating the BlobClient from a URL to a public blob (no auth needed).\n\n\n\n````python\n\n from azure.storage.blob.aio import\ - \ BlobClient\n blob_client = BlobClient.from_blob_url(blob_url=\"https://account.blob.core.windows.net/container/blob-name\"\ - )\n\n ````\n\nCreating the BlobClient from a SAS URL to a blob.\n\n\n\n````python\n\n from azure.storage.blob.aio import\ - \ BlobClient\n\n sas_url = \"https://account.blob.core.windows.net/container/blob-name?sv=2015-04-05&st=2015-04-29T22%3A18%3A26Z&se=2015-04-30T02%3A23%3A26Z&sr=b&sp=rw&sip=168.1.5.60-168.1.5.70&spr=https&sig=Z%2FRHIX5Xcg0Mq2rqI3OlWTjEg2tYkboXr1P9ZUXDtkk%3D\"\ - \n blob_client = BlobClient.from_blob_url(sas_url)\n\n ````\n" methods: - uid: azure.storage.blob.aio.BlobClient.abort_copy name: abort_copy @@ -165,17 +147,6 @@ methods: return: types: - - examples: - - "Abort copying a blob from URL.\n\n\n\n````python\n\ - \n # Passing in copy id to abort copy operation\n if props.copy.status !=\ - \ \"success\":\n await copied_blob.abort_copy(copy_id)\n\n # check copy\ - \ status\n props = await copied_blob.get_blob_properties()\n print(props.copy.status)\n\ - \n ````\n" - uid: azure.storage.blob.aio.BlobClient.acquire_lease name: acquire_lease summary: 'Requests a new lease. @@ -268,17 +239,6 @@ methods: description: A BlobLeaseClient object. types: - - examples: - - "Acquiring a lease on a blob.\n\n\n\n````python\n\ - \n # Get the blob client\n blob_client = blob_service_client.get_blob_client(\"\ - leasemyblobscontainerasync\", \"my_blob\")\n\n # Acquire a lease on the blob\n\ - \ lease = await blob_client.acquire_lease()\n\n # Delete blob by passing in\ - \ the lease\n await blob_client.delete_blob(lease=lease)\n\n ````\n" - uid: azure.storage.blob.aio.BlobClient.append_block name: append_block summary: Commits a new block of data to the end of the existing append blob. @@ -1352,17 +1312,6 @@ methods: description: Blob-updated property dict (Snapshot ID, Etag, and last modified). types: - [, ] - examples: - - "Create a snapshot of the blob.\n\n\n\n````python\n\ - \n # Create a read-only snapshot of the blob at this point in time\n snapshot_blob\ - \ = await blob_client.create_snapshot()\n\n # Get the snapshot ID\n print(snapshot_blob.get('snapshot'))\n\ - \n # Delete only the snapshot (blob itself is retained)\n await blob_client.delete_blob(delete_snapshots=\"\ - only\")\n\n ````\n" - uid: azure.storage.blob.aio.BlobClient.delete_blob name: delete_blob summary: 'Marks the specified blob for deletion. @@ -1481,14 +1430,6 @@ methods: return: types: - - examples: - - "Delete a blob.\n\n\n\n````python\n\ - \n await blob_client.delete_blob()\n\n ````\n" - uid: azure.storage.blob.aio.BlobClient.delete_immutability_policy name: delete_immutability_policy summary: 'The Delete Immutability Policy operation deletes the immutability policy @@ -1678,15 +1619,6 @@ methods: description: A streaming object (StorageStreamDownloader) types: - - examples: - - "Download a blob.\n\n\n\n````python\n\ - \n with open(DEST_FILE, \"wb\") as my_blob:\n stream = await blob_client.download_blob()\n\ - \ data = await stream.readall()\n my_blob.write(data)\n\n ````\n" - uid: azure.storage.blob.aio.BlobClient.exists name: exists summary: 'Returns True if a blob exists with the defined parameters, and returns @@ -1826,14 +1758,6 @@ methods: description: BlobProperties types: - - examples: - - "Getting the properties for a blob.\n\n\n\n````python\n\ - \n properties = await blob_client.get_blob_properties()\n\n ````\n" - uid: azure.storage.blob.aio.BlobClient.get_blob_tags name: get_blob_tags summary: 'The Get Tags operation enables users to get tags on a blob or specific @@ -3545,18 +3469,6 @@ methods: description: A dictionary of copy properties (etag, last_modified, copy_id, copy_status). types: - [, [, ]] - examples: - - "Copy a blob from a URL.\n\n\n\n````python\n\ - \n # Get the blob client with the source blob\n source_blob = \"https://www.gutenberg.org/files/59466/59466-0.txt\"\ - \n copied_blob = blob_service_client.get_blob_client(\"copyblobcontainerasync\"\ - , '59466-0.txt')\n\n # start copy and check copy status\n copy = await copied_blob.start_copy_from_url(source_blob)\n\ - \ props = await copied_blob.get_blob_properties()\n print(props.copy.status)\n\ - \n ````\n" - uid: azure.storage.blob.aio.BlobClient.undelete_blob name: undelete_blob summary: 'Restores soft-deleted blobs or snapshots. @@ -3590,15 +3502,6 @@ methods: return: types: - - examples: - - "Undeleting a blob.\n\ - \n\n\n````python\n\ - \n # Undelete the blob before the retention policy expires\n await blob_client.undelete_blob()\n\ - \n ````\n" - uid: azure.storage.blob.aio.BlobClient.upload_blob name: upload_blob summary: Creates a new blob from a data source with automatic chunking. @@ -3858,15 +3761,6 @@ methods: description: Blob-updated property dict (Etag and last modified) types: - [, ] - examples: - - "Upload a blob to the container.\n\n\n\n````python\n\ - \n # Upload content to block blob\n with open(SOURCE_FILE, \"rb\") as data:\n\ - \ await blob_client.upload_blob(data, blob_type=\"BlockBlob\")\n\n ````\n" - uid: azure.storage.blob.aio.BlobClient.upload_blob_from_url name: upload_blob_from_url summary: 'Creates a new Block Blob where the content of the blob is read from a diff --git a/preview/docs-ref-autogen/azure-storage-blob/azure.storage.blob.aio.BlobServiceClient.yml b/preview/docs-ref-autogen/azure-storage-blob/azure.storage.blob.aio.BlobServiceClient.yml index 0a32201157ba..918bfcdf14a3 100644 --- a/preview/docs-ref-autogen/azure-storage-blob/azure.storage.blob.aio.BlobServiceClient.yml +++ b/preview/docs-ref-autogen/azure-storage-blob/azure.storage.blob.aio.BlobServiceClient.yml @@ -113,28 +113,6 @@ constructor: or 4MB.' types: - -examples: -- "Creating the BlobServiceClient with account url and credential.\n\n\n\n````python\n\n from azure.storage.blob.aio import\ - \ BlobServiceClient\n blob_service_client = BlobServiceClient(account_url=self.url,\ - \ credential=self.shared_access_key)\n\n ````\n\nCreating the BlobServiceClient\ - \ with Azure Identity credentials.\n\n\n\n````python\n\n # Get a token\ - \ credential for authentication\n from azure.identity.aio import ClientSecretCredential\n\ - \ token_credential = ClientSecretCredential(\n self.active_directory_tenant_id,\n\ - \ self.active_directory_application_id,\n self.active_directory_application_secret\n\ - \ )\n\n # Instantiate a BlobServiceClient using a token credential\n from\ - \ azure.storage.blob.aio import BlobServiceClient\n blob_service_client = BlobServiceClient(account_url=self.oauth_url,\ - \ credential=token_credential)\n\n ````\n" methods: - uid: azure.storage.blob.aio.BlobServiceClient.create_container name: create_container @@ -193,17 +171,6 @@ methods: return: types: - - examples: - - "Creating a container in the blob service.\n\n\n\n````python\n\ - \n try:\n new_container = await blob_service_client.create_container(\"\ - containerfromblobserviceasync\")\n properties = await new_container.get_container_properties()\n\ - \ except ResourceExistsError:\n print(\"Container already exists.\")\n\ - \n ````\n" - uid: azure.storage.blob.aio.BlobServiceClient.delete_container name: delete_container summary: 'Marks the specified container for deletion. @@ -281,16 +248,6 @@ methods: return: types: - - examples: - - "Deleting a container in the blob service.\n\n\n\n````python\n\ - \n # Delete container if it exists\n try:\n await blob_service_client.delete_container(\"\ - containerfromblobserviceasync\")\n except ResourceNotFoundError:\n print(\"\ - Container already deleted.\")\n\n ````\n" - uid: azure.storage.blob.aio.BlobServiceClient.find_blobs_by_tags name: find_blobs_by_tags summary: 'The Filter Blobs operation enables callers to list blobs across all @@ -345,15 +302,6 @@ methods: description: A dict of account information (SKU and account type). types: - (, ) - examples: - - "Getting account information for the blob service.\n\n\n\n````python\n\n account_info = await blob_service_client.get_account_information()\n\ - \ print('Using Storage SKU: {}'.format(account_info['sku_name']))\n\n ````\n" - uid: azure.storage.blob.aio.BlobServiceClient.get_blob_client name: get_blob_client summary: 'Get a client to interact with the specified blob. @@ -396,16 +344,6 @@ methods: description: A BlobClient. types: - - examples: - - "Getting the blob client to interact with a specific blob.\n\n\n\n````python\n\n blob_client = blob_service_client.get_blob_client(container=\"\ - containertestasync\", blob=\"my_blob\")\n try:\n stream = await blob_client.download_blob()\n\ - \ except ResourceNotFoundError:\n print(\"No blob found.\")\n\n ````\n" - uid: azure.storage.blob.aio.BlobServiceClient.get_container_client name: get_container_client summary: 'Get a client to interact with the specified container. @@ -426,20 +364,6 @@ methods: description: A ContainerClient. types: - - examples: - - "Getting the container client to interact with a specific container.\n\n\n\n````python\n\n # Get a client to interact with a specific container\ - \ - though it may not yet exist\n container_client = blob_service_client.get_container_client(\"\ - containertestasync\")\n try:\n blobs_list = []\n async for blob\ - \ in container_client.list_blobs():\n blobs_list.append(blob)\n\n \ - \ for blob in blobs_list:\n print(\"Found blob: \", blob.name)\n\ - \ except ResourceNotFoundError:\n print(\"Container not found.\")\n\n\ - \ ````\n" - uid: azure.storage.blob.aio.BlobServiceClient.get_service_properties name: get_service_properties summary: 'Gets the properties of a storage account''s Blob service, including @@ -465,15 +389,6 @@ methods: analytics logging, hour/minute metrics, cors rules, etc.' types: - [, ] - examples: - - "Getting service properties for the blob service.\n\n\n\n````python\n\n properties = await blob_service_client.get_service_properties()\n\ - \n ````\n" - uid: azure.storage.blob.aio.BlobServiceClient.get_service_stats name: get_service_stats summary: 'Retrieves statistics related to replication for the Blob service. @@ -525,14 +440,6 @@ methods: description: The blob service stats. types: - [, ] - examples: - - "Getting service stats for the blob service.\n\n\n\n````python\n\ - \n stats = await blob_service_client.get_service_stats()\n\n ````\n" - uid: azure.storage.blob.aio.BlobServiceClient.get_user_delegation_key name: get_user_delegation_key summary: 'Obtain a user delegation key for the purpose of signing SAS tokens. @@ -629,20 +536,6 @@ methods: description: An iterable (auto-paging) of ContainerProperties. types: - [] - examples: - - "Listing the containers in the blob service.\n\n\n\n````python\n\ - \n # List all containers\n all_containers = []\n async for container in\ - \ blob_service_client.list_containers(include_metadata=True):\n all_containers.append(container)\n\ - \n for container in all_containers:\n print(container['name'], container['metadata'])\n\ - \n # Filter results with name prefix\n test_containers = []\n async for\ - \ name in blob_service_client.list_containers(name_starts_with='test-'):\n \ - \ test_containers.append(name)\n\n for container in test_containers:\n \ - \ print(container['name'], container['metadata'])\n\n ````\n" - uid: azure.storage.blob.aio.BlobServiceClient.set_service_properties name: set_service_properties summary: 'Sets the properties of a storage account''s Blob service, including @@ -724,24 +617,6 @@ methods: return: types: - - examples: - - "Setting service properties for the blob service.\n\n\n\n````python\n\n # Create service properties\n from azure.storage.blob\ - \ import BlobAnalyticsLogging, Metrics, CorsRule, RetentionPolicy\n\n # Create\ - \ logging settings\n logging = BlobAnalyticsLogging(read=True, write=True, delete=True,\ - \ retention_policy=RetentionPolicy(enabled=True, days=5))\n\n # Create metrics\ - \ for requests statistics\n hour_metrics = Metrics(enabled=True, include_apis=True,\ - \ retention_policy=RetentionPolicy(enabled=True, days=5))\n minute_metrics =\ - \ Metrics(enabled=True, include_apis=True,\n retention_policy=RetentionPolicy(enabled=True,\ - \ days=5))\n\n # Create CORS rules\n cors_rule = CorsRule(['www.xyz.com'],\ - \ ['GET'])\n cors = [cors_rule]\n\n # Set the service properties\n await\ - \ blob_service_client.set_service_properties(logging, hour_metrics, minute_metrics,\ - \ cors)\n\n ````\n" - uid: azure.storage.blob.aio.BlobServiceClient.undelete_container name: undelete_container summary: 'Restores soft-deleted container. diff --git a/preview/docs-ref-autogen/azure-storage-blob/azure.storage.blob.aio.ContainerClient.yml b/preview/docs-ref-autogen/azure-storage-blob/azure.storage.blob.aio.ContainerClient.yml index 979c599ef538..059d307b4eb9 100644 --- a/preview/docs-ref-autogen/azure-storage-blob/azure.storage.blob.aio.ContainerClient.yml +++ b/preview/docs-ref-autogen/azure-storage-blob/azure.storage.blob.aio.ContainerClient.yml @@ -116,26 +116,6 @@ constructor: or 4MB.' types: - -examples: -- "Get a ContainerClient from an existing BlobServiceClient.\n\n\n\n````python\n\n # Instantiate a BlobServiceClient using a connection\ - \ string\n from azure.storage.blob.aio import BlobServiceClient\n blob_service_client\ - \ = BlobServiceClient.from_connection_string(self.connection_string)\n\n # Instantiate\ - \ a ContainerClient\n container_client = blob_service_client.get_container_client(\"\ - mynewcontainerasync\")\n\n ````\n\nCreating the container client directly.\n\n\n\n````python\n\n from azure.storage.blob.aio import ContainerClient\n\ - \n sas_url = sas_url = \"https://account.blob.core.windows.net/mycontainer?sv=2015-04-05&st=2015-04-29T22%3A18%3A26Z&se=2015-04-30T02%3A23%3A26Z&sr=b&sp=rw&sip=168.1.5.60-168.1.5.70&spr=https&sig=Z%2FRHIX5Xcg0Mq2rqI3OlWTjEg2tYkboXr1P9ZUXDtkk%3D\"\ - \n container = ContainerClient.from_container_url(sas_url)\n\n ````\n" methods: - uid: azure.storage.blob.aio.ContainerClient.acquire_lease name: acquire_lease @@ -216,16 +196,6 @@ methods: description: A BlobLeaseClient object, that can be run in a context manager. types: - - examples: - - "Acquiring a lease on the container.\n\n\n\n````python\n\ - \n # Acquire a lease on the container\n lease = await container_client.acquire_lease()\n\ - \n # Delete container by passing in the lease\n await container_client.delete_container(lease=lease)\n\ - \n ````\n" - uid: azure.storage.blob.aio.ContainerClient.create_container name: create_container summary: 'Creates a new container under the specified account. If the container @@ -273,14 +243,6 @@ methods: description: A dictionary of response headers. types: - [, [, ]] - examples: - - "Creating a container to store blobs.\n\n\n\n````python\n\ - \n await container_client.create_container()\n\n ````\n" - uid: azure.storage.blob.aio.ContainerClient.delete_blob name: delete_blob summary: 'Marks the specified blob or snapshot for deletion. @@ -519,18 +481,6 @@ methods: description: An async iterator of responses, one for each blob in order types: - [] - examples: - - "Deleting multiple blobs.\n\n\n\n````python\n\ - \n # Delete multiple blobs in the container by name\n await container_client.delete_blobs(\"\ - my_blob1\", \"my_blob2\")\n\n # Delete multiple blobs by properties iterator\n\ - \ my_blobs = container_client.list_blobs(name_starts_with=\"my_blob\")\n await\ - \ container_client.delete_blobs(*[b async for b in my_blobs]) # async for in\ - \ list comprehension after 3.6 only\n\n ````\n" - uid: azure.storage.blob.aio.ContainerClient.delete_container name: delete_container summary: 'Marks the specified container for deletion. The container and any blobs @@ -597,14 +547,6 @@ methods: return: types: - - examples: - - "Delete a container.\n\n\n\n````python\n\ - \n await container_client.delete_container()\n\n ````\n" - uid: azure.storage.blob.aio.ContainerClient.download_blob name: download_blob summary: 'Downloads a blob to the StorageStreamDownloader. The readall() method @@ -877,16 +819,6 @@ methods: description: A BlobClient. types: - - examples: - - "Get the blob client.\n\n\n\n````python\n\ - \n # Get the BlobClient from the ContainerClient to interact with a specific\ - \ blob\n blob_client = container_client.get_blob_client(\"mynewblob\")\n\n \ - \ ````\n" - uid: azure.storage.blob.aio.ContainerClient.get_container_access_policy name: get_container_access_policy summary: 'Gets the permissions for the specified container. @@ -917,14 +849,6 @@ methods: description: Access policy information in a dict. types: - [, ] - examples: - - "Getting the access policy on the container.\n\n\n\n````python\n\ - \n policy = await container_client.get_container_access_policy()\n\n ````\n" - uid: azure.storage.blob.aio.ContainerClient.get_container_properties name: get_container_properties summary: 'Returns all user-defined metadata and system properties for the specified @@ -955,14 +879,6 @@ methods: description: Properties for the specified container within a container object. types: - - examples: - - "Getting properties on the container.\n\n\n\n````python\n\ - \n properties = await container_client.get_container_properties()\n\n ````\n" - uid: azure.storage.blob.aio.ContainerClient.list_blob_names name: list_blob_names summary: 'Returns a generator to list the names of blobs under the specified container. @@ -1047,15 +963,6 @@ methods: description: An iterable (auto-paging) response of BlobProperties. types: - [] - examples: - - "List the blobs in the container.\n\n\n\n````python\n\ - \n blobs_list = []\n async for blob in container_client.list_blobs():\n \ - \ blobs_list.append(blob)\n\n ````\n" - uid: azure.storage.blob.aio.ContainerClient.set_container_access_policy name: set_container_access_policy summary: 'Sets the permissions for the specified container or stored access @@ -1131,20 +1038,6 @@ methods: types: - [, - ] - examples: - - "Setting access policy on the container.\n\n\n\n````python\n\ - \n # Create access policy\n from azure.storage.blob import AccessPolicy, ContainerSasPermissions\n\ - \ access_policy = AccessPolicy(permission=ContainerSasPermissions(read=True),\n\ - \ expiry=datetime.utcnow() + timedelta(hours=1),\n\ - \ start=datetime.utcnow() - timedelta(minutes=1))\n\ - \n identifiers = {'my-access-policy-id': access_policy}\n\n # Set the access\ - \ policy on the container\n await container_client.set_container_access_policy(signed_identifiers=identifiers)\n\ - \n ````\n" - uid: azure.storage.blob.aio.ContainerClient.set_container_metadata name: set_container_metadata summary: 'Sets one or more user-defined name-value pairs for the specified @@ -1198,16 +1091,6 @@ methods: - return: description: Container-updated property dict (Etag and last modified). - examples: - - "Setting metadata on the container.\n\n\n\n````python\n\ - \n # Create key, value pairs for metadata\n metadata = {'type': 'test'}\n\n\ - \ # Set metadata on the container\n await container_client.set_container_metadata(metadata=metadata)\n\ - \n ````\n" - uid: azure.storage.blob.aio.ContainerClient.set_premium_page_blob_tier_blobs name: set_premium_page_blob_tier_blobs summary: 'Sets the page blob tiers on the blobs. This API is only supported for @@ -1613,16 +1496,6 @@ methods: description: A BlobClient to interact with the newly uploaded blob. types: - - examples: - - "Upload blob to the container.\n\n\n\n````python\n\ - \n with open(SOURCE_FILE, \"rb\") as data:\n blob_client = await container_client.upload_blob(name=\"\ - myblob\", data=data)\n\n properties = await blob_client.get_blob_properties()\n\ - \n ````\n" - uid: azure.storage.blob.aio.ContainerClient.walk_blobs name: walk_blobs summary: 'Returns a generator to list the blobs under the specified container. diff --git a/preview/docs-ref-autogen/azure-storage-blob/azure.storage.blob.aio.StorageStreamDownloader.yml b/preview/docs-ref-autogen/azure-storage-blob/azure.storage.blob.aio.StorageStreamDownloader.yml index 14c939a26922..d0b4a6f6ebdc 100644 --- a/preview/docs-ref-autogen/azure-storage-blob/azure.storage.blob.aio.StorageStreamDownloader.yml +++ b/preview/docs-ref-autogen/azure-storage-blob/azure.storage.blob.aio.StorageStreamDownloader.yml @@ -64,19 +64,6 @@ methods: return: types: - [] - examples: - - "Download a blob using chunks().\n\n\n\n````python\n\ - \n # This returns a StorageStreamDownloader.\n stream = await source_blob_client.download_blob()\n\ - \ block_list = []\n\n # Read data in chunks to avoid loading all into memory\ - \ at once\n async for chunk in stream.chunks():\n # process your data\ - \ (anything can be done here really. `chunk` is a byte array).\n block_id\ - \ = str(uuid.uuid4())\n await destination_blob_client.stage_block(block_id=block_id,\ - \ data=chunk)\n block_list.append(BlobBlock(block_id=block_id))\n\n ````\n" - uid: azure.storage.blob.aio.StorageStreamDownloader.content_as_bytes name: content_as_bytes summary: 'DEPRECATED: Download the contents of this file. diff --git a/preview/docs-ref-autogen/azure-storage-blob/azure.storage.blob.yml b/preview/docs-ref-autogen/azure-storage-blob/azure.storage.blob.yml index 55d6a874e9ca..fddd6fec444d 100644 --- a/preview/docs-ref-autogen/azure-storage-blob/azure.storage.blob.yml +++ b/preview/docs-ref-autogen/azure-storage-blob/azure.storage.blob.yml @@ -202,19 +202,6 @@ functions: description: A Shared Access Signature (sas) token. types: - - examples: - - "Generating a shared access signature.\n\n\n\n````python\n\ - \n # Create a SAS token to use to authenticate a new client\n from datetime\ - \ import datetime, timedelta\n from azure.storage.blob import ResourceTypes,\ - \ AccountSasPermissions, generate_account_sas\n\n sas_token = generate_account_sas(\n\ - \ blob_service_client.account_name,\n account_key=blob_service_client.credential.account_key,\n\ - \ resource_types=ResourceTypes(object=True),\n permission=AccountSasPermissions(read=True),\n\ - \ expiry=datetime.utcnow() + timedelta(hours=1)\n )\n\n ````\n" - uid: azure.storage.blob.generate_blob_sas name: generate_blob_sas summary: 'Generates a shared access signature for a blob. @@ -575,17 +562,6 @@ functions: description: A Shared Access Signature (sas) token. types: - - examples: - - "Generating a sas token.\n\n\n\n````python\n\ - \n # Use access policy to generate a sas token\n from azure.storage.blob import\ - \ generate_container_sas\n\n sas_token = generate_container_sas(\n container_client.account_name,\n\ - \ container_client.container_name,\n account_key=container_client.credential.account_key,\n\ - \ policy_id='my-access-policy-id'\n )\n\n ````\n" - uid: azure.storage.blob.upload_blob_to_url name: upload_blob_to_url summary: 'Upload data to a given URL diff --git a/preview/docs-ref-autogen/azure-storage-file-datalake/azure.storage.filedatalake.DataLakeDirectoryClient.yml b/preview/docs-ref-autogen/azure-storage-file-datalake/azure.storage.filedatalake.DataLakeDirectoryClient.yml index 264962916cdb..fa5ed657f473 100644 --- a/preview/docs-ref-autogen/azure-storage-file-datalake/azure.storage.filedatalake.DataLakeDirectoryClient.yml +++ b/preview/docs-ref-autogen/azure-storage-file-datalake/azure.storage.filedatalake.DataLakeDirectoryClient.yml @@ -78,16 +78,6 @@ variables: name: primary_hostname types: - -examples: -- "Creating the DataLakeServiceClient from connection string.\n\n\n\n````python\n\n from azure.storage.filedatalake\ - \ import DataLakeDirectoryClient\n DataLakeDirectoryClient.from_connection_string(connection_string,\ - \ \"myfilesystem\", \"mydirectory\")\n\n ````\n" methods: - uid: azure.storage.filedatalake.DataLakeDirectoryClient.create_directory name: create_directory @@ -240,14 +230,6 @@ methods: description: A dictionary of response headers. types: - [, [, ]] - examples: - - "Create directory.\n\ - \n\n\n````python\n\ - \n directory_client.create_directory()\n\n ````\n" - uid: azure.storage.filedatalake.DataLakeDirectoryClient.create_file name: create_file summary: Create a new file and return the file client to be interacted with. @@ -638,14 +620,6 @@ methods: - return: description: None - examples: - - "Delete directory.\n\ - \n\n\n````python\n\ - \n new_directory.delete_directory()\n\n ````\n" - uid: azure.storage.filedatalake.DataLakeDirectoryClient.delete_sub_directory name: delete_sub_directory summary: Marks the specified subdirectory for deletion. @@ -858,14 +832,6 @@ methods: return: types: - - examples: - - "Getting the properties for a file/directory.\n\n\n\n````python\n\ - \n props = new_directory.get_directory_properties()\n\n ````\n" - uid: azure.storage.filedatalake.DataLakeDirectoryClient.get_file_client name: get_file_client summary: 'Get a client to interact with the specified file. @@ -1023,14 +989,3 @@ methods: - return: description: DataLakeDirectoryClient - examples: - - "Rename the source directory.\n\n\n\n````python\n\ - \n new_dir_name = \"testdir2\"\n print(\"Renaming the directory named '{}'\ - \ to '{}'.\".format(dir_name, new_dir_name))\n new_directory = directory_client\\\ - \n .rename_directory(new_name=directory_client.file_system_name + '/' +\ - \ new_dir_name)\n\n ````\n" diff --git a/preview/docs-ref-autogen/azure-storage-file-datalake/azure.storage.filedatalake.DataLakeFileClient.yml b/preview/docs-ref-autogen/azure-storage-file-datalake/azure.storage.filedatalake.DataLakeFileClient.yml index d8fe4e9f087a..b48a9839724a 100644 --- a/preview/docs-ref-autogen/azure-storage-file-datalake/azure.storage.filedatalake.DataLakeFileClient.yml +++ b/preview/docs-ref-autogen/azure-storage-file-datalake/azure.storage.filedatalake.DataLakeFileClient.yml @@ -72,16 +72,6 @@ variables: name: primary_hostname types: - -examples: -- "Creating the DataLakeServiceClient from connection string.\n\n\n\n````python\n\n from azure.storage.filedatalake\ - \ import DataLakeFileClient\n DataLakeFileClient.from_connection_string(connection_string,\ - \ \"myfilesystem\", \"mydirectory\", \"myfile\")\n\n ````\n" methods: - uid: azure.storage.filedatalake.DataLakeFileClient.append_data name: append_data @@ -164,15 +154,6 @@ methods: - return: description: dict of the response header - examples: - - "Append data to the file.\n\n\n\n````python\n\ - \n file_client.append_data(data=file_content[2048:3072], offset=2048, length=1024)\n\ - \n ````\n" - uid: azure.storage.filedatalake.DataLakeFileClient.create_file name: create_file summary: Create a new file. @@ -342,15 +323,6 @@ methods: - return: description: response dict (Etag and last modified). - examples: - - "Create file.\n\n\n\n````python\n\ - \n file_client = filesystem_client.get_file_client(file_name)\n file_client.create_file()\n\ - \n ````\n" - uid: azure.storage.filedatalake.DataLakeFileClient.delete_file name: delete_file summary: Marks the specified file for deletion. @@ -413,14 +385,6 @@ methods: - return: description: None - examples: - - "Delete file.\n\n\n\n````python\n\ - \n new_client.delete_file()\n\n ````\n" - uid: azure.storage.filedatalake.DataLakeFileClient.download_file name: download_file summary: 'Downloads a file to the StorageStreamDownloader. The readall() method @@ -521,15 +485,6 @@ methods: description: A streaming object (StorageStreamDownloader) types: - - examples: - - "Return the downloaded data.\n\n\n\n````python\n\ - \n download = file_client.download_file()\n downloaded_bytes = download.readall()\n\ - \n ````\n" - uid: azure.storage.filedatalake.DataLakeFileClient.exists name: exists summary: Returns True if a file exists and returns False otherwise. @@ -693,16 +648,6 @@ methods: - return: description: response header in dict - examples: - - "Commit the previous appended data.\n\n\n\n````python\n\ - \n with open(SOURCE_FILE, \"rb\") as data:\n file_client = file_system_client.get_file_client(\"\ - myfile\")\n file_client.create_file()\n file_client.append_data(data,\ - \ 0)\n file_client.flush_data(data.tell())\n\n ````\n" - uid: azure.storage.filedatalake.DataLakeFileClient.from_connection_string name: from_connection_string summary: 'Create DataLakeFileClient from a Connection String. @@ -829,14 +774,6 @@ methods: return: types: - - examples: - - "Getting the properties for a file.\n\n\n\n````python\n\ - \n properties = file_client.get_file_properties()\n\n ````\n" - uid: azure.storage.filedatalake.DataLakeFileClient.query_file name: query_file summary: 'Enables users to select/project on datalake file data by providing simple @@ -960,21 +897,6 @@ methods: description: A streaming object (DataLakeFileQueryReader) types: - - examples: - - "select/project on datalake file data by providing simple query expressions.\n\n\n\n````python\n\n errors = []\n def on_error(error):\n\ - \ errors.append(error)\n\n # upload the csv file\n file_client = datalake_service_client.get_file_client(filesystem_name,\ - \ \"csvfile\")\n file_client.upload_data(CSV_DATA, overwrite=True)\n\n # select\ - \ the second column of the csv file\n query_expression = \"SELECT _2 from DataLakeStorage\"\ - \n input_format = DelimitedTextDialect(delimiter=',', quotechar='\"', lineterminator='\\\ - n', escapechar=\"\", has_header=False)\n output_format = DelimitedJsonDialect(delimiter='\\\ - n')\n reader = file_client.query_file(query_expression, on_error=on_error, file_format=input_format,\ - \ output_format=output_format)\n content = reader.readall()\n\n ````\n" - uid: azure.storage.filedatalake.DataLakeFileClient.rename_file name: rename_file summary: Rename the source file. @@ -1091,15 +1013,6 @@ methods: description: the renamed file client types: - - examples: - - "Rename the source file.\n\n\n\n````python\n\ - \n new_client = file_client.rename_file(file_client.file_system_name + '/' +\ - \ 'newname')\n\n ````\n" - uid: azure.storage.filedatalake.DataLakeFileClient.set_file_expiry name: set_file_expiry summary: Sets the time a file will expire and be deleted. diff --git a/preview/docs-ref-autogen/azure-storage-file-datalake/azure.storage.filedatalake.DataLakeServiceClient.yml b/preview/docs-ref-autogen/azure-storage-file-datalake/azure.storage.filedatalake.DataLakeServiceClient.yml index 6ed192a84386..2f130cde4245 100644 --- a/preview/docs-ref-autogen/azure-storage-file-datalake/azure.storage.filedatalake.DataLakeServiceClient.yml +++ b/preview/docs-ref-autogen/azure-storage-file-datalake/azure.storage.filedatalake.DataLakeServiceClient.yml @@ -74,27 +74,6 @@ variables: name: primary_hostname types: - -examples: -- "Creating the DataLakeServiceClient from connection string.\n\n\n\n````python\n\n from azure.storage.filedatalake import\ - \ DataLakeServiceClient\n datalake_service_client = DataLakeServiceClient.from_connection_string(self.connection_string)\n\ - \n ````\n\nCreating the DataLakeServiceClient with Azure Identity credentials.\n\n\n\n````python\n\n from azure.identity import ClientSecretCredential\n\ - \ token_credential = ClientSecretCredential(\n self.active_directory_tenant_id,\n\ - \ self.active_directory_application_id,\n self.active_directory_application_secret,\n\ - \ )\n datalake_service_client = DataLakeServiceClient(\"https://{}.dfs.core.windows.net\"\ - .format(self.account_name),\n \ - \ credential=token_credential)\n\n ````\n" methods: - uid: azure.storage.filedatalake.DataLakeServiceClient.close name: close @@ -159,15 +138,6 @@ methods: return: types: - - examples: - - "Creating a file system in the datalake service.\n\n\n\n````python\n\n datalake_service_client.create_file_system(\"\ - filesystem\")\n\n ````\n" - uid: azure.storage.filedatalake.DataLakeServiceClient.delete_file_system name: delete_file_system summary: 'Marks the specified file system for deletion. @@ -248,15 +218,6 @@ methods: return: types: - - examples: - - "Deleting a file system in the datalake service.\n\n\n\n````python\n\n datalake_service_client.delete_file_system(\"\ - filesystem\")\n\n ````\n" - uid: azure.storage.filedatalake.DataLakeServiceClient.from_connection_string name: from_connection_string summary: 'Create DataLakeServiceClient from a Connection String. @@ -290,16 +251,6 @@ methods: Credentials provided here will take precedence over those in the connection string.' defaultValue: None - examples: - - "Creating the DataLakeServiceClient from a connection string.\n\n\n\n````python\n\n from azure.storage.filedatalake\ - \ import DataLakeServiceClient\n datalake_service_client = DataLakeServiceClient.from_connection_string(self.connection_string)\n\ - \n ````\n" - uid: azure.storage.filedatalake.DataLakeServiceClient.get_directory_client name: get_directory_client summary: 'Get a client to interact with the specified directory. @@ -331,16 +282,6 @@ methods: description: A DataLakeDirectoryClient. types: - - examples: - - "Getting the directory client to interact with a specific directory.\n\n\n\n````python\n\n directory_client = datalake_service_client.get_directory_client(file_system_client.file_system_name,\n\ - \ \"mydirectory\"\ - )\n\n ````\n" - uid: azure.storage.filedatalake.DataLakeServiceClient.get_file_client name: get_file_client summary: 'Get a client to interact with the specified file. @@ -372,15 +313,6 @@ methods: description: A DataLakeFileClient. types: - - examples: - - "Getting the file client to interact with a specific file.\n\n\n\n````python\n\n file_client = datalake_service_client.get_file_client(file_system_client.file_system_name,\ - \ \"myfile\")\n\n ````\n" - uid: azure.storage.filedatalake.DataLakeServiceClient.get_file_system_client name: get_file_system_client summary: 'Get a client to interact with the specified file system. @@ -401,18 +333,6 @@ methods: description: A FileSystemClient. types: - - examples: - - "Getting the file system client to interact with a specific file system.\n\n\n\n````python\n\n # Instantiate a DataLakeServiceClient\ - \ using a connection string\n from azure.storage.filedatalake import DataLakeServiceClient\n\ - \ datalake_service_client = DataLakeServiceClient.from_connection_string(self.connection_string)\n\ - \n # Instantiate a FileSystemClient\n file_system_client = datalake_service_client.get_file_system_client(\"\ - mynewfilesystem\")\n\n ````\n" - uid: azure.storage.filedatalake.DataLakeServiceClient.get_service_properties name: get_service_properties summary: 'Gets the properties of a storage account''s datalake service, including @@ -475,17 +395,6 @@ methods: description: The user delegation key. types: - - examples: - - "Get user delegation key from datalake service client.\n\n\n\n````python\n\n from datetime import datetime, timedelta\n\ - \ user_delegation_key = datalake_service_client.get_user_delegation_key(datetime.utcnow(),\n\ - \ datetime.utcnow()\ - \ + timedelta(hours=1))\n\n ````\n" - uid: azure.storage.filedatalake.DataLakeServiceClient.list_file_systems name: list_file_systems summary: 'Returns a generator to list the file systems under the specified account. @@ -549,15 +458,6 @@ methods: description: An iterable (auto-paging) of FileSystemProperties. types: - [] - examples: - - "Listing the file systems in the datalake service.\n\n\n\n````python\n\n file_systems = datalake_service_client.list_file_systems()\n\ - \ for file_system in file_systems:\n print(file_system.name)\n\n ````\n" - uid: azure.storage.filedatalake.DataLakeServiceClient.set_service_properties name: set_service_properties summary: 'Sets the properties of a storage account''s Datalake service, including diff --git a/preview/docs-ref-autogen/azure-storage-file-datalake/azure.storage.filedatalake.FileSystemClient.yml b/preview/docs-ref-autogen/azure-storage-file-datalake/azure.storage.filedatalake.FileSystemClient.yml index cd3ccc7bb2e4..4a9f515714ae 100644 --- a/preview/docs-ref-autogen/azure-storage-file-datalake/azure.storage.filedatalake.FileSystemClient.yml +++ b/preview/docs-ref-autogen/azure-storage-file-datalake/azure.storage.filedatalake.FileSystemClient.yml @@ -73,18 +73,6 @@ variables: name: primary_hostname types: - -examples: -- "Get a FileSystemClient from an existing DataLakeServiceClient.\n\n\n\n````python\n\n # Instantiate a DataLakeServiceClient\ - \ using a connection string\n from azure.storage.filedatalake import DataLakeServiceClient\n\ - \ datalake_service_client = DataLakeServiceClient.from_connection_string(self.connection_string)\n\ - \n # Instantiate a FileSystemClient\n file_system_client = datalake_service_client.get_file_system_client(\"\ - mynewfilesystem\")\n\n ````\n" methods: - uid: azure.storage.filedatalake.FileSystemClient.acquire_lease name: acquire_lease @@ -166,16 +154,6 @@ methods: description: A DataLakeLeaseClient object, that can be run in a context manager. types: - - examples: - - "Acquiring a lease on the file system.\n\n\n\n````python\n\ - \n # Acquire a lease on the file system\n lease = file_system_client.acquire_lease()\n\ - \n # Delete file system by passing in the lease\n file_system_client.delete_file_system(lease=lease)\n\ - \n ````\n" - uid: azure.storage.filedatalake.FileSystemClient.close name: close summary: 'This method is to close the sockets opened by the client. @@ -334,15 +312,6 @@ methods: - return: description: DataLakeDirectoryClient - examples: - - "Create directory in the file system.\n\n\n\n````python\n\ - \n directory_client = file_system_client.create_directory(\"mydirectory\")\n\ - \n ````\n" - uid: azure.storage.filedatalake.FileSystemClient.create_file name: create_file summary: Create file @@ -510,14 +479,6 @@ methods: - return: description: DataLakeFileClient - examples: - - "Create file in the file system.\n\n\n\n````python\n\ - \n file_client = file_system_client.create_file(\"myfile\")\n\n ````\n" - uid: azure.storage.filedatalake.FileSystemClient.create_file_system name: create_file_system summary: 'Creates a new file system under the specified account. @@ -571,15 +532,6 @@ methods: description: A dictionary of response headers. types: - [, [, ]] - examples: - - "Creating a file system in the datalake service.\n\n\n\n````python\n\n file_system_client.create_file_system()\n\ - \n ````\n" - uid: azure.storage.filedatalake.FileSystemClient.delete_directory name: delete_directory summary: Marks the specified path for deletion. @@ -652,14 +604,6 @@ methods: - return: description: DataLakeDirectoryClient - examples: - - "Delete directory in the file system.\n\n\n\n````python\n\ - \n file_system_client.delete_directory(\"mydirectory\")\n\n ````\n" - uid: azure.storage.filedatalake.FileSystemClient.delete_file name: delete_file summary: Marks the specified file for deletion. @@ -731,14 +675,6 @@ methods: - return: description: DataLakeFileClient - examples: - - "Delete file in the file system.\n\n\n\n````python\n\ - \n file_system_client.delete_file(\"myfile\")\n\n ````\n" - uid: azure.storage.filedatalake.FileSystemClient.delete_file_system name: delete_file_system summary: 'Marks the specified file system for deletion. @@ -809,15 +745,6 @@ methods: return: types: - - examples: - - "Deleting a file system in the datalake service.\n\n\n\n````python\n\n file_system_client.delete_file_system()\n\ - \n ````\n" - uid: azure.storage.filedatalake.FileSystemClient.exists name: exists summary: Returns True if a file system exists and returns False otherwise. @@ -880,16 +807,6 @@ methods: should be the storage account key.' defaultValue: None - examples: - - "Create FileSystemClient from connection string\n\n\n\n````python\n\ - \n from azure.storage.filedatalake import FileSystemClient\n file_system_client\ - \ = FileSystemClient.from_connection_string(self.connection_string, \"filesystem\"\ - )\n\n ````\n" - uid: azure.storage.filedatalake.FileSystemClient.get_directory_client name: get_directory_client summary: 'Get a client to interact with the specified directory. @@ -911,16 +828,6 @@ methods: description: A DataLakeDirectoryClient. types: - - examples: - - "Getting the directory client to interact with a specific directory.\n\n\n\n````python\n\n # Get the DataLakeDirectoryClient\ - \ from the FileSystemClient to interact with a specific file\n directory_client\ - \ = file_system_client.get_directory_client(\"mynewdirectory\")\n\n ````\n" - uid: azure.storage.filedatalake.FileSystemClient.get_file_client name: get_file_client summary: 'Get a client to interact with the specified file. @@ -942,16 +849,6 @@ methods: description: A DataLakeFileClient. types: - - examples: - - "Getting the file client to interact with a specific file.\n\n\n\n````python\n\n # Get the FileClient from the\ - \ FileSystemClient to interact with a specific file\n file_client = file_system_client.get_file_client(\"\ - mynewfile\")\n\n ````\n" - uid: azure.storage.filedatalake.FileSystemClient.get_file_system_access_policy name: get_file_system_access_policy summary: 'Gets the permissions for the specified file system. @@ -1012,14 +909,6 @@ methods: description: Properties for the specified file system within a file system object. types: - - examples: - - "Getting properties on the file system.\n\n\n\n````python\n\ - \n properties = file_system_client.get_file_system_properties()\n\n ````\n" - uid: azure.storage.filedatalake.FileSystemClient.get_paths name: get_paths summary: 'Returns a generator to list the paths(could be files or directories) under @@ -1079,15 +968,6 @@ methods: description: An iterable (auto-paging) response of PathProperties. types: - [] - examples: - - "List the paths in the file system.\n\n\n\n````python\n\ - \n path_list = file_system_client.get_paths()\n for path in path_list:\n \ - \ print(path.name + '\\n')\n\n ````\n" - uid: azure.storage.filedatalake.FileSystemClient.list_deleted_paths name: list_deleted_paths summary: 'Returns a generator to list the deleted (file or directory) paths under @@ -1281,13 +1161,3 @@ methods: - return: description: filesystem-updated property dict (Etag and last modified). - examples: - - "Setting metadata on the file system.\n\n\n\n````python\n\ - \n # Create key, value pairs for metadata\n metadata = {'type': 'test'}\n\n\ - \ # Set metadata on the file system\n file_system_client.set_file_system_metadata(metadata=metadata)\n\ - \n ````\n" diff --git a/preview/docs-ref-autogen/azure-storage-file-datalake/azure.storage.filedatalake.aio.DataLakeDirectoryClient.yml b/preview/docs-ref-autogen/azure-storage-file-datalake/azure.storage.filedatalake.aio.DataLakeDirectoryClient.yml index 239aa6346fc7..7d2bbc1a211a 100644 --- a/preview/docs-ref-autogen/azure-storage-file-datalake/azure.storage.filedatalake.aio.DataLakeDirectoryClient.yml +++ b/preview/docs-ref-autogen/azure-storage-file-datalake/azure.storage.filedatalake.aio.DataLakeDirectoryClient.yml @@ -80,16 +80,6 @@ variables: name: primary_hostname types: - -examples: -- "Creating the DataLakeServiceClient from connection string.\n\n\n\n````python\n\n from azure.storage.filedatalake.aio\ - \ import DataLakeDirectoryClient\n DataLakeDirectoryClient.from_connection_string(connection_string,\ - \ \"myfilesystem\", \"mydirectory\")\n\n ````\n" methods: - uid: azure.storage.filedatalake.aio.DataLakeDirectoryClient.create_directory name: create_directory @@ -242,14 +232,6 @@ methods: description: A dictionary of response headers. types: - [, [, ]] - examples: - - "Create directory.\n\n\n\n````python\n\ - \n await directory_client.create_directory()\n\n ````\n" - uid: azure.storage.filedatalake.aio.DataLakeDirectoryClient.create_file name: create_file summary: Create a new file and return the file client to be interacted with. @@ -640,14 +622,6 @@ methods: - return: description: None - examples: - - "Delete directory.\n\n\n\n````python\n\ - \n await new_directory.delete_directory()\n\n ````\n" - uid: azure.storage.filedatalake.aio.DataLakeDirectoryClient.delete_sub_directory name: delete_sub_directory summary: Marks the specified subdirectory for deletion. @@ -812,14 +786,6 @@ methods: return: types: - - examples: - - "Getting the properties for a file/directory.\n\n\n\n````python\n\ - \n props = await new_directory.get_directory_properties()\n\n ````\n" - uid: azure.storage.filedatalake.aio.DataLakeDirectoryClient.get_file_client name: get_file_client summary: 'Get a client to interact with the specified file. @@ -977,14 +943,3 @@ methods: - return: description: DataLakeDirectoryClient - examples: - - "Rename the source directory.\n\n\n\n````python\n\ - \n new_dir_name = \"testdir2\"\n print(\"Renaming the directory named '{}'\ - \ to '{}'.\".format(dir_name, new_dir_name))\n new_directory = await directory_client\\\ - \n .rename_directory(new_name=directory_client.file_system_name + '/' +\ - \ new_dir_name)\n\n ````\n" diff --git a/preview/docs-ref-autogen/azure-storage-file-datalake/azure.storage.filedatalake.aio.DataLakeFileClient.yml b/preview/docs-ref-autogen/azure-storage-file-datalake/azure.storage.filedatalake.aio.DataLakeFileClient.yml index 9f8c29e6bab0..7ed6dec8b45d 100644 --- a/preview/docs-ref-autogen/azure-storage-file-datalake/azure.storage.filedatalake.aio.DataLakeFileClient.yml +++ b/preview/docs-ref-autogen/azure-storage-file-datalake/azure.storage.filedatalake.aio.DataLakeFileClient.yml @@ -73,16 +73,6 @@ variables: name: primary_hostname types: - -examples: -- "Creating the DataLakeServiceClient from connection string.\n\n\n\n````python\n\n from azure.storage.filedatalake.aio\ - \ import DataLakeFileClient\n DataLakeFileClient.from_connection_string(connection_string,\ - \ \"myfilesystem\", \"mydirectory\", \"myfile\")\n\n ````\n" methods: - uid: azure.storage.filedatalake.aio.DataLakeFileClient.append_data name: append_data @@ -166,15 +156,6 @@ methods: - return: description: dict of the response header - examples: - - "Append data to the file.\n\n\n\n````python\n\ - \n await file_client.append_data(data=file_content[2048:3072], offset=2048,\ - \ length=1024)\n\n ````\n" - uid: azure.storage.filedatalake.aio.DataLakeFileClient.create_file name: create_file summary: Create a new file. @@ -344,15 +325,6 @@ methods: - return: description: response dict (Etag and last modified). - examples: - - "Create file.\n\n\n\n````python\n\ - \n file_client = filesystem_client.get_file_client(file_name)\n await file_client.create_file()\n\ - \n ````\n" - uid: azure.storage.filedatalake.aio.DataLakeFileClient.delete_file name: delete_file summary: Marks the specified file for deletion. @@ -415,14 +387,6 @@ methods: - return: description: None - examples: - - "Delete file.\n\n\n\n````python\n\ - \n await new_client.delete_file()\n\n ````\n" - uid: azure.storage.filedatalake.aio.DataLakeFileClient.download_file name: download_file summary: 'Downloads a file to the StorageStreamDownloader. The readall() method @@ -523,15 +487,6 @@ methods: description: A streaming object (StorageStreamDownloader) types: - - examples: - - "Return the downloaded data.\n\n\n\n````python\n\ - \n download = await file_client.download_file()\n downloaded_bytes = await\ - \ download.readall()\n\n ````\n" - uid: azure.storage.filedatalake.aio.DataLakeFileClient.exists name: exists summary: Returns True if a file exists and returns False otherwise. @@ -695,17 +650,6 @@ methods: - return: description: response header in dict - examples: - - "Commit the previous appended data.\n\n\n\n````python\n\ - \n file_client = file_system_client.get_file_client(\"myfile\")\n await file_client.create_file()\n\ - \ with open(SOURCE_FILE, \"rb\") as data:\n length = data.tell()\n \ - \ await file_client.append_data(data, 0)\n await file_client.flush_data(length)\n\ - \n ````\n" - uid: azure.storage.filedatalake.aio.DataLakeFileClient.get_file_properties name: get_file_properties summary: 'Returns all user-defined metadata, standard HTTP properties, and @@ -779,14 +723,6 @@ methods: return: types: - - examples: - - "Getting the properties for a file.\n\n\n\n````python\n\ - \n properties = await file_client.get_file_properties()\n\n ````\n" - uid: azure.storage.filedatalake.aio.DataLakeFileClient.rename_file name: rename_file summary: Rename the source file. @@ -906,15 +842,6 @@ methods: description: the renamed file client types: - - examples: - - "Rename the source file.\n\n\n\n````python\n\ - \n new_client = await file_client.rename_file(file_client.file_system_name +\ - \ '/' + 'newname')\n\n ````\n" - uid: azure.storage.filedatalake.aio.DataLakeFileClient.set_file_expiry name: set_file_expiry summary: Sets the time a file will expire and be deleted. diff --git a/preview/docs-ref-autogen/azure-storage-file-datalake/azure.storage.filedatalake.aio.DataLakeServiceClient.yml b/preview/docs-ref-autogen/azure-storage-file-datalake/azure.storage.filedatalake.aio.DataLakeServiceClient.yml index fd55534c32b5..cf562e298d5c 100644 --- a/preview/docs-ref-autogen/azure-storage-file-datalake/azure.storage.filedatalake.aio.DataLakeServiceClient.yml +++ b/preview/docs-ref-autogen/azure-storage-file-datalake/azure.storage.filedatalake.aio.DataLakeServiceClient.yml @@ -75,27 +75,6 @@ variables: name: primary_hostname types: - -examples: -- "Creating the DataLakeServiceClient from connection string.\n\n\n\n````python\n\n from azure.storage.filedatalake.aio\ - \ import DataLakeServiceClient\n datalake_service_client = DataLakeServiceClient.from_connection_string(connection_string)\n\ - \n ````\n\nCreating the DataLakeServiceClient with Azure Identity credentials.\n\n\n\n````python\n\n from azure.identity.aio import\ - \ ClientSecretCredential\n token_credential = ClientSecretCredential(\n \ - \ active_directory_tenant_id,\n active_directory_application_id,\n active_directory_application_secret,\n\ - \ )\n datalake_service_client = DataLakeServiceClient(\"https://{}.dfs.core.windows.net\"\ - .format(account_name),\n credential=token_credential)\n\ - \n ````\n" methods: - uid: azure.storage.filedatalake.aio.DataLakeServiceClient.close name: close @@ -160,15 +139,6 @@ methods: return: types: - - examples: - - "Creating a file system in the datalake service.\n\n\n\n````python\n\n await datalake_service_client.create_file_system(\"\ - filesystem\")\n\n ````\n" - uid: azure.storage.filedatalake.aio.DataLakeServiceClient.delete_file_system name: delete_file_system summary: 'Marks the specified file system for deletion. @@ -249,15 +219,6 @@ methods: return: types: - - examples: - - "Deleting a file system in the datalake service.\n\n\n\n````python\n\n await datalake_service_client.delete_file_system(\"\ - filesystem\")\n\n ````\n" - uid: azure.storage.filedatalake.aio.DataLakeServiceClient.get_directory_client name: get_directory_client summary: 'Get a client to interact with the specified directory. @@ -289,16 +250,6 @@ methods: description: A DataLakeDirectoryClient. types: - - examples: - - "Getting the directory client to interact with a specific directory.\n\n\n\n````python\n\n directory_client = datalake_service_client.get_directory_client(file_system_client.file_system_name,\n\ - \ \"mydirectory\"\ - )\n\n ````\n" - uid: azure.storage.filedatalake.aio.DataLakeServiceClient.get_file_client name: get_file_client summary: 'Get a client to interact with the specified file. @@ -330,15 +281,6 @@ methods: description: A DataLakeFileClient. types: - - examples: - - "Getting the file client to interact with a specific file.\n\n\n\n````python\n\n file_client = datalake_service_client.get_file_client(file_system_client.file_system_name,\ - \ \"myfile\")\n\n ````\n" - uid: azure.storage.filedatalake.aio.DataLakeServiceClient.get_file_system_client name: get_file_system_client summary: 'Get a client to interact with the specified file system. @@ -359,19 +301,6 @@ methods: description: A FileSystemClient. types: - - examples: - - "Getting the file system client to interact with a specific file system.\n\n\n\n````python\n\n # Instantiate a DataLakeServiceClient\ - \ using a connection string\n from azure.storage.filedatalake.aio import DataLakeServiceClient\n\ - \ datalake_service_client = DataLakeServiceClient.from_connection_string(self.connection_string)\n\ - \n async with datalake_service_client:\n # Instantiate a FileSystemClient\n\ - \ file_system_client = datalake_service_client.get_file_system_client(\"\ - mynewfilesystems\")\n\n ````\n" - uid: azure.storage.filedatalake.aio.DataLakeServiceClient.get_service_properties name: get_service_properties summary: 'Gets the properties of a storage account''s datalake service, including @@ -434,17 +363,6 @@ methods: description: The user delegation key. types: - - examples: - - "Get user delegation key from datalake service client.\n\n\n\n````python\n\n from datetime import datetime,\ - \ timedelta\n user_delegation_key = await datalake_service_client.get_user_delegation_key(datetime.utcnow(),\n\ - \ datetime.utcnow()\ - \ + timedelta(hours=1))\n\n ````\n" - uid: azure.storage.filedatalake.aio.DataLakeServiceClient.list_file_systems name: list_file_systems summary: 'Returns a generator to list the file systems under the specified account. @@ -508,16 +426,6 @@ methods: description: An iterable (auto-paging) of FileSystemProperties. types: - [] - examples: - - "Listing the file systems in the datalake service.\n\n\n\n````python\n\n file_systems = datalake_service_client.list_file_systems()\n\ - \ async for file_system in file_systems:\n print(file_system.name)\n\n\ - \ ````\n" - uid: azure.storage.filedatalake.aio.DataLakeServiceClient.set_service_properties name: set_service_properties summary: 'Sets the properties of a storage account''s Datalake service, including diff --git a/preview/docs-ref-autogen/azure-storage-file-datalake/azure.storage.filedatalake.aio.FileSystemClient.yml b/preview/docs-ref-autogen/azure-storage-file-datalake/azure.storage.filedatalake.aio.FileSystemClient.yml index 3ef8cd63fb21..7ed73db425c3 100644 --- a/preview/docs-ref-autogen/azure-storage-file-datalake/azure.storage.filedatalake.aio.FileSystemClient.yml +++ b/preview/docs-ref-autogen/azure-storage-file-datalake/azure.storage.filedatalake.aio.FileSystemClient.yml @@ -38,19 +38,6 @@ constructor: - name: file_system_name - name: credential defaultValue: None -examples: -- "Get a FileSystemClient from an existing DataLakeServiceClient.\n\n\n\n````python\n\n # Instantiate a DataLakeServiceClient\ - \ using a connection string\n from azure.storage.filedatalake.aio import DataLakeServiceClient\n\ - \ datalake_service_client = DataLakeServiceClient.from_connection_string(self.connection_string)\n\ - \n async with datalake_service_client:\n # Instantiate a FileSystemClient\n\ - \ file_system_client = datalake_service_client.get_file_system_client(\"mynewfilesystems\"\ - )\n\n ````\n" methods: - uid: azure.storage.filedatalake.aio.FileSystemClient.acquire_lease name: acquire_lease @@ -132,16 +119,6 @@ methods: description: A DataLakeLeaseClient object, that can be run in a context manager. types: - - examples: - - "Acquiring a lease on the file_system.\n\n\n\n````python\n\ - \n # Acquire a lease on the file system\n lease = await file_system_client.acquire_lease()\n\ - \n # Delete file system by passing in the lease\n await file_system_client.delete_file_system(lease=lease)\n\ - \n ````\n" - uid: azure.storage.filedatalake.aio.FileSystemClient.close name: close summary: 'This method is to close the sockets opened by the client. @@ -300,15 +277,6 @@ methods: - return: description: DataLakeDirectoryClient - examples: - - "Create directory in the file system.\n\n\n\n````python\n\ - \n directory_client = await file_system_client.create_directory(\"mydirectory\"\ - )\n\n ````\n" - uid: azure.storage.filedatalake.aio.FileSystemClient.create_file name: create_file summary: Create file @@ -476,14 +444,6 @@ methods: - return: description: DataLakeFileClient - examples: - - "Create file in the file system.\n\n\n\n````python\n\ - \n file_client = await file_system_client.create_file(\"myfile\")\n\n ````\n" - uid: azure.storage.filedatalake.aio.FileSystemClient.create_file_system name: create_file_system summary: 'Creates a new file system under the specified account. @@ -537,15 +497,6 @@ methods: description: A dictionary of response headers. types: - [, [, ]] - examples: - - "Creating a file system in the datalake service.\n\n\n\n````python\n\n await file_system_client.create_file_system()\n\ - \n ````\n" - uid: azure.storage.filedatalake.aio.FileSystemClient.delete_directory name: delete_directory summary: Marks the specified path for deletion. @@ -618,24 +569,9 @@ methods: - return: description: DataLakeDirectoryClient - examples: - - "Delete directory in the file system.\n\n\n\n````python\n\ - \n await file_system_client.delete_directory(\"mydirectory\")\n\n ````\n" - uid: azure.storage.filedatalake.aio.FileSystemClient.delete_file name: delete_file - summary: "Marks the specified file for deletion.\n\nDelete file in the file system.\n\n\n\n````python\n\n await file_system_client.delete_file(\"\ - myfile\")\n\n ````" + summary: Marks the specified file for deletion. signature: 'async delete_file(file: FileProperties | str, **kwargs) -> DataLakeFileClient' parameters: - name: file @@ -774,15 +710,6 @@ methods: return: types: - - examples: - - "Deleting a file system in the datalake service.\n\n\n\n````python\n\n await file_system_client.delete_file_system()\n\ - \n ````\n" - uid: azure.storage.filedatalake.aio.FileSystemClient.exists name: exists summary: Returns True if a file system exists and returns False otherwise. @@ -823,16 +750,6 @@ methods: description: A DataLakeDirectoryClient. types: - - examples: - - "Getting the directory client to interact with a specific directory.\n\n\n\n````python\n\n # Get the DataLakeDirectoryClient\ - \ from the FileSystemClient to interact with a specific file\n directory_client\ - \ = file_system_client.get_directory_client(\"mynewdirectory\")\n\n ````\n" - uid: azure.storage.filedatalake.aio.FileSystemClient.get_file_client name: get_file_client summary: 'Get a client to interact with the specified file. @@ -854,16 +771,6 @@ methods: description: A DataLakeFileClient. types: - - examples: - - "Getting the file client to interact with a specific file.\n\n\n\n````python\n\n # Get the FileClient from the\ - \ FileSystemClient to interact with a specific file\n file_client = file_system_client.get_file_client(\"\ - mynewfile\")\n\n ````\n" - uid: azure.storage.filedatalake.aio.FileSystemClient.get_file_system_access_policy name: get_file_system_access_policy summary: 'Gets the permissions for the specified file system. @@ -924,15 +831,6 @@ methods: description: Properties for the specified file system within a file system object. types: - - examples: - - "Getting properties on the file system.\n\n\n\n````python\n\ - \n properties = await file_system_client.get_file_system_properties()\n\n \ - \ ````\n" - uid: azure.storage.filedatalake.aio.FileSystemClient.get_paths name: get_paths summary: 'Returns a generator to list the paths(could be files or directories) under @@ -990,15 +888,6 @@ methods: description: An iterable (auto-paging) response of PathProperties. types: - [] - examples: - - "List the blobs in the file system.\n\n\n\n````python\n\ - \n path_list = file_system_client.get_paths()\n async for path in path_list:\n\ - \ print(path.name + '\\n')\n\n ````\n" - uid: azure.storage.filedatalake.aio.FileSystemClient.list_deleted_paths name: list_deleted_paths summary: 'Returns a generator to list the deleted (file or directory) paths under @@ -1192,13 +1081,3 @@ methods: - return: description: file system-updated property dict (Etag and last modified). - examples: - - "Setting metadata on the container.\n\n\n\n````python\n\ - \n # Create key, value pairs for metadata\n metadata = {'type': 'test'}\n\n\ - \ # Set metadata on the file system\n await file_system_client.set_file_system_metadata(metadata=metadata)\n\ - \n ````\n" diff --git a/preview/docs-ref-autogen/azure-storage-file-share/azure.storage.fileshare.ShareClient.yml b/preview/docs-ref-autogen/azure-storage-file-share/azure.storage.fileshare.ShareClient.yml index 4353b8aa2edc..0816feb64781 100644 --- a/preview/docs-ref-autogen/azure-storage-file-share/azure.storage.fileshare.ShareClient.yml +++ b/preview/docs-ref-autogen/azure-storage-file-share/azure.storage.fileshare.ShareClient.yml @@ -152,15 +152,6 @@ methods: description: A ShareLeaseClient object. types: - - examples: - - "Acquiring a lease on a share.\n\n\n\n````python\n\ - \n share.create_directory(\"mydir\")\n lease = share.acquire_lease()\n share.get_share_properties(lease=lease)\n\ - \ share.delete_share(lease=lease)\n\n ````\n" - uid: azure.storage.fileshare.ShareClient.create_directory name: create_directory summary: 'Creates a directory in the share and returns a client to interact @@ -274,15 +265,6 @@ methods: description: Share-updated property dict (Etag and last modified). types: - [, ] - examples: - - "Creates a file share.\n\ - \n\n\n````python\n\ - \n # Create share with Access Tier set to Hot\n share.create_share(access_tier=ShareAccessTier(\"\ - Hot\"))\n\n ````\n" - uid: azure.storage.fileshare.ShareClient.create_snapshot name: create_snapshot summary: 'Creates a snapshot of the share. @@ -322,14 +304,6 @@ methods: description: Share-updated property dict (Snapshot ID, Etag, and last modified). types: - [, ] - examples: - - "Creates a snapshot of the file share.\n\n\n\n````python\n\ - \n share.create_snapshot()\n\n ````\n" - uid: azure.storage.fileshare.ShareClient.delete_directory name: delete_directory summary: 'Marks the directory for deletion. The directory is @@ -392,14 +366,6 @@ methods: see [here](https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/storage/azure-storage-file-share#other-client--per-operation-configuration).' types: - - examples: - - "Deletes the share and any snapshots.\n\n\n\n````python\n\ - \n share.delete_share(delete_snapshots=True)\n\n ````\n" - uid: azure.storage.fileshare.ShareClient.from_connection_string name: from_connection_string summary: Create ShareClient from a Connection String. @@ -451,15 +417,6 @@ methods: description: A share client. types: - - examples: - - "Gets the share client from connection string.\n\n\n\n````python\n\ - \n from azure.storage.fileshare import ShareClient\n share = ShareClient.from_connection_string(self.connection_string,\ - \ \"sharesamples2\")\n\n ````\n" - uid: azure.storage.fileshare.ShareClient.from_share_url name: from_share_url signature: 'from_share_url(share_url: str, snapshot: str | Dict[str, Any] | None @@ -636,14 +593,6 @@ methods: description: The share properties. types: - - examples: - - "Gets the share properties.\n\n\n\n````python\n\ - \n properties = share.get_share_properties()\n\n ````\n" - uid: azure.storage.fileshare.ShareClient.get_share_stats name: get_share_stats summary: 'Gets the approximate size of the data stored on the share in bytes. @@ -746,18 +695,6 @@ methods: - return: description: An auto-paging iterable of dict-like DirectoryProperties and FileProperties - examples: - - "List directories and files in the share.\n\n\n\n````python\n\ - \n # Create a directory in the share\n dir_client = share.create_directory(\"\ - mydir\")\n\n # Upload a file to the directory\n with open(SOURCE_FILE, \"\ - rb\") as source_file:\n dir_client.upload_file(file_name=\"sample\", data=source_file)\n\ - \n # List files in the directory\n my_files = list(share.list_directories_and_files(directory_name=\"\ - mydir\"))\n print(my_files)\n\n ````\n" - uid: azure.storage.fileshare.ShareClient.set_share_access_policy name: set_share_access_policy summary: 'Sets the permissions for the share, or stored access @@ -849,15 +786,6 @@ methods: description: Share-updated property dict (Etag and last modified). types: - (, ) - examples: - - "Sets the share metadata.\n\ - \n\n\n````python\n\ - \n data = {'category': 'test'}\n share.set_share_metadata(metadata=data)\n\ - \n ````\n" - uid: azure.storage.fileshare.ShareClient.set_share_properties name: set_share_properties summary: 'Sets the share properties. @@ -908,19 +836,6 @@ methods: description: Share-updated property dict (Etag and last modified). types: - (, ) - examples: - - "Sets the share properties.\n\n\n\n````python\n\ - \n # Set the tier for the first share to Hot\n share1.set_share_properties(access_tier=\"\ - Hot\")\n # Set the quota for the first share to 3\n share1.set_share_properties(quota=3)\n\ - \ # Set the tier for the second share to Cool and quota to 2\n share2.set_share_properties(access_tier=ShareAccessTier(\"\ - Cool\"), quota=2)\n\n # Get the shares' properties\n print(share1.get_share_properties().access_tier)\n\ - \ print(share1.get_share_properties().quota)\n print(share2.get_share_properties().access_tier)\n\ - \ print(share2.get_share_properties().quota)\n\n ````\n" - uid: azure.storage.fileshare.ShareClient.set_share_quota name: set_share_quota summary: Sets the quota for the share. @@ -960,12 +875,3 @@ methods: description: Share-updated property dict (Etag and last modified). types: - (, ) - examples: - - "Sets the share quota.\n\ - \n\n\n````python\n\ - \n # Set the quota for the share to 1GB\n share.set_share_quota(quota=1)\n\ - \n ````\n" diff --git a/preview/docs-ref-autogen/azure-storage-file-share/azure.storage.fileshare.ShareDirectoryClient.yml b/preview/docs-ref-autogen/azure-storage-file-share/azure.storage.fileshare.ShareDirectoryClient.yml index a234834a234d..90af29fcef04 100644 --- a/preview/docs-ref-autogen/azure-storage-file-share/azure.storage.fileshare.ShareDirectoryClient.yml +++ b/preview/docs-ref-autogen/azure-storage-file-share/azure.storage.fileshare.ShareDirectoryClient.yml @@ -255,14 +255,6 @@ methods: description: Directory-updated property dict (Etag and last modified). types: - (, ) - examples: - - "Creates a directory.\n\ - \n\n\n````python\n\ - \n my_directory.create_directory()\n\n ````\n" - uid: azure.storage.fileshare.ShareDirectoryClient.create_subdirectory name: create_subdirectory summary: 'Creates a new subdirectory and returns a client to interact @@ -295,15 +287,6 @@ methods: description: ShareDirectoryClient types: - - examples: - - "Create a subdirectory.\n\n\n\n````python\n\ - \n # Create the directory\n parent_dir.create_directory()\n\n # Create a\ - \ subdirectory\n subdir = parent_dir.create_subdirectory(\"subdir\")\n\n ````\n" - uid: azure.storage.fileshare.ShareDirectoryClient.delete_directory name: delete_directory summary: 'Marks the directory for deletion. The directory is @@ -326,14 +309,6 @@ methods: return: types: - - examples: - - "Deletes a directory.\n\ - \n\n\n````python\n\ - \n my_directory.delete_directory()\n\n ````\n" - uid: azure.storage.fileshare.ShareDirectoryClient.delete_file name: delete_file summary: 'Marks the specified file for deletion. The file is later @@ -361,15 +336,6 @@ methods: return: types: - - examples: - - "Delete a file in a directory.\n\n\n\n````python\n\ - \n # Delete the file in the directory\n my_directory.delete_file(file_name=\"\ - sample\")\n\n ````\n" - uid: azure.storage.fileshare.ShareDirectoryClient.delete_subdirectory name: delete_subdirectory summary: Deletes a subdirectory. @@ -395,14 +361,6 @@ methods: return: types: - - examples: - - "Delete a subdirectory.\n\n\n\n````python\n\ - \n parent_dir.delete_subdirectory(\"subdir\")\n\n ````\n" - uid: azure.storage.fileshare.ShareDirectoryClient.exists name: exists summary: Returns True if a directory exists and returns False otherwise. @@ -576,17 +534,6 @@ methods: description: A Directory Client. types: - - examples: - - "Gets the subdirectory client.\n\n\n\n````python\n\ - \n # Get a directory client and create the directory\n parent = share.get_directory_client(\"\ - dir1\")\n parent.create_directory()\n\n # Get a subdirectory client and create\ - \ the subdirectory \"dir1/dir2\"\n subdirectory = parent.get_subdirectory_client(\"\ - dir2\")\n subdirectory.create_directory()\n\n ````\n" - uid: azure.storage.fileshare.ShareDirectoryClient.list_directories_and_files name: list_directories_and_files summary: Lists all the directories and files under the directory. @@ -639,15 +586,6 @@ methods: description: An auto-paging iterable of dict-like DirectoryProperties and FileProperties types: - [] - examples: - - "List directories and files.\n\n\n\n````python\n\ - \n # List the directories and files under the parent directory\n my_list =\ - \ list(parent_dir.list_directories_and_files())\n print(my_list)\n\n ````\n" - uid: azure.storage.fileshare.ShareDirectoryClient.list_handles name: list_handles summary: Lists opened handles on a directory or a file under the directory. @@ -902,12 +840,3 @@ methods: description: ShareFileClient types: - - examples: - - "Upload a file to a directory.\n\n\n\n````python\n\ - \n # Upload a file to the directory\n with open(SOURCE_FILE, \"rb\") as source:\n\ - \ my_directory.upload_file(file_name=\"sample\", data=source)\n\n ````\n" diff --git a/preview/docs-ref-autogen/azure-storage-file-share/azure.storage.fileshare.ShareFileClient.yml b/preview/docs-ref-autogen/azure-storage-file-share/azure.storage.fileshare.ShareFileClient.yml index 199805a22077..56d98ebe863f 100644 --- a/preview/docs-ref-autogen/azure-storage-file-share/azure.storage.fileshare.ShareFileClient.yml +++ b/preview/docs-ref-autogen/azure-storage-file-share/azure.storage.fileshare.ShareFileClient.yml @@ -185,16 +185,6 @@ methods: description: A ShareLeaseClient object. types: - - examples: - - "Acquiring a lease on a file.\n\n\n\n````python\n\ - \n source_file.create_file(1024)\n lease = source_file.acquire_lease()\n \ - \ source_file.upload_file(b'hello world', lease=lease)\n\n lease.release()\n\ - \n ````\n" - uid: azure.storage.fileshare.ShareFileClient.clear_range name: clear_range summary: 'Clears the specified range and releases the space used in storage for @@ -418,15 +408,6 @@ methods: description: File-updated property dict (Etag and last modified). types: - (, ) - examples: - - "Create a file.\n\n\n\n````python\n\ - \n # Create and allocate bytes for the file (no content added yet)\n my_allocated_file.create_file(size=100)\n\ - \n ````\n" - uid: azure.storage.fileshare.ShareFileClient.delete_file name: delete_file summary: 'Marks the specified file for deletion. The file is @@ -460,14 +441,6 @@ methods: return: types: - - examples: - - "Delete a file.\n\n\n\n````python\n\ - \n my_file.delete_file()\n\n ````\n" - uid: azure.storage.fileshare.ShareFileClient.download_file name: download_file summary: 'Downloads a file to the StorageStreamDownloader. The readall() method @@ -554,15 +527,6 @@ methods: description: A streaming object (StorageStreamDownloader) types: - - examples: - - "Download a file.\n\n\ - \n\n````python\n\ - \n with open(DEST_FILE, \"wb\") as data:\n stream = my_file.download_file()\n\ - \ data.write(stream.readall())\n\n ````\n" - uid: azure.storage.fileshare.ShareFileClient.from_connection_string name: from_connection_string summary: Create ShareFileClient from a Connection String. @@ -620,16 +584,6 @@ methods: description: A File client. types: - - examples: - - "Creates the file client with connection string.\n\n\n\n````python\n\n from azure.storage.fileshare import\ - \ ShareFileClient\n file = ShareFileClient.from_connection_string(\n self.connection_string,\n\ - \ share_name=\"helloworld2\",\n file_path=\"myfile\")\n\n ````\n" - uid: azure.storage.fileshare.ShareFileClient.from_file_url name: from_file_url summary: A client to interact with a specific file, although that file may not yet @@ -1226,14 +1180,6 @@ methods: return: types: - (, ) - examples: - - "Copy a file from a URL\n\ - \n\n\n````python\n\ - \n destination_file.start_copy_from_url(source_url=source_url)\n\n ````\n" - uid: azure.storage.fileshare.ShareFileClient.upload_file name: upload_file summary: "Uploads a new file.\n\n param data:\n Content of the file.\n\n\ @@ -1291,14 +1237,7 @@ methods: \ network timesouts\n see [here](https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/storage/azure-storage-file-share#other-client--per-operation-configuration).\n\ \nkeyword str encoding:\n Defaults to UTF-8.\n\nreturns:\n File-updated\ \ property dict (Etag and last modified).\n\nrtype:\n dict(str, Any)\n\n\n\ - \n## Example:Upload a file.\n\n\n\n````python\n\ - \n with open(SOURCE_FILE, \"rb\") as source:\n my_file.upload_file(source)\n\ - \n ````" + \n## Example:" - uid: azure.storage.fileshare.ShareFileClient.upload_range name: upload_range summary: Upload a range of bytes to a file. diff --git a/preview/docs-ref-autogen/azure-storage-file-share/azure.storage.fileshare.ShareServiceClient.yml b/preview/docs-ref-autogen/azure-storage-file-share/azure.storage.fileshare.ShareServiceClient.yml index e54bdd6a1222..4effb668b994 100644 --- a/preview/docs-ref-autogen/azure-storage-file-share/azure.storage.fileshare.ShareServiceClient.yml +++ b/preview/docs-ref-autogen/azure-storage-file-share/azure.storage.fileshare.ShareServiceClient.yml @@ -93,16 +93,6 @@ constructor: description: The maximum range size used for a file upload. Defaults to 4*1024*1024. types: - -examples: -- "Create the share service client with url and credential.\n\n\n\n````python\n\n from azure.storage.fileshare import ShareServiceClient\n\ - \ share_service_client = ShareServiceClient(\n account_url=self.account_url,\n\ - \ credential=self.access_key\n )\n\n ````\n" methods: - uid: azure.storage.fileshare.ShareServiceClient.create_share name: create_share @@ -143,14 +133,6 @@ methods: return: types: - - examples: - - "Create a share in the file share service.\n\n\n\n````python\n\ - \n file_service.create_share(share_name=\"fileshare1\")\n\n ````\n" - uid: azure.storage.fileshare.ShareServiceClient.delete_share name: delete_share summary: 'Marks the specified share for deletion. The share is @@ -187,14 +169,6 @@ methods: return: types: - - examples: - - "Delete a share in the file share service.\n\n\n\n````python\n\ - \n file_service.delete_share(share_name=\"fileshare1\")\n\n ````\n" - uid: azure.storage.fileshare.ShareServiceClient.from_connection_string name: from_connection_string summary: Create ShareServiceClient from a Connection String. @@ -233,16 +207,6 @@ methods: description: A File Share service client. types: - - examples: - - "Create the share service client with connection string.\n\n\n\n````python\n\n from azure.storage.fileshare\ - \ import ShareServiceClient\n share_service_client = ShareServiceClient.from_connection_string(self.connection_string)\n\ - \n ````\n" - uid: azure.storage.fileshare.ShareServiceClient.get_service_properties name: get_service_properties summary: 'Gets the properties of a storage account''s File Share service, including @@ -268,14 +232,6 @@ methods: analytics logging, hour/minute metrics, cors rules, etc.' types: - [, ] - examples: - - "Get file share service properties.\n\n\n\n````python\n\ - \n properties = file_service.get_service_properties()\n\n ````\n" - uid: azure.storage.fileshare.ShareServiceClient.get_share_client name: get_share_client summary: 'Get a client to interact with the specified share. @@ -304,17 +260,6 @@ methods: description: A ShareClient. types: - - examples: - - "Gets the share client.\n\ - \n\n\n````python\n\ - \n from azure.storage.fileshare import ShareServiceClient\n file_service =\ - \ ShareServiceClient.from_connection_string(self.connection_string)\n\n # Get\ - \ a share client to interact with a specific share\n share = file_service.get_share_client(\"\ - fileshare2\")\n\n ````\n" - uid: azure.storage.fileshare.ShareServiceClient.list_shares name: list_shares summary: 'Returns auto-paging iterable of dict-like ShareProperties under the specified @@ -365,16 +310,6 @@ methods: description: An iterable (auto-paging) of ShareProperties. types: - [] - examples: - - "List shares in the file share service.\n\n\n\n````python\n\ - \n # List the shares in the file service\n my_shares = list(file_service.list_shares())\n\ - \n # Print the shares\n for share in my_shares:\n print(share)\n\n \ - \ ````\n" - uid: azure.storage.fileshare.ShareServiceClient.set_service_properties name: set_service_properties summary: 'Sets the properties of a storage account''s File Share service, including @@ -429,28 +364,6 @@ methods: return: types: - - examples: - - "Sets file share service properties.\n\n\n\n````python\n\ - \n # Create service properties\n from azure.storage.fileshare import Metrics,\ - \ CorsRule, RetentionPolicy\n\n # Create metrics for requests statistics\n \ - \ hour_metrics = Metrics(enabled=True, include_apis=True, retention_policy=RetentionPolicy(enabled=True,\ - \ days=5))\n minute_metrics = Metrics(enabled=True, include_apis=True,\n \ - \ retention_policy=RetentionPolicy(enabled=True, days=5))\n\ - \n # Create CORS rules\n cors_rule1 = CorsRule(['www.xyz.com'], ['GET'])\n\ - \ allowed_origins = ['www.xyz.com', \"www.ab.com\", \"www.bc.com\"]\n allowed_methods\ - \ = ['GET', 'PUT']\n max_age_in_seconds = 500\n exposed_headers = [\"x-ms-meta-data*\"\ - , \"x-ms-meta-source*\", \"x-ms-meta-abc\", \"x-ms-meta-bcd\"]\n allowed_headers\ - \ = [\"x-ms-meta-data*\", \"x-ms-meta-target*\", \"x-ms-meta-xyz\", \"x-ms-meta-foo\"\ - ]\n cors_rule2 = CorsRule(\n allowed_origins,\n allowed_methods,\n\ - \ max_age_in_seconds=max_age_in_seconds,\n exposed_headers=exposed_headers,\n\ - \ allowed_headers=allowed_headers)\n\n cors = [cors_rule1, cors_rule2]\n\ - \n # Set the service properties\n file_service.set_service_properties(hour_metrics,\ - \ minute_metrics, cors)\n\n ````\n" - uid: azure.storage.fileshare.ShareServiceClient.undelete_share name: undelete_share summary: 'Restores soft-deleted share. diff --git a/preview/docs-ref-autogen/azure-storage-file-share/azure.storage.fileshare.aio.ShareClient.yml b/preview/docs-ref-autogen/azure-storage-file-share/azure.storage.fileshare.aio.ShareClient.yml index 9eb54f17262a..568e72b8d8bd 100644 --- a/preview/docs-ref-autogen/azure-storage-file-share/azure.storage.fileshare.aio.ShareClient.yml +++ b/preview/docs-ref-autogen/azure-storage-file-share/azure.storage.fileshare.aio.ShareClient.yml @@ -263,15 +263,6 @@ methods: description: Share-updated property dict (Etag and last modified). types: - [, ] - examples: - - "Creates a file share.\n\n\n\n````python\n\ - \n # Create share with Access Tier set to Hot\n await share.create_share(access_tier=ShareAccessTier(\"\ - Hot\"))\n\n ````\n" - uid: azure.storage.fileshare.aio.ShareClient.create_snapshot name: create_snapshot summary: 'Creates a snapshot of the share. @@ -311,14 +302,6 @@ methods: description: Share-updated property dict (Snapshot ID, Etag, and last modified). types: - [, ] - examples: - - "Creates a snapshot of the file share.\n\n\n\n````python\n\ - \n await share.create_snapshot()\n\n ````\n" - uid: azure.storage.fileshare.aio.ShareClient.delete_directory name: delete_directory summary: 'Marks the directory for deletion. The directory is @@ -382,14 +365,6 @@ methods: This keyword argument was introduced in API version ''2020-08-04''.' - examples: - - "Deletes the share and any snapshots.\n\n\n\n````python\n\ - \n await share.delete_share(delete_snapshots=True)\n\n ````\n" - uid: azure.storage.fileshare.aio.ShareClient.get_directory_client name: get_directory_client summary: 'Get a client to interact with the specified directory. @@ -522,14 +497,6 @@ methods: description: The share properties. types: - - examples: - - "Gets the share properties.\n\n\n\n````python\n\ - \n properties = await share.get_share_properties()\n\n ````\n" - uid: azure.storage.fileshare.aio.ShareClient.get_share_stats name: get_share_stats summary: 'Gets the approximate size of the data stored on the share in bytes. @@ -632,19 +599,6 @@ methods: - return: description: An auto-paging iterable of dict-like DirectoryProperties and FileProperties - examples: - - "List directories and files in the share.\n\n\n\n````python\n\ - \n # Create a directory in the share\n dir_client = await share.create_directory(\"\ - mydir\")\n\n # Upload a file to the directory\n with open(SOURCE_FILE, \"\ - rb\") as source_file:\n await dir_client.upload_file(file_name=\"sample\"\ - , data=source_file)\n\n # List files in the directory\n my_files = []\n \ - \ async for item in share.list_directories_and_files(directory_name=\"mydir\"\ - ):\n my_files.append(item)\n print(my_files)\n\n ````\n" - uid: azure.storage.fileshare.aio.ShareClient.set_share_access_policy name: set_share_access_policy summary: 'Sets the permissions for the share, or stored access @@ -736,15 +690,6 @@ methods: description: Share-updated property dict (Etag and last modified). types: - (, ) - examples: - - "Sets the share metadata.\n\n\n\n````python\n\ - \n data = {'category': 'test'}\n await share.set_share_metadata(metadata=data)\n\ - \n ````\n" - uid: azure.storage.fileshare.aio.ShareClient.set_share_properties name: set_share_properties summary: 'Sets the share properties. @@ -795,20 +740,6 @@ methods: description: Share-updated property dict (Etag and last modified). types: - (, ) - examples: - - "Sets the share properties.\n\n\n\n````python\n\ - \n # Set the tier for the first share to Hot\n await share1.set_share_properties(access_tier=\"\ - Hot\")\n # Set the quota for the first share to 3\n await share1.set_share_properties(quota=3)\n\ - \ # Set the tier for the second share to Cool and quota to 2\n await share2.set_share_properties(access_tier=ShareAccessTier(\"\ - Cool\"), quota=2)\n\n # Get the shares' properties\n props1 = await share1.get_share_properties()\n\ - \ props2 = await share2.get_share_properties()\n print(props1.access_tier)\n\ - \ print(props1.quota)\n print(props2.access_tier)\n print(props2.quota)\n\ - \n ````\n" - uid: azure.storage.fileshare.aio.ShareClient.set_share_quota name: set_share_quota summary: Sets the quota for the share. @@ -848,12 +779,3 @@ methods: description: Share-updated property dict (Etag and last modified). types: - (, ) - examples: - - "Sets the share quota.\n\n\n\n````python\n\ - \n # Set the quota for the share to 1GB\n await share.set_share_quota(quota=1)\n\ - \n ````\n" diff --git a/preview/docs-ref-autogen/azure-storage-file-share/azure.storage.fileshare.aio.ShareDirectoryClient.yml b/preview/docs-ref-autogen/azure-storage-file-share/azure.storage.fileshare.aio.ShareDirectoryClient.yml index bf90046b147f..bbb7e16ea932 100644 --- a/preview/docs-ref-autogen/azure-storage-file-share/azure.storage.fileshare.aio.ShareDirectoryClient.yml +++ b/preview/docs-ref-autogen/azure-storage-file-share/azure.storage.fileshare.aio.ShareDirectoryClient.yml @@ -251,14 +251,6 @@ methods: description: Directory-updated property dict (Etag and last modified). types: - (, ) - examples: - - "Creates a directory.\n\n\n\n````python\n\ - \n await directory.create_directory()\n\n ````\n" - uid: azure.storage.fileshare.aio.ShareDirectoryClient.create_subdirectory name: create_subdirectory summary: 'Creates a new subdirectory and returns a client to interact @@ -291,16 +283,6 @@ methods: description: ShareDirectoryClient types: - - examples: - - "Create a subdirectory.\n\n\n\n````python\n\ - \n # Create the directory\n await parent_dir.create_directory()\n\n # Create\ - \ a subdirectory\n subdir = await parent_dir.create_subdirectory(\"subdir\"\ - )\n\n ````\n" - uid: azure.storage.fileshare.aio.ShareDirectoryClient.delete_directory name: delete_directory summary: 'Marks the directory for deletion. The directory is @@ -323,14 +305,6 @@ methods: return: types: - - examples: - - "Deletes a directory.\n\n\n\n````python\n\ - \n await directory.delete_directory()\n\n ````\n" - uid: azure.storage.fileshare.aio.ShareDirectoryClient.delete_file name: delete_file summary: 'Marks the specified file for deletion. The file is later @@ -358,15 +332,6 @@ methods: return: types: - - examples: - - "Delete a file in a directory.\n\n\n\n````python\n\ - \n # Delete the file in the directory\n await directory.delete_file(file_name=\"\ - sample\")\n\n ````\n" - uid: azure.storage.fileshare.aio.ShareDirectoryClient.delete_subdirectory name: delete_subdirectory summary: Deletes a subdirectory. @@ -392,14 +357,6 @@ methods: return: types: - - examples: - - "Delete a subdirectory.\n\n\n\n````python\n\ - \n await parent_dir.delete_subdirectory(\"subdir\")\n\n ````\n" - uid: azure.storage.fileshare.aio.ShareDirectoryClient.exists name: exists summary: Returns True if a directory exists and returns False otherwise. @@ -480,17 +437,6 @@ methods: description: A Directory Client. types: - - examples: - - "Gets the subdirectory client.\n\n\n\n````python\n\ - \n # Get a directory client and create the directory\n parent = share.get_directory_client(\"\ - dir1\")\n await parent.create_directory()\n\n # Get a subdirectory client\ - \ and create the subdirectory \"dir1/dir2\"\n subdirectory = parent.get_subdirectory_client(\"\ - dir2\")\n await subdirectory.create_directory()\n\n ````\n" - uid: azure.storage.fileshare.aio.ShareDirectoryClient.list_directories_and_files name: list_directories_and_files summary: Lists all the directories and files under the directory. @@ -544,16 +490,6 @@ methods: types: - [] - examples: - - "List directories and files.\n\n\n\n````python\n\ - \n # List the directories and files under the parent directory\n my_list =\ - \ []\n async for item in parent_dir.list_directories_and_files():\n my_list.append(item)\n\ - \ print(my_list)\n\n ````\n" - uid: azure.storage.fileshare.aio.ShareDirectoryClient.list_handles name: list_handles summary: Lists opened handles on a directory or a file under the directory. @@ -808,12 +744,3 @@ methods: description: ShareFileClient types: - - examples: - - "Upload a file to a directory.\n\n\n\n````python\n\ - \n # Upload a file to the directory\n with open(SOURCE_FILE, \"rb\") as source:\n\ - \ await directory.upload_file(file_name=\"sample\", data=source)\n\n ````\n" diff --git a/preview/docs-ref-autogen/azure-storage-file-share/azure.storage.fileshare.aio.ShareFileClient.yml b/preview/docs-ref-autogen/azure-storage-file-share/azure.storage.fileshare.aio.ShareFileClient.yml index e2363f42c735..058445cca2bb 100644 --- a/preview/docs-ref-autogen/azure-storage-file-share/azure.storage.fileshare.aio.ShareFileClient.yml +++ b/preview/docs-ref-autogen/azure-storage-file-share/azure.storage.fileshare.aio.ShareFileClient.yml @@ -405,15 +405,6 @@ methods: description: File-updated property dict (Etag and last modified). types: - (, ) - examples: - - "Create a file.\n\ - \n\n\n````python\n\ - \n # Create and allocate bytes for the file (no content added yet)\n await\ - \ my_allocated_file.create_file(size=100)\n\n ````\n" - uid: azure.storage.fileshare.aio.ShareFileClient.delete_file name: delete_file summary: 'Marks the specified file for deletion. The file is @@ -447,14 +438,6 @@ methods: return: types: - - examples: - - "Delete a file.\n\ - \n\n\n````python\n\ - \n await my_file.delete_file()\n\n ````\n" - uid: azure.storage.fileshare.aio.ShareFileClient.download_file name: download_file summary: 'Downloads a file to the StorageStreamDownloader. The readall() method @@ -541,15 +524,6 @@ methods: description: A streaming object (StorageStreamDownloader) types: - - examples: - - "Download a file.\n\ - \n\n\n````python\n\ - \n with open(DEST_FILE, \"wb\") as data:\n stream = await my_file.download_file()\n\ - \ data.write(await stream.readall())\n\n ````\n" - uid: azure.storage.fileshare.aio.ShareFileClient.get_file_properties name: get_file_properties summary: 'Returns all user-defined metadata, standard HTTP properties, and @@ -1099,14 +1073,6 @@ methods: return: types: - (, ) - examples: - - "Copy a file from a URL\n\n\n\n````python\n\ - \n await destination_file.start_copy_from_url(source_url=source_url)\n\n ````\n" - uid: azure.storage.fileshare.aio.ShareFileClient.upload_file name: upload_file summary: Uploads a new file. @@ -1257,15 +1223,6 @@ methods: description: File-updated property dict (Etag and last modified). types: - (, ) - examples: - - "Upload a file.\n\ - \n\n\n````python\n\ - \n with open(SOURCE_FILE, \"rb\") as source:\n await my_file.upload_file(source)\n\ - \n ````\n" - uid: azure.storage.fileshare.aio.ShareFileClient.upload_range name: upload_range summary: Upload a range of bytes to a file. diff --git a/preview/docs-ref-autogen/azure-storage-file-share/azure.storage.fileshare.aio.ShareServiceClient.yml b/preview/docs-ref-autogen/azure-storage-file-share/azure.storage.fileshare.aio.ShareServiceClient.yml index 10125d1dab53..d49cf4a2d338 100644 --- a/preview/docs-ref-autogen/azure-storage-file-share/azure.storage.fileshare.aio.ShareServiceClient.yml +++ b/preview/docs-ref-autogen/azure-storage-file-share/azure.storage.fileshare.aio.ShareServiceClient.yml @@ -89,17 +89,6 @@ constructor: description: The maximum range size used for a file upload. Defaults to 4*1024*1024. types: - -examples: -- "Create the share service client with url and credential.\n\n\n\n````python\n\n from azure.storage.fileshare.aio\ - \ import ShareServiceClient\n share_service_client = ShareServiceClient(\n \ - \ account_url=self.account_url,\n credential=self.access_key\n )\n\n\ - \ ````\n" methods: - uid: azure.storage.fileshare.aio.ShareServiceClient.create_share name: create_share @@ -140,14 +129,6 @@ methods: return: types: - - examples: - - "Create a share in the file share service.\n\n\n\n````python\n\ - \n await file_service.create_share(share_name=\"fileshare1\")\n\n ````\n" - uid: azure.storage.fileshare.aio.ShareServiceClient.delete_share name: delete_share summary: 'Marks the specified share for deletion. The share is @@ -184,14 +165,6 @@ methods: return: types: - - examples: - - "Delete a share in the file share service.\n\n\n\n````python\n\ - \n await file_service.delete_share(share_name=\"fileshare1\")\n\n ````\n" - uid: azure.storage.fileshare.aio.ShareServiceClient.get_service_properties name: get_service_properties summary: 'Gets the properties of a storage account''s File Share service, including @@ -217,14 +190,6 @@ methods: analytics logging, hour/minute metrics, cors rules, etc.' types: - [, ] - examples: - - "Get file share service properties.\n\n\n\n````python\n\ - \n properties = await file_service.get_service_properties()\n\n ````\n" - uid: azure.storage.fileshare.aio.ShareServiceClient.get_share_client name: get_share_client summary: 'Get a client to interact with the specified share. @@ -253,17 +218,6 @@ methods: description: A ShareClient. types: - - examples: - - "Gets the share client.\n\n\n\n````python\n\ - \n from azure.storage.fileshare.aio import ShareServiceClient\n file_service\ - \ = ShareServiceClient.from_connection_string(self.connection_string)\n\n #\ - \ Get a share client to interact with a specific share\n share = file_service.get_share_client(\"\ - fileshare2\")\n\n ````\n" - uid: azure.storage.fileshare.aio.ShareServiceClient.list_shares name: list_shares summary: 'Returns auto-paging iterable of dict-like ShareProperties under the specified @@ -314,16 +268,6 @@ methods: description: An iterable (auto-paging) of ShareProperties. types: - [] - examples: - - "List shares in the file share service.\n\n\n\n````python\n\ - \n # List the shares in the file service\n my_shares = []\n async for s\ - \ in file_service.list_shares():\n my_shares.append(s)\n\n # Print the\ - \ shares\n for share in my_shares:\n print(share)\n\n ````\n" - uid: azure.storage.fileshare.aio.ShareServiceClient.set_service_properties name: set_service_properties summary: 'Sets the properties of a storage account''s File Share service, including @@ -376,29 +320,6 @@ methods: return: types: - - examples: - - "Sets file share service properties.\n\n\n\n````python\n\ - \n # Create service properties\n from azure.storage.fileshare import Metrics,\ - \ CorsRule, RetentionPolicy\n\n # Create metrics for requests statistics\n \ - \ hour_metrics = Metrics(enabled=True, include_apis=True, retention_policy=RetentionPolicy(enabled=True,\ - \ days=5))\n minute_metrics = Metrics(enabled=True, include_apis=True,\n \ - \ retention_policy=RetentionPolicy(enabled=True, days=5))\n\ - \n # Create CORS rules\n cors_rule1 = CorsRule(['www.xyz.com'], ['GET'])\n\ - \ allowed_origins = ['www.xyz.com', \"www.ab.com\", \"www.bc.com\"]\n allowed_methods\ - \ = ['GET', 'PUT']\n max_age_in_seconds = 500\n exposed_headers = [\"x-ms-meta-data*\"\ - , \"x-ms-meta-source*\", \"x-ms-meta-abc\", \"x-ms-meta-bcd\"]\n allowed_headers\ - \ = [\"x-ms-meta-data*\", \"x-ms-meta-target*\", \"x-ms-meta-xyz\", \"x-ms-meta-foo\"\ - ]\n cors_rule2 = CorsRule(\n allowed_origins,\n allowed_methods,\n\ - \ max_age_in_seconds=max_age_in_seconds,\n exposed_headers=exposed_headers,\n\ - \ allowed_headers=allowed_headers)\n\n cors = [cors_rule1, cors_rule2]\n\ - \n async with file_service:\n # Set the service properties\n await\ - \ file_service.set_service_properties(hour_metrics, minute_metrics, cors)\n\n\ - \ ````\n" - uid: azure.storage.fileshare.aio.ShareServiceClient.undelete_share name: undelete_share summary: 'Restores soft-deleted share. diff --git a/preview/docs-ref-autogen/azure-storage-file-share/azure.storage.fileshare.yml b/preview/docs-ref-autogen/azure-storage-file-share/azure.storage.fileshare.yml index 919701f79b7c..6056c14f1bd0 100644 --- a/preview/docs-ref-autogen/azure-storage-file-share/azure.storage.fileshare.yml +++ b/preview/docs-ref-autogen/azure-storage-file-share/azure.storage.fileshare.yml @@ -100,20 +100,6 @@ functions: description: A Shared Access Signature (sas) token. types: - - examples: - - "Generate a sas token.\n\n\n\n````python\n\ - \n from azure.storage.fileshare import ShareServiceClient\n share_service_client\ - \ = ShareServiceClient.from_connection_string(self.connection_string)\n\n #\ - \ Create a SAS token to use to authenticate a new client\n from azure.storage.fileshare\ - \ import generate_account_sas, ResourceTypes, AccountSasPermissions\n\n sas_token\ - \ = generate_account_sas(\n self.account_name,\n self.access_key,\n\ - \ resource_types=ResourceTypes(service=True),\n permission=AccountSasPermissions(read=True),\n\ - \ expiry=datetime.utcnow() + timedelta(hours=1)\n )\n\n ````\n" - uid: azure.storage.fileshare.generate_file_sas name: generate_file_sas summary: 'Generates a shared access signature for a file. diff --git a/preview/docs-ref-autogen/azure-storage-queue/azure.storage.queue.QueueClient.yml b/preview/docs-ref-autogen/azure-storage-queue/azure.storage.queue.QueueClient.yml index 0bbf15570ce0..713a337e2829 100644 --- a/preview/docs-ref-autogen/azure-storage-queue/azure.storage.queue.QueueClient.yml +++ b/preview/docs-ref-autogen/azure-storage-queue/azure.storage.queue.QueueClient.yml @@ -76,15 +76,6 @@ constructor: Default value is not to decode messages. Other options include , or *None*.' -examples: -- "Create the queue client with url and credential.\n\n\n\n````python\n\n token_auth_queue\ - \ = QueueClient.from_queue_url(\n queue_url=queue.url,\n credential=sas_token\n\ - \ )\n\n ````\n" methods: - uid: azure.storage.queue.QueueClient.clear_messages name: clear_messages @@ -103,14 +94,6 @@ methods: see [here](https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/storage/azure-storage-queue#other-client--per-operation-configuration).' types: - - examples: - - "Clears all messages.\n\ - \n\n\n````python\n\ - \n queue.clear_messages()\n\n ````\n" - uid: azure.storage.queue.QueueClient.create_queue name: create_queue summary: 'Creates a new queue in the storage account. @@ -147,14 +130,6 @@ methods: - exceptions: - type: StorageErrorException - examples: - - "Create a queue.\n\ - \n\n\n````python\n\ - \n queue.create_queue()\n\n ````\n" - uid: azure.storage.queue.QueueClient.delete_message name: delete_message summary: 'Deletes the specified message. @@ -209,15 +184,6 @@ methods: see [here](https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/storage/azure-storage-queue#other-client--per-operation-configuration).' types: - - examples: - - "Delete a message.\n\ - \n\n\n````python\n\ - \n # Get the message at the front of the queue\n msg = next(queue.receive_messages())\n\ - \n # Delete the specified message\n queue.delete_message(msg)\n\n ````\n" - uid: azure.storage.queue.QueueClient.delete_queue name: delete_queue summary: 'Deletes the specified queue and any messages it contains. @@ -252,14 +218,6 @@ methods: return: types: - - examples: - - "Delete a queue.\n\ - \n\n\n````python\n\ - \n queue.delete_queue()\n\n ````\n" - uid: azure.storage.queue.QueueClient.from_connection_string name: from_connection_string summary: Create QueueClient from a Connection String. @@ -302,16 +260,6 @@ methods: description: A queue client. types: - - examples: - - "Create the queue client from connection string.\n\n\n\n````python\n\n from azure.storage.queue import QueueClient\n\ - \ queue = QueueClient.from_connection_string(self.connection_string, \"myqueue1\"\ - )\n\n ````\n" - uid: azure.storage.queue.QueueClient.from_queue_url name: from_queue_url summary: A client to interact with a specific Queue. @@ -388,14 +336,6 @@ methods: description: User-defined metadata for the queue. types: - - examples: - - "Get the properties on the queue.\n\n\n\n````python\n\ - \n properties = queue.get_queue_properties().metadata\n\n ````\n" - uid: azure.storage.queue.QueueClient.peek_messages name: peek_messages summary: 'Retrieves one or more messages from the front of the queue, but does @@ -454,17 +394,6 @@ methods: not pop the message and can only retrieve already visible messages.' types: - () - examples: - - "Peek messages.\n\n\ - \n\n````python\n\ - \n # Peek at one message at the front of the queue\n msg = queue.peek_messages()\n\ - \n # Peek at the last 5 messages\n messages = queue.peek_messages(max_messages=5)\n\ - \n # Print the last 5 messages\n for message in messages:\n print(message.content)\n\ - \n ````\n" - uid: azure.storage.queue.QueueClient.receive_message name: receive_message summary: 'Removes one message from the front of the queue. @@ -517,17 +446,6 @@ methods: description: Returns a message from the Queue. types: - - examples: - - "Receive one message from the queue.\n\n\n\n````python\n\ - \n # Pop two messages from the front of the queue\n message1 = queue.receive_message()\n\ - \ message2 = queue.receive_message()\n # We should see message 3 if we peek\n\ - \ message3 = queue.peek_messages()[0]\n\n print(message1.content)\n print(message2.content)\n\ - \ print(message3.content)\n\n ````\n" - uid: azure.storage.queue.QueueClient.receive_messages name: receive_messages summary: 'Removes one or more messages from the front of the queue. @@ -589,18 +507,6 @@ methods: description: Returns a message iterator of dict-like Message objects. types: - [] - examples: - - "Receive messages from the queue.\n\n\n\n````python\n\ - \n # Receive messages one-by-one\n messages = queue.receive_messages()\n \ - \ for msg in messages:\n print(msg.content)\n\n # Receive messages by\ - \ batch\n messages = queue.receive_messages(messages_per_page=5)\n for msg_batch\ - \ in messages.by_page():\n for msg in msg_batch:\n print(msg.content)\n\ - \ queue.delete_message(msg)\n\n ````\n" - uid: azure.storage.queue.QueueClient.send_message name: send_message summary: 'Adds a new message to the back of the message queue. @@ -678,17 +584,6 @@ methods: returned from the service.' types: - - examples: - - "Send messages.\n\n\ - \n\n````python\n\ - \n queue.send_message(\"message1\")\n queue.send_message(\"message2\", visibility_timeout=30)\ - \ # wait 30s before becoming visible\n queue.send_message(\"message3\")\n \ - \ queue.send_message(\"message4\")\n queue.send_message(\"message5\")\n\n \ - \ ````\n" - uid: azure.storage.queue.QueueClient.set_queue_access_policy name: set_queue_access_policy summary: 'Sets stored access policies for the queue that may be used with Shared @@ -739,19 +634,6 @@ methods: see [here](https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/storage/azure-storage-queue#other-client--per-operation-configuration).' types: - - examples: - - "Set an access policy on the queue.\n\n\n\n````python\n\ - \n # Create an access policy\n from azure.storage.queue import AccessPolicy,\ - \ QueueSasPermissions\n access_policy = AccessPolicy()\n access_policy.start\ - \ = datetime.utcnow() - timedelta(hours=1)\n access_policy.expiry = datetime.utcnow()\ - \ + timedelta(hours=1)\n access_policy.permission = QueueSasPermissions(read=True)\n\ - \ identifiers = {'my-access-policy-id': access_policy}\n\n # Set the access\ - \ policy\n queue.set_queue_access_policy(identifiers)\n\n ````\n" - uid: azure.storage.queue.QueueClient.set_queue_metadata name: set_queue_metadata summary: 'Sets user-defined metadata on the specified queue. @@ -780,15 +662,6 @@ methods: see [here](https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/storage/azure-storage-queue#other-client--per-operation-configuration).' types: - - examples: - - "Set metadata on the queue.\n\n\n\n````python\n\ - \n metadata = {'foo': 'val1', 'bar': 'val2', 'baz': 'val3'}\n queue.set_queue_metadata(metadata=metadata)\n\ - \n ````\n" - uid: azure.storage.queue.QueueClient.update_message name: update_message summary: 'Updates the visibility timeout of a message. You can also use this @@ -872,15 +745,3 @@ methods: by the service.' types: - - examples: - - "Update a message.\n\ - \n\n\n````python\n\ - \n # Send a message\n queue.send_message(\"update me\")\n\n # Receive the\ - \ message\n messages = queue.receive_messages()\n\n # Update the message\n\ - \ list_result = next(messages)\n message = queue.update_message(\n list_result.id,\n\ - \ pop_receipt=list_result.pop_receipt,\n visibility_timeout=0,\n \ - \ content=\"updated\")\n\n ````\n" diff --git a/preview/docs-ref-autogen/azure-storage-queue/azure.storage.queue.QueueServiceClient.yml b/preview/docs-ref-autogen/azure-storage-queue/azure.storage.queue.QueueServiceClient.yml index 281355f989f9..795a23c5bc1c 100644 --- a/preview/docs-ref-autogen/azure-storage-queue/azure.storage.queue.QueueServiceClient.yml +++ b/preview/docs-ref-autogen/azure-storage-queue/azure.storage.queue.QueueServiceClient.yml @@ -70,28 +70,6 @@ constructor: description: The hostname of the secondary endpoint. types: - -examples: -- "Creating the QueueServiceClient with an account url and credential.\n\n\n\n````python\n\n from azure.storage.queue import QueueServiceClient\n\ - \ queue_service = QueueServiceClient(account_url=self.account_url, credential=self.access_key)\n\ - \n ````\n\nCreating the QueueServiceClient with Azure Identity credentials.\n\n\n\n````python\n\n # Get a token credential for authentication\n \ - \ from azure.identity import ClientSecretCredential\n token_credential = ClientSecretCredential(\n\ - \ self.active_directory_tenant_id,\n self.active_directory_application_id,\n\ - \ self.active_directory_application_secret\n )\n\n # Instantiate a QueueServiceClient\ - \ using a token credential\n from azure.storage.queue import QueueServiceClient\n\ - \ queue_service = QueueServiceClient(account_url=self.account_url, credential=token_credential)\n\ - \n ````\n" methods: - uid: azure.storage.queue.QueueServiceClient.create_queue name: create_queue @@ -123,14 +101,6 @@ methods: return: types: - - examples: - - "Create a queue in the service.\n\n\n\n````python\n\ - \n queue_service.create_queue(\"myqueue1\")\n\n ````\n" - uid: azure.storage.queue.QueueServiceClient.delete_queue name: delete_queue summary: 'Deletes the specified queue and any messages it contains. @@ -165,14 +135,6 @@ methods: return: types: - - examples: - - "Delete a queue in the service.\n\n\n\n````python\n\ - \n queue_service.delete_queue(\"myqueue1\")\n\n ````\n" - uid: azure.storage.queue.QueueServiceClient.from_connection_string name: from_connection_string summary: Create QueueServiceClient from a Connection String. @@ -210,16 +172,6 @@ methods: description: A Queue service client. types: - - examples: - - "Creating the QueueServiceClient with a connection string.\n\n\n\n````python\n\n from azure.storage.queue import QueueServiceClient\n\ - \ queue_service = QueueServiceClient.from_connection_string(conn_str=self.connection_string)\n\ - \n ````\n" - uid: azure.storage.queue.QueueServiceClient.get_queue_client name: get_queue_client summary: 'Get a client to interact with the specified queue. @@ -240,15 +192,6 @@ methods: description: A object. types: - - examples: - - "Get the queue client.\n\ - \n\n\n````python\n\ - \n # Get the queue client to interact with a specific queue\n queue = queue_service.get_queue_client(queue=\"\ - myqueue2\")\n\n ````\n" - uid: azure.storage.queue.QueueServiceClient.get_service_properties name: get_service_properties summary: 'Gets the properties of a storage account''s Queue service, including @@ -266,14 +209,6 @@ methods: analytics logging, hour/minute metrics, cors rules, etc.' types: - [, ] - examples: - - "Getting queue service properties.\n\n\n\n````python\n\ - \n properties = queue_service.get_service_properties()\n\n ````\n" - uid: azure.storage.queue.QueueServiceClient.get_service_stats name: get_service_stats summary: 'Retrieves statistics related to replication for the Queue service. @@ -367,17 +302,6 @@ methods: description: An iterable (auto-paging) of QueueProperties. types: - [] - examples: - - "List queues in the service.\n\n\n\n````python\n\ - \n # List all the queues in the service\n list_queues = queue_service.list_queues()\n\ - \ for queue in list_queues:\n print(queue)\n\n # List the queues in\ - \ the service that start with the name \"my\"\n list_my_queues = queue_service.list_queues(name_starts_with=\"\ - my\")\n for queue in list_my_queues:\n print(queue)\n\n ````\n" - uid: azure.storage.queue.QueueServiceClient.set_service_properties name: set_service_properties summary: 'Sets the properties of a storage account''s Queue service, including @@ -427,26 +351,3 @@ methods: return: types: - - examples: - - "Setting queue service properties.\n\n\n\n````python\n\ - \n # Create service properties\n from azure.storage.queue import QueueAnalyticsLogging,\ - \ Metrics, CorsRule, RetentionPolicy\n\n # Create logging settings\n logging\ - \ = QueueAnalyticsLogging(read=True, write=True, delete=True, retention_policy=RetentionPolicy(enabled=True,\ - \ days=5))\n\n # Create metrics for requests statistics\n hour_metrics = Metrics(enabled=True,\ - \ include_apis=True, retention_policy=RetentionPolicy(enabled=True, days=5))\n\ - \ minute_metrics = Metrics(enabled=True, include_apis=True, retention_policy=RetentionPolicy(enabled=True,\ - \ days=5))\n\n # Create CORS rules\n cors_rule1 = CorsRule(['www.xyz.com'],\ - \ ['GET'])\n allowed_origins = ['www.xyz.com', \"www.ab.com\", \"www.bc.com\"\ - ]\n allowed_methods = ['GET', 'PUT']\n max_age_in_seconds = 500\n exposed_headers\ - \ = [\"x-ms-meta-data*\", \"x-ms-meta-source*\", \"x-ms-meta-abc\", \"x-ms-meta-bcd\"\ - ]\n allowed_headers = [\"x-ms-meta-data*\", \"x-ms-meta-target*\", \"x-ms-meta-xyz\"\ - , \"x-ms-meta-foo\"]\n cors_rule2 = CorsRule(\n allowed_origins,\n \ - \ allowed_methods,\n max_age_in_seconds=max_age_in_seconds,\n exposed_headers=exposed_headers,\n\ - \ allowed_headers=allowed_headers\n )\n\n cors = [cors_rule1, cors_rule2]\n\ - \n # Set the service properties\n queue_service.set_service_properties(logging,\ - \ hour_metrics, minute_metrics, cors)\n\n ````\n" diff --git a/preview/docs-ref-autogen/azure-storage-queue/azure.storage.queue.aio.QueueClient.yml b/preview/docs-ref-autogen/azure-storage-queue/azure.storage.queue.aio.QueueClient.yml index e31794173d58..cb7ecb90a7a9 100644 --- a/preview/docs-ref-autogen/azure-storage-queue/azure.storage.queue.aio.QueueClient.yml +++ b/preview/docs-ref-autogen/azure-storage-queue/azure.storage.queue.aio.QueueClient.yml @@ -72,23 +72,6 @@ constructor: Default value is not to decode messages. Other options include , or *None*.' -examples: -- "Create the queue client with url and credential.\n\n\n\n````python\n\n token_auth_queue\ - \ = QueueClient.from_queue_url(\n queue_url=queue.url,\n credential=sas_token\n\ - \ )\n\n ````\n\nCreate the queue client with a connection string.\n\n\n\n````python\n\n from azure.storage.queue.aio import QueueClient\n\ - \ queue = QueueClient.from_connection_string(self.connection_string, \"myqueue1\"\ - )\n\n ````\n" methods: - uid: azure.storage.queue.aio.QueueClient.clear_messages name: clear_messages @@ -107,14 +90,6 @@ methods: see [here](https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/storage/azure-storage-queue#other-client--per-operation-configuration).' types: - - examples: - - "Clears all messages.\n\n\n\n````python\n\ - \n await queue.clear_messages()\n\n ````\n" - uid: azure.storage.queue.aio.QueueClient.create_queue name: create_queue summary: 'Creates a new queue in the storage account. @@ -151,14 +126,6 @@ methods: - exceptions: - type: StorageErrorException - examples: - - "Create a queue.\n\n\n\n````python\n\ - \n await queue.create_queue()\n\n ````\n" - uid: azure.storage.queue.aio.QueueClient.delete_message name: delete_message summary: 'Deletes the specified message. @@ -213,16 +180,6 @@ methods: see [here](https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/storage/azure-storage-queue#other-client--per-operation-configuration).' types: - - examples: - - "Delete a message.\n\n\n\n````python\n\ - \n # Get the message at the front of the queue\n messages = queue.receive_messages()\n\ - \ async for msg in messages:\n # Delete the specified message\n \ - \ await queue.delete_message(msg)\n\n ````\n" - uid: azure.storage.queue.aio.QueueClient.delete_queue name: delete_queue summary: 'Deletes the specified queue and any messages it contains. @@ -257,14 +214,6 @@ methods: return: types: - - examples: - - "Delete a queue.\n\n\n\n````python\n\ - \n await queue.delete_queue()\n\n ````\n" - uid: azure.storage.queue.aio.QueueClient.get_queue_access_policy name: get_queue_access_policy summary: 'Returns details about any stored access policies specified on the @@ -304,14 +253,6 @@ methods: description: User-defined metadata for the queue. types: - - examples: - - "Get the properties on the queue.\n\n\n\n````python\n\ - \n properties = await queue.get_queue_properties()\n\n ````\n" - uid: azure.storage.queue.aio.QueueClient.peek_messages name: peek_messages summary: 'Retrieves one or more messages from the front of the queue, but does @@ -371,17 +312,6 @@ methods: not pop the message and can only retrieve already visible messages.' types: - () - examples: - - "Peek messages.\n\ - \n\n\n````python\n\ - \n # Peek at one message at the front of the queue\n msg = await queue.peek_messages()\n\ - \n # Peek at the last 5 messages\n messages = await queue.peek_messages(max_messages=5)\n\ - \n # Print the last 5 messages\n for message in messages:\n print(message.content)\n\ - \n ````\n" - uid: azure.storage.queue.aio.QueueClient.receive_message name: receive_message summary: 'Removes one message from the front of the queue. @@ -434,18 +364,6 @@ methods: description: Returns a message from the Queue. types: - - examples: - - "Receive one message from the queue.\n\n\n\n````python\n\ - \n # Pop two messages from the front of the queue\n message1 = await\ - \ queue.receive_message()\n message2 = await queue.receive_message()\n \ - \ # We should see message 3 if we peek\n message3 = await queue.peek_messages()\n\ - \n print(message1.content)\n print(message2.content)\n print(message3[0].content)\n\ - \n ````\n" - uid: azure.storage.queue.aio.QueueClient.receive_messages name: receive_messages summary: 'Removes one or more messages from the front of the queue. @@ -522,18 +440,6 @@ methods: description: Returns a message iterator of dict-like Message objects. types: - [] - examples: - - "Receive messages from the queue.\n\n\n\n````python\n\ - \n # Receive messages one-by-one\n messages = queue.receive_messages()\n \ - \ async for msg in messages:\n print(msg.content)\n\n # Receive messages\ - \ by batch\n messages = queue.receive_messages(messages_per_page=5)\n async\ - \ for msg_batch in messages.by_page():\n for msg in msg_batch:\n \ - \ print(msg.content)\n await queue.delete_message(msg)\n\n ````\n" - uid: azure.storage.queue.aio.QueueClient.send_message name: send_message summary: 'Adds a new message to the back of the message queue. @@ -611,17 +517,6 @@ methods: returned from the service.' types: - - examples: - - "Send messages.\n\ - \n\n\n````python\n\ - \n await asyncio.gather(\n queue.send_message(\"message1\"),\n queue.send_message(\"\ - message2\", visibility_timeout=30), # wait 30s before becoming visible\n \ - \ queue.send_message(\"message3\"),\n queue.send_message(\"message4\"\ - ),\n queue.send_message(\"message5\")\n )\n\n ````\n" - uid: azure.storage.queue.aio.QueueClient.set_queue_access_policy name: set_queue_access_policy summary: 'Sets stored access policies for the queue that may be used with Shared @@ -673,19 +568,6 @@ methods: see [here](https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/storage/azure-storage-queue#other-client--per-operation-configuration).' types: - - examples: - - "Set an access policy on the queue.\n\n\n\n````python\n\ - \n # Create an access policy\n from azure.storage.queue import AccessPolicy,\ - \ QueueSasPermissions\n access_policy = AccessPolicy()\n access_policy.start\ - \ = datetime.utcnow() - timedelta(hours=1)\n access_policy.expiry = datetime.utcnow()\ - \ + timedelta(hours=1)\n access_policy.permission = QueueSasPermissions(read=True)\n\ - \ identifiers = {'my-access-policy-id': access_policy}\n\n # Set the access\ - \ policy\n await queue.set_queue_access_policy(identifiers)\n\n ````\n" - uid: azure.storage.queue.aio.QueueClient.set_queue_metadata name: set_queue_metadata summary: 'Sets user-defined metadata on the specified queue. @@ -714,15 +596,6 @@ methods: see [here](https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/storage/azure-storage-queue#other-client--per-operation-configuration).' types: - - examples: - - "Set metadata on the queue.\n\n\n\n````python\n\ - \n metadata = {'foo': 'val1', 'bar': 'val2', 'baz': 'val3'}\n await queue.set_queue_metadata(metadata=metadata)\n\ - \n ````\n" - uid: azure.storage.queue.aio.QueueClient.update_message name: update_message summary: 'Updates the visibility timeout of a message. You can also use this @@ -806,15 +679,3 @@ methods: by the service.' types: - - examples: - - "Update a message.\n\n\n\n````python\n\ - \n # Send a message\n await queue.send_message(\"update me\")\n\n # Receive\ - \ the message\n messages = queue.receive_messages()\n\n # Update the message\n\ - \ async for message in messages:\n message = await queue.update_message(\n\ - \ message,\n visibility_timeout=0,\n content=\"\ - updated\")\n\n ````\n" diff --git a/preview/docs-ref-autogen/azure-storage-queue/azure.storage.queue.aio.QueueServiceClient.yml b/preview/docs-ref-autogen/azure-storage-queue/azure.storage.queue.aio.QueueServiceClient.yml index b6627f606926..cc1269bda0c8 100644 --- a/preview/docs-ref-autogen/azure-storage-queue/azure.storage.queue.aio.QueueServiceClient.yml +++ b/preview/docs-ref-autogen/azure-storage-queue/azure.storage.queue.aio.QueueServiceClient.yml @@ -66,28 +66,6 @@ constructor: description: The hostname of the secondary endpoint. types: - -examples: -- "Creating the QueueServiceClient with an account url and credential.\n\n\n\n````python\n\n from azure.storage.queue.aio import\ - \ QueueServiceClient\n queue_service = QueueServiceClient(account_url=self.account_url,\ - \ credential=self.access_key)\n\n ````\n\nCreating the QueueServiceClient with\ - \ Azure Identity credentials.\n\n\n\n````python\n\n # Get a token\ - \ credential for authentication\n from azure.identity.aio import ClientSecretCredential\n\ - \ token_credential = ClientSecretCredential(\n self.active_directory_tenant_id,\n\ - \ self.active_directory_application_id,\n self.active_directory_application_secret\n\ - \ )\n\n # Instantiate a QueueServiceClient using a token credential\n from\ - \ azure.storage.queue.aio import QueueServiceClient\n queue_service = QueueServiceClient(account_url=self.account_url,\ - \ credential=token_credential)\n\n ````\n" methods: - uid: azure.storage.queue.aio.QueueServiceClient.create_queue name: create_queue @@ -119,14 +97,6 @@ methods: return: types: - - examples: - - "Create a queue in the service.\n\n\n\n````python\n\ - \n await queue_service.create_queue(\"myqueue1\")\n\n ````\n" - uid: azure.storage.queue.aio.QueueServiceClient.delete_queue name: delete_queue summary: 'Deletes the specified queue and any messages it contains. @@ -161,14 +131,6 @@ methods: return: types: - - examples: - - "Delete a queue in the service.\n\n\n\n````python\n\ - \n await queue_service.delete_queue(\"myqueue1\")\n\n ````\n" - uid: azure.storage.queue.aio.QueueServiceClient.get_queue_client name: get_queue_client summary: 'Get a client to interact with the specified queue. @@ -190,15 +152,6 @@ methods: description: A object. types: - - examples: - - "Get the queue client.\n\n\n\n````python\n\ - \n # Get the queue client to interact with a specific queue\n queue = queue_service.get_queue_client(queue=\"\ - myqueue2\")\n\n ````\n" - uid: azure.storage.queue.aio.QueueServiceClient.get_service_properties name: get_service_properties summary: 'Gets the properties of a storage account''s Queue service, including @@ -216,14 +169,6 @@ methods: analytics logging, hour/minute metrics, cors rules, etc.' types: - [, ] - examples: - - "Getting queue service properties.\n\n\n\n````python\n\ - \n properties = await queue_service.get_service_properties()\n\n ````\n" - uid: azure.storage.queue.aio.QueueServiceClient.get_service_stats name: get_service_stats summary: 'Retrieves statistics related to replication for the Queue service. @@ -317,17 +262,6 @@ methods: description: An iterable (auto-paging) of QueueProperties. types: - [] - examples: - - "List queues in the service.\n\n\n\n````python\n\ - \n # List all the queues in the service\n list_queues = queue_service.list_queues()\n\ - \ async for queue in list_queues:\n print(queue)\n\n # List the queues\ - \ in the service that start with the name \"my_\"\n list_my_queues = queue_service.list_queues(name_starts_with=\"\ - my_\")\n async for queue in list_my_queues:\n print(queue)\n\n ````\n" - uid: azure.storage.queue.aio.QueueServiceClient.set_service_properties name: set_service_properties summary: 'Sets the properties of a storage account''s Queue service, including @@ -377,26 +311,3 @@ methods: return: types: - - examples: - - "Setting queue service properties.\n\n\n\n````python\n\ - \n # Create service properties\n from azure.storage.queue import QueueAnalyticsLogging,\ - \ Metrics, CorsRule, RetentionPolicy\n\n # Create logging settings\n logging\ - \ = QueueAnalyticsLogging(read=True, write=True, delete=True, retention_policy=RetentionPolicy(enabled=True,\ - \ days=5))\n\n # Create metrics for requests statistics\n hour_metrics = Metrics(enabled=True,\ - \ include_apis=True, retention_policy=RetentionPolicy(enabled=True, days=5))\n\ - \ minute_metrics = Metrics(enabled=True, include_apis=True, retention_policy=RetentionPolicy(enabled=True,\ - \ days=5))\n\n # Create CORS rules\n cors_rule1 = CorsRule(['www.xyz.com'],\ - \ ['GET'])\n allowed_origins = ['www.xyz.com', \"www.ab.com\", \"www.bc.com\"\ - ]\n allowed_methods = ['GET', 'PUT']\n max_age_in_seconds = 500\n exposed_headers\ - \ = [\"x-ms-meta-data*\", \"x-ms-meta-source*\", \"x-ms-meta-abc\", \"x-ms-meta-bcd\"\ - ]\n allowed_headers = [\"x-ms-meta-data*\", \"x-ms-meta-target*\", \"x-ms-meta-xyz\"\ - , \"x-ms-meta-foo\"]\n cors_rule2 = CorsRule(\n allowed_origins,\n \ - \ allowed_methods,\n max_age_in_seconds=max_age_in_seconds,\n exposed_headers=exposed_headers,\n\ - \ allowed_headers=allowed_headers\n )\n\n cors = [cors_rule1, cors_rule2]\n\ - \n # Set the service properties\n await queue_service.set_service_properties(logging,\ - \ hour_metrics, minute_metrics, cors)\n\n ````\n" diff --git a/preview/docs-ref-autogen/azure-storage-queue/azure.storage.queue.yml b/preview/docs-ref-autogen/azure-storage-queue/azure.storage.queue.yml index 6ff0f7283b59..fc5c521104d5 100644 --- a/preview/docs-ref-autogen/azure-storage-queue/azure.storage.queue.yml +++ b/preview/docs-ref-autogen/azure-storage-queue/azure.storage.queue.yml @@ -196,16 +196,6 @@ functions: description: A Shared Access Signature (sas) token. types: - - examples: - - "Generate a sas token.\n\ - \n\n\n````python\n\ - \n from azure.storage.queue import generate_queue_sas\n sas_token = generate_queue_sas(\n\ - \ queue.account_name,\n queue.queue_name,\n queue.credential.account_key,\n\ - \ policy_id='my-access-policy-id'\n )\n\n ````\n" classes: - azure.storage.queue.AccessPolicy - azure.storage.queue.AccountSasPermissions