From 514c4cc9b6b2a8baf3861f7b1897ebb3d3583e17 Mon Sep 17 00:00:00 2001 From: Ahson Khan Date: Mon, 13 Jan 2025 23:20:02 -0800 Subject: [PATCH] Add samples for AppConfig Pageable GetLabels with comparisons of what we'd expect the user experience to be. (#6338) --- .../samples/appconfig_basic_operation.cpp | 63 +++++++++++++++++++ 1 file changed, 63 insertions(+) diff --git a/sdk/appconfiguration/azure-data-appconfiguration/samples/appconfig_basic_operation.cpp b/sdk/appconfiguration/azure-data-appconfiguration/samples/appconfig_basic_operation.cpp index d72d6bc3c..b6b3f09e9 100644 --- a/sdk/appconfiguration/azure-data-appconfiguration/samples/appconfig_basic_operation.cpp +++ b/sdk/appconfiguration/azure-data-appconfiguration/samples/appconfig_basic_operation.cpp @@ -14,6 +14,66 @@ using namespace Azure::Data::AppConfiguration; using namespace Azure::Identity; +// Retreive labels based on filters +static void RetreiveLabels(ConfigurationClient& configurationClient) +{ + // Current + + { + GetLabelsOptions options; + // To get all labels, don't set Name or use the any wildcard ("*"). + options.Name = "production*"; + options.AcceptDatetime = "Fri, 10 Jan 2025 00:00:00 GMT"; + + for (GetLabelsPagedResponse labelsPage = configurationClient.GetLabels("accept", options); + labelsPage.HasPage(); + labelsPage.MoveToNextPage()) + { + if (labelsPage.Items.HasValue()) + { + std::vector