Skip to content

Commit

Permalink
add label to codesnappet (#34653)
Browse files Browse the repository at this point in the history
  • Loading branch information
mssfang authored Apr 26, 2023
1 parent 2e026a3 commit c3a1728
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ public Mono<Response<ConfigurationSetting>> setConfigurationSettingWithResponse(
*
* <!-- src_embed com.azure.data.appconfiguration.configurationasyncclient.getConfigurationSetting#string-string -->
* <pre>
* client.getConfigurationSetting&#40;&quot;prodDBConnection&quot;, null&#41;
* client.getConfigurationSetting&#40;&quot;prodDBConnection&quot;, &quot;westUS&quot;&#41;
* .subscribe&#40;response -&gt; System.out.printf&#40;&quot;Key: %s, Label: %s, Value: %s&quot;,
* response.getKey&#40;&#41;, response.getLabel&#40;&#41;, response.getValue&#40;&#41;&#41;&#41;;
* </pre>
Expand Down Expand Up @@ -371,7 +371,7 @@ public Mono<ConfigurationSetting> getConfigurationSetting(String key, String lab
* <!-- src_embed com.azure.data.appconfiguration.configurationasyncclient.getConfigurationSetting#string-string-OffsetDateTime -->
* <pre>
* client.getConfigurationSetting&#40;
* &quot;prodDBConnection&quot;, null, OffsetDateTime.now&#40;ZoneOffset.UTC&#41;.minusMinutes&#40;1&#41;&#41;
* &quot;prodDBConnection&quot;, &quot;westUS&quot;, OffsetDateTime.now&#40;ZoneOffset.UTC&#41;.minusMinutes&#40;1&#41;&#41;
* .subscribe&#40;response -&gt; System.out.printf&#40;&quot;Key: %s, Label: %s, Value: %s&quot;,
* response.getKey&#40;&#41;, response.getLabel&#40;&#41;, response.getValue&#40;&#41;&#41;&#41;;
* </pre>
Expand Down Expand Up @@ -495,7 +495,7 @@ public Mono<Response<ConfigurationSetting>> getConfigurationSettingWithResponse(
*
* <!-- src_embed com.azure.data.appconfiguration.configurationasyncclient.deleteConfigurationSetting#string-string -->
* <pre>
* client.deleteConfigurationSetting&#40;&quot;prodDBConnection&quot;, null&#41;
* client.deleteConfigurationSetting&#40;&quot;prodDBConnection&quot;, &quot;westUS&quot;&#41;
* .subscribe&#40;response -&gt; System.out.printf&#40;&quot;Key: %s, Label: %s, Value: %s&quot;,
* response.getKey&#40;&#41;, response.getLabel&#40;&#41;, response.getValue&#40;&#41;&#41;&#41;;
* </pre>
Expand Down Expand Up @@ -530,7 +530,7 @@ public Mono<ConfigurationSetting> deleteConfigurationSetting(String key, String
*
* <!-- src_embed com.azure.data.appconfiguration.configurationasyncclient.deleteConfigurationSetting#ConfigurationSetting -->
* <pre>
* client.deleteConfigurationSetting&#40;new ConfigurationSetting&#40;&#41;.setKey&#40;&quot;prodDBConnection&quot;&#41;&#41;
* client.deleteConfigurationSetting&#40;new ConfigurationSetting&#40;&#41;.setKey&#40;&quot;prodDBConnection&quot;&#41;.setLabel&#40;&quot;westUS&quot;&#41;&#41;
* .subscribe&#40;response -&gt; System.out.printf&#40;&quot;Key: %s, Label: %s, Value: %s&quot;,
* response.getKey&#40;&#41;, response.getValue&#40;&#41;&#41;&#41;;
* </pre>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ public Response<ConfigurationSetting> setConfigurationSettingWithResponse(Config
* <!-- src_embed com.azure.data.applicationconfig.configurationclient.getConfigurationSetting#string-string -->
* <pre>
* ConfigurationSetting resultNoDateTime =
* configurationClient.getConfigurationSetting&#40;&quot;prodDBConnection&quot;, null&#41;;
* configurationClient.getConfigurationSetting&#40;&quot;prodDBConnection&quot;, &quot;westUS&quot;&#41;;
* System.out.printf&#40;&quot;Key: %s, Value: %s&quot;, resultNoDateTime.getKey&#40;&#41;, resultNoDateTime.getValue&#40;&#41;&#41;;
* </pre>
* <!-- end com.azure.data.applicationconfig.configurationclient.getConfigurationSetting#string-string -->
Expand Down Expand Up @@ -377,7 +377,7 @@ public ConfigurationSetting getConfigurationSetting(String key, String label) {
* <!-- src_embed com.azure.data.applicationconfig.configurationclient.getConfigurationSetting#string-string-OffsetDateTime -->
* <pre>
* ConfigurationSetting result =
* configurationClient.getConfigurationSetting&#40;&quot;prodDBConnection&quot;, null, null&#41;;
* configurationClient.getConfigurationSetting&#40;&quot;prodDBConnection&quot;, &quot;westUS&quot;, null&#41;;
* System.out.printf&#40;&quot;Key: %s, Value: %s&quot;, result.getKey&#40;&#41;, result.getValue&#40;&#41;&#41;;
* </pre>
* <!-- end com.azure.data.applicationconfig.configurationclient.getConfigurationSetting#string-string-OffsetDateTime -->
Expand Down Expand Up @@ -412,7 +412,7 @@ public ConfigurationSetting getConfigurationSetting(String key, String label, Of
* <!-- src_embed com.azure.data.applicationconfig.configurationclient.getConfigurationSetting#ConfigurationSetting -->
* <pre>
* ConfigurationSetting setting = configurationClient.getConfigurationSetting&#40;
* new ConfigurationSetting&#40;&#41;.setKey&#40;&quot;prodDBConnection&quot;&#41;&#41;;
* new ConfigurationSetting&#40;&#41;.setKey&#40;&quot;prodDBConnection&quot;&#41;.setLabel&#40;&quot;westUS&quot;&#41;&#41;;
* System.out.printf&#40;&quot;Key: %s, Value: %s&quot;, setting.getKey&#40;&#41;, setting.getValue&#40;&#41;&#41;;
* </pre>
* <!-- end com.azure.data.applicationconfig.configurationclient.getConfigurationSetting#ConfigurationSetting -->
Expand Down Expand Up @@ -497,7 +497,7 @@ public Response<ConfigurationSetting> getConfigurationSettingWithResponse(Config
*
* <!-- src_embed com.azure.data.applicationconfig.configurationclient.deleteConfigurationSetting#string-string -->
* <pre>
* ConfigurationSetting result = configurationClient.deleteConfigurationSetting&#40;&quot;prodDBConnection&quot;, null&#41;;
* ConfigurationSetting result = configurationClient.deleteConfigurationSetting&#40;&quot;prodDBConnection&quot;, &quot;westUS&quot;&#41;;
* System.out.printf&#40;&quot;Key: %s, Value: %s&quot;, result.getKey&#40;&#41;, result.getValue&#40;&#41;&#41;;
* </pre>
* <!-- end com.azure.data.applicationconfig.configurationclient.deleteConfigurationSetting#string-string -->
Expand Down Expand Up @@ -530,7 +530,7 @@ public ConfigurationSetting deleteConfigurationSetting(String key, String label)
* <!-- src_embed com.azure.data.applicationconfig.configurationclient.deleteConfigurationSetting#ConfigurationSetting -->
* <pre>
* ConfigurationSetting setting = configurationClient.deleteConfigurationSetting&#40;
* new ConfigurationSetting&#40;&#41;.setKey&#40;&quot;prodDBConnection&quot;&#41;&#41;;
* new ConfigurationSetting&#40;&#41;.setKey&#40;&quot;prodDBConnection&quot;&#41;.setLabel&#40;&quot;westUS&quot;&#41;&#41;;
* System.out.printf&#40;&quot;Key: %s, Value: %s&quot;, setting.getKey&#40;&#41;, setting.getValue&#40;&#41;&#41;;
* </pre>
* <!-- end com.azure.data.applicationconfig.configurationclient.deleteConfigurationSetting#ConfigurationSetting -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public void getConfigurationSettingsCodeSnippet() {
ConfigurationAsyncClient client = getAsyncClient();

// BEGIN: com.azure.data.appconfiguration.configurationasyncclient.getConfigurationSetting#string-string
client.getConfigurationSetting("prodDBConnection", null)
client.getConfigurationSetting("prodDBConnection", "westUS")
.subscribe(response -> System.out.printf("Key: %s, Label: %s, Value: %s",
response.getKey(), response.getLabel(), response.getValue()));
// END: com.azure.data.appconfiguration.configurationasyncclient.getConfigurationSetting#string-string
Expand All @@ -119,7 +119,7 @@ public void getConfigurationSettingsCodeSnippet() {
*/
// BEGIN: com.azure.data.appconfiguration.configurationasyncclient.getConfigurationSetting#string-string-OffsetDateTime
client.getConfigurationSetting(
"prodDBConnection", null, OffsetDateTime.now(ZoneOffset.UTC).minusMinutes(1))
"prodDBConnection", "westUS", OffsetDateTime.now(ZoneOffset.UTC).minusMinutes(1))
.subscribe(response -> System.out.printf("Key: %s, Label: %s, Value: %s",
response.getKey(), response.getLabel(), response.getValue()));
// END: com.azure.data.appconfiguration.configurationasyncclient.getConfigurationSetting#string-string-OffsetDateTime
Expand Down Expand Up @@ -152,13 +152,13 @@ public void getConfigurationSettingsCodeSnippet() {
public void deleteConfigurationSettingsCodeSnippet() {
ConfigurationAsyncClient client = getAsyncClient();
// BEGIN: com.azure.data.appconfiguration.configurationasyncclient.deleteConfigurationSetting#string-string
client.deleteConfigurationSetting("prodDBConnection", null)
client.deleteConfigurationSetting("prodDBConnection", "westUS")
.subscribe(response -> System.out.printf("Key: %s, Label: %s, Value: %s",
response.getKey(), response.getLabel(), response.getValue()));
// END: com.azure.data.appconfiguration.configurationasyncclient.deleteConfigurationSetting#string-string

// BEGIN: com.azure.data.appconfiguration.configurationasyncclient.deleteConfigurationSetting#ConfigurationSetting
client.deleteConfigurationSetting(new ConfigurationSetting().setKey("prodDBConnection"))
client.deleteConfigurationSetting(new ConfigurationSetting().setKey("prodDBConnection").setLabel("westUS"))
.subscribe(response -> System.out.printf("Key: %s, Label: %s, Value: %s",
response.getKey(), response.getValue()));
// END: com.azure.data.appconfiguration.configurationasyncclient.deleteConfigurationSetting#ConfigurationSetting
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ public void getConfigurationSetting() {

// BEGIN: com.azure.data.applicationconfig.configurationclient.getConfigurationSetting#string-string
ConfigurationSetting resultNoDateTime =
configurationClient.getConfigurationSetting("prodDBConnection", null);
configurationClient.getConfigurationSetting("prodDBConnection", "westUS");
System.out.printf("Key: %s, Value: %s", resultNoDateTime.getKey(), resultNoDateTime.getValue());
// END: com.azure.data.applicationconfig.configurationclient.getConfigurationSetting#string-string

Expand All @@ -181,13 +181,13 @@ public void getConfigurationSetting() {
*/
// BEGIN: com.azure.data.applicationconfig.configurationclient.getConfigurationSetting#string-string-OffsetDateTime
ConfigurationSetting result =
configurationClient.getConfigurationSetting("prodDBConnection", null, null);
configurationClient.getConfigurationSetting("prodDBConnection", "westUS", null);
System.out.printf("Key: %s, Value: %s", result.getKey(), result.getValue());
// END: com.azure.data.applicationconfig.configurationclient.getConfigurationSetting#string-string-OffsetDateTime

// BEGIN: com.azure.data.applicationconfig.configurationclient.getConfigurationSetting#ConfigurationSetting
ConfigurationSetting setting = configurationClient.getConfigurationSetting(
new ConfigurationSetting().setKey("prodDBConnection"));
new ConfigurationSetting().setKey("prodDBConnection").setLabel("westUS"));
System.out.printf("Key: %s, Value: %s", setting.getKey(), setting.getValue());
// END: com.azure.data.applicationconfig.configurationclient.getConfigurationSetting#ConfigurationSetting

Expand All @@ -211,13 +211,13 @@ public void getConfigurationSetting() {
public void deleteConfigurationSetting() {
ConfigurationClient configurationClient = createSyncConfigurationClient();
// BEGIN: com.azure.data.applicationconfig.configurationclient.deleteConfigurationSetting#string-string
ConfigurationSetting result = configurationClient.deleteConfigurationSetting("prodDBConnection", null);
ConfigurationSetting result = configurationClient.deleteConfigurationSetting("prodDBConnection", "westUS");
System.out.printf("Key: %s, Value: %s", result.getKey(), result.getValue());
// END: com.azure.data.applicationconfig.configurationclient.deleteConfigurationSetting#string-string

// BEGIN: com.azure.data.applicationconfig.configurationclient.deleteConfigurationSetting#ConfigurationSetting
ConfigurationSetting setting = configurationClient.deleteConfigurationSetting(
new ConfigurationSetting().setKey("prodDBConnection"));
new ConfigurationSetting().setKey("prodDBConnection").setLabel("westUS"));
System.out.printf("Key: %s, Value: %s", setting.getKey(), setting.getValue());
// END: com.azure.data.applicationconfig.configurationclient.deleteConfigurationSetting#ConfigurationSetting

Expand Down

0 comments on commit c3a1728

Please sign in to comment.