diff --git a/sdk/appconfiguration/azure-data-appconfiguration/swagger/pom.xml b/sdk/appconfiguration/azure-data-appconfiguration/customization/pom.xml similarity index 85% rename from sdk/appconfiguration/azure-data-appconfiguration/swagger/pom.xml rename to sdk/appconfiguration/azure-data-appconfiguration/customization/pom.xml index a2b237785f67..072119cc2800 100644 --- a/sdk/appconfiguration/azure-data-appconfiguration/swagger/pom.xml +++ b/sdk/appconfiguration/azure-data-appconfiguration/customization/pom.xml @@ -12,10 +12,10 @@ Microsoft Azure App Configuration client for Java - This package contains client functionality for Microsoft Azure App Configuration + This package contains client customization for Microsoft Azure App Configuration com.azure.tools - azure-data-appconfiguration-autorest-customization + azure-data-appconfiguration-customization 1.0.0-beta.1 jar diff --git a/sdk/appconfiguration/azure-data-appconfiguration/customization/src/main/java/AppConfigurationCustomizations.java b/sdk/appconfiguration/azure-data-appconfiguration/customization/src/main/java/AppConfigurationCustomizations.java new file mode 100644 index 000000000000..57050dc50b6a --- /dev/null +++ b/sdk/appconfiguration/azure-data-appconfiguration/customization/src/main/java/AppConfigurationCustomizations.java @@ -0,0 +1,171 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import org.slf4j.Logger; + +import com.azure.autorest.customization.Customization; +import com.azure.autorest.customization.Editor; +import com.azure.autorest.customization.LibraryCustomization; + +/** + * Removes generated public client surface so the hand-written ConfigurationClient, + * ConfigurationAsyncClient, ConfigurationClientBuilder, and ConfigurationServiceVersion + * in com.azure.data.appconfiguration are not overwritten by tsp-client update. + * The generated implementation client under com.azure.data.appconfiguration.implementation + * is preserved and used by the hand-written public classes. + * + * Also promotes the generated private *SinglePage / *SinglePageAsync / *NextSinglePage + * methods on AzureAppConfigurationImpl to public so the hand-written paging code in + * ConfigurationClient and ConfigurationAsyncClient can drive pagination directly + * (needed for per-page conditional ETag matching). + */ +public class AppConfigurationCustomizations extends Customization { + + private static final String ROOT_FILE_PATH = "src/main/java/com/azure/data/appconfiguration/"; + + private static final String IMPL_CLIENT_PATH + = ROOT_FILE_PATH + "implementation/AzureAppConfigurationImpl.java"; + + private static final String[] FILES_TO_REMOVE = new String[] { + "AzureAppConfigurationClient.java", + "AzureAppConfigurationAsyncClient.java", + "AzureAppConfigurationBuilder.java", + "AzureAppConfigurationServiceVersion.java" + }; + + // Matches: " private Mono> fooSinglePageAsync(" + // " private PagedResponse fooSinglePage(" + // " private Mono> fooNextSinglePageAsync(" + // " private PagedResponse fooNextSinglePage(" + private static final Pattern SINGLE_PAGE_METHOD = Pattern.compile( + "(^|\\n)(\\s*)private(\\s+(?:Mono>|PagedResponse)\\s+\\w*SinglePage\\w*\\s*\\()"); + + // Matches the createSnapshotWithResponse / createSnapshotWithResponseAsync helpers we need to drive the LRO + // ourselves from CreateSnapshotUtilClient (typespec-java generates them as private). + private static final Pattern CREATE_SNAPSHOT_HELPER = Pattern.compile( + "(^|\\n)(\\s*)private(\\s+(?:Mono>|Response)\\s+createSnapshotWithResponse\\w*\\s*\\()"); + + @Override + public void customize(LibraryCustomization customization, Logger logger) { + Editor editor = customization.getRawEditor(); + for (String fileName : FILES_TO_REMOVE) { + String path = ROOT_FILE_PATH + fileName; + if (editor.getContents().containsKey(path)) { + editor.removeFile(path); + logger.info("Removed generated file {}", path); + } else { + logger.info("Generated file {} not present; skipping removal.", path); + } + } + promoteSinglePageMethodsToPublic(editor, logger); + patchModuleInfo(editor, logger); + addKeyValueSetKey(editor, logger); + rewriteServiceVersionType(editor, logger); + } + + // The TypeSpec @key decorator drops the setter for KeyValue.key. We still need to populate it on + // the request body for set/put operations, so add the setter back via customization. + private static void addKeyValueSetKey(Editor editor, Logger logger) { + String path = ROOT_FILE_PATH + "implementation/models/KeyValue.java"; + String content = editor.getContents().get(path); + if (content == null) { + logger.warn("{} not present; skipping setKey injection.", path); + return; + } + if (content.contains("public KeyValue setKey(")) { + logger.info("KeyValue.setKey already present; no patch needed."); + return; + } + String marker = " public String getKey() {"; + int idx = content.indexOf(marker); + if (idx < 0) { + logger.warn("Could not find getKey() in KeyValue; skipping setKey injection."); + return; + } + String setter = " /**\n" + + " * Set the key property: The key of the key-value.\n" + + " *\n" + + " * @param key the key value to set.\n" + + " * @return the KeyValue object itself.\n" + + " */\n" + + " public KeyValue setKey(String key) {\n" + + " this.key = key;\n" + + " return this;\n" + + " }\n\n"; + String updated = content.substring(0, idx) + setter + content.substring(idx); + editor.replaceFile(path, updated); + logger.info("Injected KeyValue.setKey(String)."); + } + + private static void patchModuleInfo(Editor editor, Logger logger) { + String path = "src/main/java/module-info.java"; + String content = editor.getContents().get(path); + if (content == null) { + logger.warn("{} not present; skipping module-info patch.", path); + return; + } + String updated = content; + if (!updated.contains("exports com.azure.data.appconfiguration.models;")) { + updated = updated.replace( + "exports com.azure.data.appconfiguration;", + "exports com.azure.data.appconfiguration;\n exports com.azure.data.appconfiguration.models;"); + } + if (!updated.contains("opens com.azure.data.appconfiguration.models to com.azure.core;")) { + updated = updated.replace( + "opens com.azure.data.appconfiguration.implementation.models to com.azure.core;", + "opens com.azure.data.appconfiguration.implementation.models to com.azure.core;\n" + + " opens com.azure.data.appconfiguration.models to com.azure.core;"); + } + if (!updated.equals(content)) { + editor.replaceFile(path, updated); + logger.info("Patched module-info.java to export and open com.azure.data.appconfiguration.models."); + } else { + logger.info("module-info.java already exports models package; no patch needed."); + } + } + + // The generated impl references typespec-generated AzureAppConfigurationServiceVersion which we delete. + // Rewrite to use the hand-written ConfigurationServiceVersion enum. + private static void rewriteServiceVersionType(Editor editor, Logger logger) { + String content = editor.getContents().get(IMPL_CLIENT_PATH); + if (content == null || !content.contains("AzureAppConfigurationServiceVersion")) { + return; + } + editor.replaceFile(IMPL_CLIENT_PATH, + content.replace("AzureAppConfigurationServiceVersion", "ConfigurationServiceVersion")); + logger.info("Rewrote AzureAppConfigurationServiceVersion -> ConfigurationServiceVersion in impl."); + } + + private static void promoteSinglePageMethodsToPublic(Editor editor, Logger logger) { + String content = editor.getContents().get(IMPL_CLIENT_PATH); + if (content == null) { + logger.warn("{} not present; skipping single-page visibility promotion.", IMPL_CLIENT_PATH); + return; + } + content = promote(content, SINGLE_PAGE_METHOD, "single-page", logger); + content = promote(content, CREATE_SNAPSHOT_HELPER, "createSnapshotWithResponse", logger); + editor.replaceFile(IMPL_CLIENT_PATH, content); + } + + private static String promote(String content, Pattern pattern, String label, Logger logger) { + Matcher matcher = pattern.matcher(content); + StringBuffer sb = new StringBuffer(); + int count = 0; + while (matcher.find()) { + matcher.appendReplacement(sb, + Matcher.quoteReplacement(matcher.group(1) + matcher.group(2) + "public" + matcher.group(3))); + count++; + } + matcher.appendTail(sb); + if (count > 0) { + logger.info("Promoted {} {} method(s) on AzureAppConfigurationImpl from private to public.", + count, label); + } else { + logger.info("No private {} methods found on AzureAppConfigurationImpl to promote.", label); + } + return sb.toString(); + } +} diff --git a/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/ConfigurationAsyncClient.java b/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/ConfigurationAsyncClient.java index 63d8223a6dc4..75ac6e77d1f9 100644 --- a/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/ConfigurationAsyncClient.java +++ b/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/ConfigurationAsyncClient.java @@ -14,7 +14,6 @@ import com.azure.core.http.rest.PagedFlux; import com.azure.core.http.rest.PagedResponse; import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.ResponseBase; import com.azure.core.http.rest.SimpleResponse; import com.azure.core.util.Context; import com.azure.core.util.logging.ClientLogger; @@ -23,9 +22,9 @@ import com.azure.data.appconfiguration.implementation.AzureAppConfigurationImpl; import com.azure.data.appconfiguration.implementation.ConfigurationSettingDeserializationHelper; import com.azure.data.appconfiguration.implementation.CreateSnapshotUtilClient; +import com.azure.data.appconfiguration.implementation.ImplBridge; import com.azure.data.appconfiguration.implementation.SyncTokenPolicy; import com.azure.data.appconfiguration.implementation.Utility; -import com.azure.data.appconfiguration.implementation.models.GetKeyValueHeaders; import com.azure.data.appconfiguration.implementation.models.KeyValue; import com.azure.data.appconfiguration.models.ConfigurationSetting; import com.azure.data.appconfiguration.models.ConfigurationSnapshot; @@ -430,9 +429,9 @@ public Mono> addConfigurationSettingWithResponse( // This service method call is similar to setConfigurationSetting except we're passing If-Not-Match = "*". // If the service finds any existing configuration settings, then its e-tag will match and the service will // return an error. - return withContext(context -> validateSettingAsync(setting).flatMap(settingInternal -> serviceClient - .putKeyValueWithResponseAsync(settingInternal.getKey(), settingInternal.getLabel(), null, ETAG_ANY, - toKeyValue(settingInternal), context) + return withContext(context -> validateSettingAsync(setting).flatMap(settingInternal -> ImplBridge + .putKeyValueWithResponseAsync(serviceClient, settingInternal.getKey(), settingInternal.getLabel(), null, + ETAG_ANY, toKeyValue(settingInternal), context) .map(ConfigurationSettingDeserializationHelper::toConfigurationSettingWithResponse))); } @@ -572,8 +571,8 @@ public Mono setConfigurationSetting(ConfigurationSetting s @ServiceMethod(returns = ReturnType.SINGLE) public Mono> setConfigurationSettingWithResponse(ConfigurationSetting setting, boolean ifUnchanged) { - return withContext(context -> validateSettingAsync(setting).flatMap(settingInternal -> serviceClient - .putKeyValueWithResponseAsync(settingInternal.getKey(), settingInternal.getLabel(), + return withContext(context -> validateSettingAsync(setting).flatMap(settingInternal -> ImplBridge + .putKeyValueWithResponseAsync(serviceClient, settingInternal.getKey(), settingInternal.getLabel(), getETag(ifUnchanged, settingInternal), null, toKeyValue(settingInternal), context) .map(ConfigurationSettingDeserializationHelper::toConfigurationSettingWithResponse))); } @@ -716,20 +715,19 @@ public Mono getConfigurationSetting(ConfigurationSetting s @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getConfigurationSettingWithResponse(ConfigurationSetting setting, OffsetDateTime acceptDateTime, boolean ifChanged) { - return withContext(context -> validateSettingAsync(setting).flatMap(settingInternal -> serviceClient - .getKeyValueWithResponseAsync(settingInternal.getKey(), settingInternal.getLabel(), - acceptDateTime == null ? null : acceptDateTime.toString(), null, getETag(ifChanged, settingInternal), - null, context) - .onErrorResume(HttpResponseException.class, - (Function>>) throwable -> { - HttpResponseException e = (HttpResponseException) throwable; - HttpResponse httpResponse = e.getResponse(); - if (httpResponse.getStatusCode() == 304) { - return Mono.just(new ResponseBase(httpResponse.getRequest(), - httpResponse.getStatusCode(), httpResponse.getHeaders(), null, null)); - } - return Mono.error(throwable); - }) + return withContext(context -> validateSettingAsync(setting).flatMap(settingInternal -> ImplBridge + .getKeyValueWithResponseAsync(serviceClient, settingInternal.getKey(), settingInternal.getLabel(), + acceptDateTime == null ? null : acceptDateTime.toString(), null, null, + getETag(ifChanged, settingInternal), null, context) + .onErrorResume(HttpResponseException.class, (Function>>) throwable -> { + HttpResponseException e = (HttpResponseException) throwable; + HttpResponse httpResponse = e.getResponse(); + if (httpResponse.getStatusCode() == 304) { + return Mono.just(new SimpleResponse<>(httpResponse.getRequest(), httpResponse.getStatusCode(), + httpResponse.getHeaders(), (KeyValue) null)); + } + return Mono.error(throwable); + }) .map(ConfigurationSettingDeserializationHelper::toConfigurationSettingWithResponse))); } @@ -849,8 +847,8 @@ public Mono deleteConfigurationSetting(ConfigurationSettin @ServiceMethod(returns = ReturnType.SINGLE) public Mono> deleteConfigurationSettingWithResponse(ConfigurationSetting setting, boolean ifUnchanged) { - return withContext(context -> validateSettingAsync(setting).flatMap(settingInternal -> serviceClient - .deleteKeyValueWithResponseAsync(settingInternal.getKey(), settingInternal.getLabel(), + return withContext(context -> validateSettingAsync(setting).flatMap(settingInternal -> ImplBridge + .deleteKeyValueWithResponseAsync(serviceClient, settingInternal.getKey(), settingInternal.getLabel(), getETag(ifUnchanged, settingInternal), context) .map(ConfigurationSettingDeserializationHelper::toConfigurationSettingWithResponse))); } @@ -1000,8 +998,8 @@ public Mono> setReadOnlyWithResponse(Configuratio final String key = settingInternal.getKey(); final String label = settingInternal.getLabel(); return (isReadOnly - ? serviceClient.putLockWithResponseAsync(key, label, null, null, context) - : serviceClient.deleteLockWithResponseAsync(key, label, null, null, context)) + ? ImplBridge.putLockWithResponseAsync(serviceClient, key, label, null, null, context) + : ImplBridge.deleteLockWithResponseAsync(serviceClient, key, label, null, null, context)) .map(ConfigurationSettingDeserializationHelper::toConfigurationSettingWithResponse); })); } @@ -1037,14 +1035,14 @@ public PagedFlux listConfigurationSettings(SettingSelector final List matchConditionsList = selector == null ? null : selector.getMatchConditions(); final List tagsFilter = selector == null ? null : selector.getTagsFilter(); AtomicInteger pageETagIndex = new AtomicInteger(0); - return new PagedFlux<>(() -> withContext(context -> serviceClient - .getKeyValuesSinglePageAsync(keyFilter, labelFilter, null, acceptDateTime, settingFields, null, null, - getPageETag(matchConditionsList, pageETagIndex), tagsFilter, context) + return new PagedFlux<>(() -> withContext(context -> ImplBridge + .getKeyValuesSinglePageAsync(serviceClient, keyFilter, labelFilter, null, acceptDateTime, settingFields, + null, null, getPageETag(matchConditionsList, pageETagIndex), tagsFilter, context) .onErrorResume(HttpResponseException.class, (Function>>) Utility::handleNotModifiedErrorToValidResponse) .map(ConfigurationSettingDeserializationHelper::toConfigurationSettingWithPagedResponse)), - nextLink -> withContext(context -> serviceClient - .getKeyValuesNextSinglePageAsync(nextLink, acceptDateTime, null, + nextLink -> withContext(context -> ImplBridge + .getKeyValuesNextSinglePageAsync(serviceClient, nextLink, acceptDateTime, null, getPageETag(matchConditionsList, pageETagIndex), context) .onErrorResume(HttpResponseException.class, (Function>>) Utility::handleNotModifiedErrorToValidResponse) @@ -1156,12 +1154,13 @@ public PagedFlux listConfigurationSettingsForSnapshot(Stri public PagedFlux listConfigurationSettingsForSnapshot(String snapshotName, List fields) { return new PagedFlux<>( - () -> withContext(context -> serviceClient - .getKeyValuesSinglePageAsync(null, null, null, null, fields, snapshotName, null, null, null, context) + () -> withContext(context -> ImplBridge + .getKeyValuesSinglePageAsync(serviceClient, null, null, null, null, fields, snapshotName, null, null, + null, context) .map(ConfigurationSettingDeserializationHelper::toConfigurationSettingWithPagedResponse)), - nextLink -> withContext( - context -> serviceClient.getKeyValuesNextSinglePageAsync(nextLink, null, null, null, context) - .map(ConfigurationSettingDeserializationHelper::toConfigurationSettingWithPagedResponse))); + nextLink -> withContext(context -> ImplBridge + .getKeyValuesNextSinglePageAsync(serviceClient, nextLink, null, null, null, context) + .map(ConfigurationSettingDeserializationHelper::toConfigurationSettingWithPagedResponse))); } /** @@ -1198,11 +1197,12 @@ public PagedFlux listRevisions(SettingSelector selector) { final List settingFields = selector == null ? null : toSettingFieldsList(selector.getFields()); List tags = selector == null ? null : selector.getTagsFilter(); return new PagedFlux<>( - () -> withContext(context -> serviceClient - .getRevisionsSinglePageAsync(keyFilter, labelFilter, null, acceptDateTime, settingFields, tags, context) + () -> withContext(context -> ImplBridge + .getRevisionsSinglePageAsync(serviceClient, keyFilter, labelFilter, null, acceptDateTime, settingFields, + tags, context) .map(ConfigurationSettingDeserializationHelper::toConfigurationSettingWithPagedResponse)), nextLink -> withContext( - context -> serviceClient.getRevisionsNextSinglePageAsync(nextLink, acceptDateTime, context) + context -> ImplBridge.getRevisionsNextSinglePageAsync(serviceClient, nextLink, acceptDateTime, context) .map(ConfigurationSettingDeserializationHelper::toConfigurationSettingWithPagedResponse))); } @@ -1299,8 +1299,7 @@ public Mono getSnapshot(String snapshotName) { @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getSnapshotWithResponse(String snapshotName, List fields) { - return serviceClient.getSnapshotWithResponseAsync(snapshotName, null, null, fields, Context.NONE) - .map(response -> new SimpleResponse<>(response, response.getValue())); + return ImplBridge.getSnapshotWithResponseAsync(serviceClient, snapshotName, null, null, fields, Context.NONE); } /** @@ -1449,11 +1448,12 @@ public Mono> recoverSnapshotWithResponse(String public PagedFlux listSnapshots(SnapshotSelector selector) { try { return new PagedFlux<>( - () -> withContext(context -> serviceClient.getSnapshotsSinglePageAsync( + () -> withContext(context -> ImplBridge.getSnapshotsSinglePageAsync(serviceClient, selector == null ? null : selector.getNameFilter(), null, selector == null ? null : selector.getFields(), selector == null ? null : selector.getStatus(), context)), - nextLink -> withContext(context -> serviceClient.getSnapshotsNextSinglePageAsync(nextLink, context))); + nextLink -> withContext( + context -> ImplBridge.getSnapshotsNextSinglePageAsync(serviceClient, nextLink, context))); } catch (RuntimeException ex) { return new PagedFlux<>(() -> monoError(LOGGER, ex)); } @@ -1511,7 +1511,7 @@ public PagedFlux listLabels(SettingLabelSelector selector) { ? null : selector.getAcceptDateTime() == null ? null : selector.getAcceptDateTime().toString(); final List labelFields = selector == null ? null : selector.getFields(); - return serviceClient.getLabelsAsync(labelNameFilter, null, acceptDatetime, labelFields); + return ImplBridge.getLabelsAsync(serviceClient, labelNameFilter, null, acceptDatetime, labelFields); } /** diff --git a/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/ConfigurationClient.java b/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/ConfigurationClient.java index a069509d06e1..602d9944d4c5 100644 --- a/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/ConfigurationClient.java +++ b/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/ConfigurationClient.java @@ -15,7 +15,6 @@ import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.PagedResponse; import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.ResponseBase; import com.azure.core.http.rest.SimpleResponse; import com.azure.core.util.Context; import com.azure.core.util.logging.ClientLogger; @@ -23,12 +22,9 @@ import com.azure.core.util.polling.SyncPoller; import com.azure.data.appconfiguration.implementation.AzureAppConfigurationImpl; import com.azure.data.appconfiguration.implementation.CreateSnapshotUtilClient; +import com.azure.data.appconfiguration.implementation.ImplBridge; import com.azure.data.appconfiguration.implementation.SyncTokenPolicy; -import com.azure.data.appconfiguration.implementation.models.DeleteKeyValueHeaders; -import com.azure.data.appconfiguration.implementation.models.GetKeyValueHeaders; -import com.azure.data.appconfiguration.implementation.models.GetSnapshotHeaders; import com.azure.data.appconfiguration.implementation.models.KeyValue; -import com.azure.data.appconfiguration.implementation.models.PutKeyValueHeaders; import com.azure.data.appconfiguration.models.ConfigurationSetting; import com.azure.data.appconfiguration.models.ConfigurationSnapshot; import com.azure.data.appconfiguration.models.ConfigurationSnapshotStatus; @@ -435,8 +431,8 @@ public Response addConfigurationSettingWithResponse(Config // This service method call is similar to setConfigurationSetting except we're passing If-Not-Match = "*". // If the service finds any existing configuration settings, then its e-tag will match and the service will // return an error. - final ResponseBase response = serviceClient.putKeyValueWithResponse( - setting.getKey(), setting.getLabel(), null, ETAG_ANY, toKeyValue(setting), context); + final Response response = ImplBridge.putKeyValueWithResponse(serviceClient, setting.getKey(), + setting.getLabel(), null, ETAG_ANY, toKeyValue(setting), context); return toConfigurationSettingWithResponse(response); } @@ -580,8 +576,8 @@ public ConfigurationSetting setConfigurationSetting(ConfigurationSetting setting public Response setConfigurationSettingWithResponse(ConfigurationSetting setting, boolean ifUnchanged, Context context) { validateSetting(setting); - final ResponseBase response = serviceClient.putKeyValueWithResponse( - setting.getKey(), setting.getLabel(), getETag(ifUnchanged, setting), null, toKeyValue(setting), context); + final Response response = ImplBridge.putKeyValueWithResponse(serviceClient, setting.getKey(), + setting.getLabel(), getETag(ifUnchanged, setting), null, toKeyValue(setting), context); return toConfigurationSettingWithResponse(response); } @@ -724,15 +720,15 @@ public Response getConfigurationSettingWithResponse(Config OffsetDateTime acceptDateTime, boolean ifChanged, Context context) { validateSetting(setting); try { - final ResponseBase response = serviceClient.getKeyValueWithResponse( - setting.getKey(), setting.getLabel(), acceptDateTime == null ? null : acceptDateTime.toString(), null, + final Response response = ImplBridge.getKeyValueWithResponse(serviceClient, setting.getKey(), + setting.getLabel(), acceptDateTime == null ? null : acceptDateTime.toString(), null, null, getETag(ifChanged, setting), null, context); return toConfigurationSettingWithResponse(response); } catch (HttpResponseException ex) { final HttpResponse httpResponse = ex.getResponse(); if (httpResponse.getStatusCode() == 304) { - return new ResponseBase(httpResponse.getRequest(), - httpResponse.getStatusCode(), httpResponse.getHeaders(), null, null); + return new SimpleResponse<>(httpResponse.getRequest(), httpResponse.getStatusCode(), + httpResponse.getHeaders(), null); } throw LOGGER.logExceptionAsError(ex); } @@ -850,8 +846,8 @@ public ConfigurationSetting deleteConfigurationSetting(ConfigurationSetting sett public Response deleteConfigurationSettingWithResponse(ConfigurationSetting setting, boolean ifUnchanged, Context context) { validateSetting(setting); - final ResponseBase response = serviceClient - .deleteKeyValueWithResponse(setting.getKey(), setting.getLabel(), getETag(ifUnchanged, setting), context); + final Response response = ImplBridge.deleteKeyValueWithResponse(serviceClient, setting.getKey(), + setting.getLabel(), getETag(ifUnchanged, setting), context); return toConfigurationSettingWithResponse(response); } @@ -996,8 +992,10 @@ public Response setReadOnlyWithResponse(ConfigurationSetti final String label = setting.getLabel(); return isReadOnly - ? toConfigurationSettingWithResponse(serviceClient.putLockWithResponse(key, label, null, null, context)) - : toConfigurationSettingWithResponse(serviceClient.deleteLockWithResponse(key, label, null, null, context)); + ? toConfigurationSettingWithResponse( + ImplBridge.putLockWithResponse(serviceClient, key, label, null, null, context)) + : toConfigurationSettingWithResponse( + ImplBridge.deleteLockWithResponse(serviceClient, key, label, null, null, context)); } /** @@ -1064,8 +1062,9 @@ public PagedIterable listConfigurationSettings(SettingSele return new PagedIterable<>(() -> { PagedResponse pagedResponse; try { - pagedResponse = serviceClient.getKeyValuesSinglePage(keyFilter, labelFilter, null, acceptDateTime, - settingFields, null, null, getPageETag(matchConditionsList, pageETagIndex), tagsFilter, context); + pagedResponse = ImplBridge.getKeyValuesSinglePage(serviceClient, keyFilter, labelFilter, null, + acceptDateTime, settingFields, null, null, getPageETag(matchConditionsList, pageETagIndex), + tagsFilter, context); } catch (HttpResponseException ex) { return handleNotModifiedErrorToValidResponse(ex, LOGGER); } @@ -1073,7 +1072,7 @@ public PagedIterable listConfigurationSettings(SettingSele }, nextLink -> { PagedResponse pagedResponse; try { - pagedResponse = serviceClient.getKeyValuesNextSinglePage(nextLink, acceptDateTime, null, + pagedResponse = ImplBridge.getKeyValuesNextSinglePage(serviceClient, nextLink, acceptDateTime, null, getPageETag(matchConditionsList, pageETagIndex), context); } catch (HttpResponseException ex) { return handleNotModifiedErrorToValidResponse(ex, LOGGER); @@ -1227,12 +1226,12 @@ public PagedIterable listConfigurationSettingsForSnapshot( public PagedIterable listConfigurationSettingsForSnapshot(String snapshotName, List fields, Context context) { return new PagedIterable<>(() -> { - final PagedResponse pagedResponse = serviceClient.getKeyValuesSinglePage(null, null, null, null, - fields, snapshotName, null, null, null, context); + final PagedResponse pagedResponse = ImplBridge.getKeyValuesSinglePage(serviceClient, null, null, + null, null, fields, snapshotName, null, null, null, context); return toConfigurationSettingWithPagedResponse(pagedResponse); }, nextLink -> { final PagedResponse pagedResponse - = serviceClient.getKeyValuesNextSinglePage(nextLink, null, null, null, context); + = ImplBridge.getKeyValuesNextSinglePage(serviceClient, nextLink, null, null, null, context); return toConfigurationSettingWithPagedResponse(pagedResponse); }); } @@ -1304,14 +1303,14 @@ public PagedIterable listRevisions(SettingSelector selecto public PagedIterable listRevisions(SettingSelector selector, Context context) { final String acceptDateTime = selector == null ? null : selector.getAcceptDateTime(); return new PagedIterable<>(() -> { - final PagedResponse pagedResponse = serviceClient.getRevisionsSinglePage( + final PagedResponse pagedResponse = ImplBridge.getRevisionsSinglePage(serviceClient, selector == null ? null : selector.getKeyFilter(), selector == null ? null : selector.getLabelFilter(), null, acceptDateTime, selector == null ? null : toSettingFieldsList(selector.getFields()), selector == null ? null : selector.getTagsFilter(), context); return toConfigurationSettingWithPagedResponse(pagedResponse); }, nextLink -> { final PagedResponse pagedResponse - = serviceClient.getRevisionsNextSinglePage(nextLink, acceptDateTime, context); + = ImplBridge.getRevisionsNextSinglePage(serviceClient, nextLink, acceptDateTime, context); return toConfigurationSettingWithPagedResponse(pagedResponse); }); } @@ -1408,9 +1407,7 @@ public ConfigurationSnapshot getSnapshot(String snapshotName) { @ServiceMethod(returns = ReturnType.SINGLE) public Response getSnapshotWithResponse(String snapshotName, List fields, Context context) { - final ResponseBase response - = serviceClient.getSnapshotWithResponse(snapshotName, null, null, fields, context); - return new SimpleResponse<>(response, response.getValue()); + return ImplBridge.getSnapshotWithResponse(serviceClient, snapshotName, null, null, fields, context); } /** @@ -1579,11 +1576,10 @@ public PagedIterable listSnapshots(SnapshotSelector selec */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listSnapshots(SnapshotSelector selector, Context context) { - return new PagedIterable<>( - () -> serviceClient.getSnapshotsSinglePage(selector == null ? null : selector.getNameFilter(), null, - selector == null ? null : selector.getFields(), selector == null ? null : selector.getStatus(), - context), - nextLink -> serviceClient.getSnapshotsNextSinglePage(nextLink, context)); + return new PagedIterable<>(() -> ImplBridge.getSnapshotsSinglePage(serviceClient, + selector == null ? null : selector.getNameFilter(), null, selector == null ? null : selector.getFields(), + selector == null ? null : selector.getStatus(), context), + nextLink -> ImplBridge.getSnapshotsNextSinglePage(serviceClient, nextLink, context)); } /** @@ -1667,7 +1663,7 @@ public PagedIterable listLabels(SettingLabelSelector selector, Con ? null : selector.getAcceptDateTime() == null ? null : selector.getAcceptDateTime().toString(); final List labelFields = selector == null ? null : selector.getFields(); - return serviceClient.getLabels(labelNameFilter, null, acceptDatetime, labelFields, context); + return ImplBridge.getLabels(serviceClient, labelNameFilter, null, acceptDatetime, labelFields, context); } /** diff --git a/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/ConfigurationClientBuilder.java b/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/ConfigurationClientBuilder.java index 26a0b21942b4..d425b0a68288 100644 --- a/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/ConfigurationClientBuilder.java +++ b/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/ConfigurationClientBuilder.java @@ -238,7 +238,7 @@ private AzureAppConfigurationImpl buildInnerClient(SyncTokenPolicy syncTokenPoli ? createDefaultHttpPipeline(syncTokenPolicy, credentialsLocal, tokenCredentialLocal) : pipeline; - return new AzureAppConfigurationImpl(buildPipeline, null, endpointLocal, serviceVersion.getVersion()); + return new AzureAppConfigurationImpl(buildPipeline, endpointLocal, serviceVersion); } private HttpPipeline createDefaultHttpPipeline(SyncTokenPolicy syncTokenPolicy, diff --git a/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/AzureAppConfigurationImpl.java b/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/AzureAppConfigurationImpl.java index b8f328c6c3d8..8057507ae8fc 100644 --- a/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/AzureAppConfigurationImpl.java +++ b/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/AzureAppConfigurationImpl.java @@ -1,9 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.data.appconfiguration.implementation; +import java.time.Duration; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + import com.azure.core.annotation.BodyParam; import com.azure.core.annotation.Delete; import com.azure.core.annotation.ExpectedResponses; @@ -20,7 +25,11 @@ import com.azure.core.annotation.ServiceInterface; import com.azure.core.annotation.ServiceMethod; import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.exception.ClientAuthenticationException; import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.HttpHeaderName; import com.azure.core.http.HttpPipeline; import com.azure.core.http.HttpPipelineBuilder; import com.azure.core.http.policy.RetryPolicy; @@ -29,56 +38,22 @@ import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.PagedResponse; import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.RequestOptions; import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.ResponseBase; import com.azure.core.http.rest.RestProxy; +import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.DefaultPollingStrategy; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.PollingStrategyOptions; +import com.azure.core.util.polling.SyncDefaultPollingStrategy; +import com.azure.core.util.polling.SyncPoller; import com.azure.core.util.serializer.JacksonAdapter; import com.azure.core.util.serializer.SerializerAdapter; -import com.azure.data.appconfiguration.implementation.models.CheckKeyValueHeaders; -import com.azure.data.appconfiguration.implementation.models.CheckKeyValuesHeaders; -import com.azure.data.appconfiguration.implementation.models.CheckKeysHeaders; -import com.azure.data.appconfiguration.implementation.models.CheckLabelsHeaders; -import com.azure.data.appconfiguration.implementation.models.CheckRevisionsHeaders; -import com.azure.data.appconfiguration.implementation.models.CheckSnapshotHeaders; -import com.azure.data.appconfiguration.implementation.models.CheckSnapshotsHeaders; -import com.azure.data.appconfiguration.implementation.models.CreateSnapshotHeaders; -import com.azure.data.appconfiguration.implementation.models.DeleteKeyValueHeaders; -import com.azure.data.appconfiguration.implementation.models.DeleteLockHeaders; -import com.azure.data.appconfiguration.implementation.models.GetKeyValueHeaders; -import com.azure.data.appconfiguration.implementation.models.GetKeyValuesHeaders; -import com.azure.data.appconfiguration.implementation.models.GetKeyValuesNextHeaders; -import com.azure.data.appconfiguration.implementation.models.GetKeysHeaders; -import com.azure.data.appconfiguration.implementation.models.GetKeysNextHeaders; -import com.azure.data.appconfiguration.implementation.models.GetLabelsHeaders; -import com.azure.data.appconfiguration.implementation.models.GetLabelsNextHeaders; -import com.azure.data.appconfiguration.implementation.models.GetRevisionsHeaders; -import com.azure.data.appconfiguration.implementation.models.GetRevisionsNextHeaders; -import com.azure.data.appconfiguration.implementation.models.GetSnapshotHeaders; -import com.azure.data.appconfiguration.implementation.models.GetSnapshotsHeaders; -import com.azure.data.appconfiguration.implementation.models.GetSnapshotsNextHeaders; -import com.azure.data.appconfiguration.implementation.models.Key; -import com.azure.data.appconfiguration.implementation.models.KeyListResult; -import com.azure.data.appconfiguration.implementation.models.KeyValue; -import com.azure.data.appconfiguration.implementation.models.KeyValueListResult; -import com.azure.data.appconfiguration.implementation.models.LabelListResult; -import com.azure.data.appconfiguration.implementation.models.OperationDetails; -import com.azure.data.appconfiguration.implementation.models.PutKeyValueHeaders; -import com.azure.data.appconfiguration.implementation.models.PutLockHeaders; -import com.azure.data.appconfiguration.implementation.models.SnapshotListResult; -import com.azure.data.appconfiguration.implementation.models.SnapshotUpdateParameters; -import com.azure.data.appconfiguration.implementation.models.UpdateSnapshotHeaders; -import com.azure.data.appconfiguration.models.ConfigurationSnapshot; -import com.azure.data.appconfiguration.models.ConfigurationSnapshotStatus; -import com.azure.data.appconfiguration.models.SettingFields; -import com.azure.data.appconfiguration.models.SettingLabel; -import com.azure.data.appconfiguration.models.SettingLabelFields; -import com.azure.data.appconfiguration.models.SnapshotFields; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; -import java.util.stream.Collectors; +import com.azure.core.util.serializer.TypeReference; +import com.azure.data.appconfiguration.ConfigurationServiceVersion; + import reactor.core.publisher.Mono; /** @@ -91,26 +66,11 @@ public final class AzureAppConfigurationImpl { private final AzureAppConfigurationService service; /** - * Used to guarantee real-time consistency between requests. - */ - private final String syncToken; - - /** - * Gets Used to guarantee real-time consistency between requests. - * - * @return the syncToken value. - */ - public String getSyncToken() { - return this.syncToken; - } - - /** - * The endpoint of the App Configuration instance to send requests to. */ private final String endpoint; /** - * Gets The endpoint of the App Configuration instance to send requests to. + * Gets. * * @return the endpoint value. */ @@ -119,17 +79,17 @@ public String getEndpoint() { } /** - * Api Version. + * Service version. */ - private final String apiVersion; + private final ConfigurationServiceVersion serviceVersion; /** - * Gets Api Version. + * Gets Service version. * - * @return the apiVersion value. + * @return the serviceVersion value. */ - public String getApiVersion() { - return this.apiVersion; + public ConfigurationServiceVersion getServiceVersion() { + return this.serviceVersion; } /** @@ -163,25 +123,24 @@ public SerializerAdapter getSerializerAdapter() { /** * Initializes an instance of AzureAppConfiguration client. * - * @param syncToken Used to guarantee real-time consistency between requests. - * @param endpoint The endpoint of the App Configuration instance to send requests to. - * @param apiVersion Api Version. + * @param endpoint + * @param serviceVersion Service version. */ - public AzureAppConfigurationImpl(String syncToken, String endpoint, String apiVersion) { + public AzureAppConfigurationImpl(String endpoint, ConfigurationServiceVersion serviceVersion) { this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), - JacksonAdapter.createDefaultSerializerAdapter(), syncToken, endpoint, apiVersion); + JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceVersion); } /** * Initializes an instance of AzureAppConfiguration client. * * @param httpPipeline The HTTP pipeline to send requests through. - * @param syncToken Used to guarantee real-time consistency between requests. - * @param endpoint The endpoint of the App Configuration instance to send requests to. - * @param apiVersion Api Version. + * @param endpoint + * @param serviceVersion Service version. */ - public AzureAppConfigurationImpl(HttpPipeline httpPipeline, String syncToken, String endpoint, String apiVersion) { - this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), syncToken, endpoint, apiVersion); + public AzureAppConfigurationImpl(HttpPipeline httpPipeline, String endpoint, + ConfigurationServiceVersion serviceVersion) { + this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceVersion); } /** @@ -189,17 +148,15 @@ public AzureAppConfigurationImpl(HttpPipeline httpPipeline, String syncToken, St * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. - * @param syncToken Used to guarantee real-time consistency between requests. - * @param endpoint The endpoint of the App Configuration instance to send requests to. - * @param apiVersion Api Version. + * @param endpoint + * @param serviceVersion Service version. */ - public AzureAppConfigurationImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String syncToken, - String endpoint, String apiVersion) { + public AzureAppConfigurationImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint, + ConfigurationServiceVersion serviceVersion) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; - this.syncToken = syncToken; this.endpoint = endpoint; - this.apiVersion = apiVersion; + this.serviceVersion = serviceVersion; this.service = RestProxy.create(AzureAppConfigurationService.class, this.httpPipeline, this.getSerializerAdapter()); } @@ -213,7028 +170,4243 @@ public AzureAppConfigurationImpl(HttpPipeline httpPipeline, SerializerAdapter se public interface AzureAppConfigurationService { @Get("/keys") @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getKeys(@HostParam("endpoint") String endpoint, - @QueryParam("name") String name, @HeaderParam("Sync-Token") String syncToken, - @QueryParam("api-version") String apiVersion, @QueryParam("After") String after, - @HeaderParam("Accept-Datetime") String acceptDatetime, @HeaderParam("Accept") String accept, - Context context); - - @Get("/keys") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getKeysNoCustomHeaders(@HostParam("endpoint") String endpoint, - @QueryParam("name") String name, @HeaderParam("Sync-Token") String syncToken, - @QueryParam("api-version") String apiVersion, @QueryParam("After") String after, - @HeaderParam("Accept-Datetime") String acceptDatetime, @HeaderParam("Accept") String accept, - Context context); - - @Get("/keys") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - ResponseBase getKeysSync(@HostParam("endpoint") String endpoint, - @QueryParam("name") String name, @HeaderParam("Sync-Token") String syncToken, - @QueryParam("api-version") String apiVersion, @QueryParam("After") String after, - @HeaderParam("Accept-Datetime") String acceptDatetime, @HeaderParam("Accept") String accept, - Context context); + Mono> getKeys(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/keys") @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getKeysNoCustomHeadersSync(@HostParam("endpoint") String endpoint, - @QueryParam("name") String name, @HeaderParam("Sync-Token") String syncToken, - @QueryParam("api-version") String apiVersion, @QueryParam("After") String after, - @HeaderParam("Accept-Datetime") String acceptDatetime, @HeaderParam("Accept") String accept, - Context context); - - @Head("/keys") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> checkKeys(@HostParam("endpoint") String endpoint, - @QueryParam("name") String name, @HeaderParam("Sync-Token") String syncToken, - @QueryParam("api-version") String apiVersion, @QueryParam("After") String after, - @HeaderParam("Accept-Datetime") String acceptDatetime, Context context); - - @Head("/keys") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> checkKeysNoCustomHeaders(@HostParam("endpoint") String endpoint, - @QueryParam("name") String name, @HeaderParam("Sync-Token") String syncToken, - @QueryParam("api-version") String apiVersion, @QueryParam("After") String after, - @HeaderParam("Accept-Datetime") String acceptDatetime, Context context); + Response getKeysSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Head("/keys") @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - ResponseBase checkKeysSync(@HostParam("endpoint") String endpoint, - @QueryParam("name") String name, @HeaderParam("Sync-Token") String syncToken, - @QueryParam("api-version") String apiVersion, @QueryParam("After") String after, - @HeaderParam("Accept-Datetime") String acceptDatetime, Context context); + Mono> checkKeys(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, RequestOptions requestOptions, Context context); @Head("/keys") @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response checkKeysNoCustomHeadersSync(@HostParam("endpoint") String endpoint, - @QueryParam("name") String name, @HeaderParam("Sync-Token") String syncToken, - @QueryParam("api-version") String apiVersion, @QueryParam("After") String after, - @HeaderParam("Accept-Datetime") String acceptDatetime, Context context); - - @Get("/kv") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getKeyValues(@HostParam("endpoint") String endpoint, - @QueryParam("key") String key, @QueryParam("label") String label, - @HeaderParam("Sync-Token") String syncToken, @QueryParam("api-version") String apiVersion, - @QueryParam("After") String after, @HeaderParam("Accept-Datetime") String acceptDatetime, - @QueryParam("$Select") String select, @QueryParam("snapshot") String snapshot, - @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, - @QueryParam(value = "tags", multipleQueryParams = true) List tags, - @HeaderParam("Accept") String accept, Context context); - - @Get("/kv") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getKeyValuesNoCustomHeaders(@HostParam("endpoint") String endpoint, - @QueryParam("key") String key, @QueryParam("label") String label, - @HeaderParam("Sync-Token") String syncToken, @QueryParam("api-version") String apiVersion, - @QueryParam("After") String after, @HeaderParam("Accept-Datetime") String acceptDatetime, - @QueryParam("$Select") String select, @QueryParam("snapshot") String snapshot, - @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, - @QueryParam(value = "tags", multipleQueryParams = true) List tags, - @HeaderParam("Accept") String accept, Context context); + Response checkKeysSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, RequestOptions requestOptions, Context context); @Get("/kv") @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - ResponseBase getKeyValuesSync(@HostParam("endpoint") String endpoint, - @QueryParam("key") String key, @QueryParam("label") String label, - @HeaderParam("Sync-Token") String syncToken, @QueryParam("api-version") String apiVersion, - @QueryParam("After") String after, @HeaderParam("Accept-Datetime") String acceptDatetime, - @QueryParam("$Select") String select, @QueryParam("snapshot") String snapshot, - @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, - @QueryParam(value = "tags", multipleQueryParams = true) List tags, - @HeaderParam("Accept") String accept, Context context); + Mono> listConfigurationSettings(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/kv") @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getKeyValuesNoCustomHeadersSync(@HostParam("endpoint") String endpoint, - @QueryParam("key") String key, @QueryParam("label") String label, - @HeaderParam("Sync-Token") String syncToken, @QueryParam("api-version") String apiVersion, - @QueryParam("After") String after, @HeaderParam("Accept-Datetime") String acceptDatetime, - @QueryParam("$Select") String select, @QueryParam("snapshot") String snapshot, - @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, - @QueryParam(value = "tags", multipleQueryParams = true) List tags, - @HeaderParam("Accept") String accept, Context context); - - @Head("/kv") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> checkKeyValues(@HostParam("endpoint") String endpoint, - @QueryParam("key") String key, @QueryParam("label") String label, - @HeaderParam("Sync-Token") String syncToken, @QueryParam("api-version") String apiVersion, - @QueryParam("After") String after, @HeaderParam("Accept-Datetime") String acceptDatetime, - @QueryParam("$Select") String select, @QueryParam("snapshot") String snapshot, - @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, - @QueryParam(value = "tags", multipleQueryParams = true) List tags, Context context); - - @Head("/kv") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> checkKeyValuesNoCustomHeaders(@HostParam("endpoint") String endpoint, - @QueryParam("key") String key, @QueryParam("label") String label, - @HeaderParam("Sync-Token") String syncToken, @QueryParam("api-version") String apiVersion, - @QueryParam("After") String after, @HeaderParam("Accept-Datetime") String acceptDatetime, - @QueryParam("$Select") String select, @QueryParam("snapshot") String snapshot, - @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, - @QueryParam(value = "tags", multipleQueryParams = true) List tags, Context context); + Response listConfigurationSettingsSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Head("/kv") @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - ResponseBase checkKeyValuesSync(@HostParam("endpoint") String endpoint, - @QueryParam("key") String key, @QueryParam("label") String label, - @HeaderParam("Sync-Token") String syncToken, @QueryParam("api-version") String apiVersion, - @QueryParam("After") String after, @HeaderParam("Accept-Datetime") String acceptDatetime, - @QueryParam("$Select") String select, @QueryParam("snapshot") String snapshot, - @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, - @QueryParam(value = "tags", multipleQueryParams = true) List tags, Context context); + Mono> checkKeyValues(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, RequestOptions requestOptions, Context context); @Head("/kv") @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response checkKeyValuesNoCustomHeadersSync(@HostParam("endpoint") String endpoint, - @QueryParam("key") String key, @QueryParam("label") String label, - @HeaderParam("Sync-Token") String syncToken, @QueryParam("api-version") String apiVersion, - @QueryParam("After") String after, @HeaderParam("Accept-Datetime") String acceptDatetime, - @QueryParam("$Select") String select, @QueryParam("snapshot") String snapshot, - @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, - @QueryParam(value = "tags", multipleQueryParams = true) List tags, Context context); - - @Get("/kv/{key}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getKeyValue(@HostParam("endpoint") String endpoint, - @PathParam("key") String key, @QueryParam("label") String label, - @HeaderParam("Sync-Token") String syncToken, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept-Datetime") String acceptDatetime, @HeaderParam("If-Match") String ifMatch, - @HeaderParam("If-None-Match") String ifNoneMatch, @QueryParam("$Select") String select, - @HeaderParam("Accept") String accept, Context context); - - @Get("/kv/{key}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getKeyValueNoCustomHeaders(@HostParam("endpoint") String endpoint, - @PathParam("key") String key, @QueryParam("label") String label, - @HeaderParam("Sync-Token") String syncToken, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept-Datetime") String acceptDatetime, @HeaderParam("If-Match") String ifMatch, - @HeaderParam("If-None-Match") String ifNoneMatch, @QueryParam("$Select") String select, - @HeaderParam("Accept") String accept, Context context); + Response checkKeyValuesSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, RequestOptions requestOptions, Context context); @Get("/kv/{key}") @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - ResponseBase getKeyValueSync(@HostParam("endpoint") String endpoint, - @PathParam("key") String key, @QueryParam("label") String label, - @HeaderParam("Sync-Token") String syncToken, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept-Datetime") String acceptDatetime, @HeaderParam("If-Match") String ifMatch, - @HeaderParam("If-None-Match") String ifNoneMatch, @QueryParam("$Select") String select, - @HeaderParam("Accept") String accept, Context context); + Mono> getKeyValue(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("key") String key, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/kv/{key}") @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getKeyValueNoCustomHeadersSync(@HostParam("endpoint") String endpoint, - @PathParam("key") String key, @QueryParam("label") String label, - @HeaderParam("Sync-Token") String syncToken, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept-Datetime") String acceptDatetime, @HeaderParam("If-Match") String ifMatch, - @HeaderParam("If-None-Match") String ifNoneMatch, @QueryParam("$Select") String select, - @HeaderParam("Accept") String accept, Context context); - - @Put("/kv/{key}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putKeyValue(@HostParam("endpoint") String endpoint, - @PathParam("key") String key, @QueryParam("label") String label, - @HeaderParam("Sync-Token") String syncToken, @QueryParam("api-version") String apiVersion, - @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, - @BodyParam("application/json") KeyValue entity, @HeaderParam("Accept") String accept, Context context); - - @Put("/kv/{key}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putKeyValueNoCustomHeaders(@HostParam("endpoint") String endpoint, - @PathParam("key") String key, @QueryParam("label") String label, - @HeaderParam("Sync-Token") String syncToken, @QueryParam("api-version") String apiVersion, - @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, - @BodyParam("application/json") KeyValue entity, @HeaderParam("Accept") String accept, Context context); + Response getKeyValueSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("key") String key, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/kv/{key}") @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - ResponseBase putKeyValueSync(@HostParam("endpoint") String endpoint, - @PathParam("key") String key, @QueryParam("label") String label, - @HeaderParam("Sync-Token") String syncToken, @QueryParam("api-version") String apiVersion, - @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, - @BodyParam("application/json") KeyValue entity, @HeaderParam("Accept") String accept, Context context); + Mono> setConfigurationSetting(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("key") String key, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/kv/{key}") @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putKeyValueNoCustomHeadersSync(@HostParam("endpoint") String endpoint, - @PathParam("key") String key, @QueryParam("label") String label, - @HeaderParam("Sync-Token") String syncToken, @QueryParam("api-version") String apiVersion, - @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, - @BodyParam("application/json") KeyValue entity, @HeaderParam("Accept") String accept, Context context); - - @Delete("/kv/{key}") - @ExpectedResponses({ 200, 204 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> deleteKeyValue(@HostParam("endpoint") String endpoint, - @PathParam("key") String key, @QueryParam("label") String label, - @HeaderParam("Sync-Token") String syncToken, @QueryParam("api-version") String apiVersion, - @HeaderParam("If-Match") String ifMatch, @HeaderParam("Accept") String accept, Context context); - - @Delete("/kv/{key}") - @ExpectedResponses({ 200, 204 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> deleteKeyValueNoCustomHeaders(@HostParam("endpoint") String endpoint, - @PathParam("key") String key, @QueryParam("label") String label, - @HeaderParam("Sync-Token") String syncToken, @QueryParam("api-version") String apiVersion, - @HeaderParam("If-Match") String ifMatch, @HeaderParam("Accept") String accept, Context context); + Response setConfigurationSettingSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("key") String key, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Delete("/kv/{key}") @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - ResponseBase deleteKeyValueSync(@HostParam("endpoint") String endpoint, - @PathParam("key") String key, @QueryParam("label") String label, - @HeaderParam("Sync-Token") String syncToken, @QueryParam("api-version") String apiVersion, - @HeaderParam("If-Match") String ifMatch, @HeaderParam("Accept") String accept, Context context); + Mono> deleteConfigurationSetting(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("key") String key, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Delete("/kv/{key}") @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response deleteKeyValueNoCustomHeadersSync(@HostParam("endpoint") String endpoint, - @PathParam("key") String key, @QueryParam("label") String label, - @HeaderParam("Sync-Token") String syncToken, @QueryParam("api-version") String apiVersion, - @HeaderParam("If-Match") String ifMatch, @HeaderParam("Accept") String accept, Context context); - - @Head("/kv/{key}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> checkKeyValue(@HostParam("endpoint") String endpoint, - @PathParam("key") String key, @QueryParam("label") String label, - @HeaderParam("Sync-Token") String syncToken, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept-Datetime") String acceptDatetime, @HeaderParam("If-Match") String ifMatch, - @HeaderParam("If-None-Match") String ifNoneMatch, @QueryParam("$Select") String select, Context context); - - @Head("/kv/{key}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> checkKeyValueNoCustomHeaders(@HostParam("endpoint") String endpoint, - @PathParam("key") String key, @QueryParam("label") String label, - @HeaderParam("Sync-Token") String syncToken, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept-Datetime") String acceptDatetime, @HeaderParam("If-Match") String ifMatch, - @HeaderParam("If-None-Match") String ifNoneMatch, @QueryParam("$Select") String select, Context context); + Response deleteConfigurationSettingSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("key") String key, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Head("/kv/{key}") @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - ResponseBase checkKeyValueSync(@HostParam("endpoint") String endpoint, - @PathParam("key") String key, @QueryParam("label") String label, - @HeaderParam("Sync-Token") String syncToken, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept-Datetime") String acceptDatetime, @HeaderParam("If-Match") String ifMatch, - @HeaderParam("If-None-Match") String ifNoneMatch, @QueryParam("$Select") String select, Context context); + Mono> checkKeyValue(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("key") String key, RequestOptions requestOptions, + Context context); @Head("/kv/{key}") @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response checkKeyValueNoCustomHeadersSync(@HostParam("endpoint") String endpoint, - @PathParam("key") String key, @QueryParam("label") String label, - @HeaderParam("Sync-Token") String syncToken, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept-Datetime") String acceptDatetime, @HeaderParam("If-Match") String ifMatch, - @HeaderParam("If-None-Match") String ifNoneMatch, @QueryParam("$Select") String select, Context context); - - @Get("/snapshots") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getSnapshots(@HostParam("endpoint") String endpoint, - @QueryParam("name") String name, @HeaderParam("Sync-Token") String syncToken, - @QueryParam("api-version") String apiVersion, @QueryParam("After") String after, - @QueryParam("$Select") String select, @QueryParam("status") String status, - @HeaderParam("Accept") String accept, Context context); - - @Get("/snapshots") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getSnapshotsNoCustomHeaders(@HostParam("endpoint") String endpoint, - @QueryParam("name") String name, @HeaderParam("Sync-Token") String syncToken, - @QueryParam("api-version") String apiVersion, @QueryParam("After") String after, - @QueryParam("$Select") String select, @QueryParam("status") String status, - @HeaderParam("Accept") String accept, Context context); + Response checkKeyValueSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("key") String key, RequestOptions requestOptions, + Context context); @Get("/snapshots") @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - ResponseBase getSnapshotsSync(@HostParam("endpoint") String endpoint, - @QueryParam("name") String name, @HeaderParam("Sync-Token") String syncToken, - @QueryParam("api-version") String apiVersion, @QueryParam("After") String after, - @QueryParam("$Select") String select, @QueryParam("status") String status, - @HeaderParam("Accept") String accept, Context context); + Mono> getSnapshots(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/snapshots") @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSnapshotsNoCustomHeadersSync(@HostParam("endpoint") String endpoint, - @QueryParam("name") String name, @HeaderParam("Sync-Token") String syncToken, - @QueryParam("api-version") String apiVersion, @QueryParam("After") String after, - @QueryParam("$Select") String select, @QueryParam("status") String status, - @HeaderParam("Accept") String accept, Context context); - - @Head("/snapshots") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> checkSnapshots(@HostParam("endpoint") String endpoint, - @HeaderParam("Sync-Token") String syncToken, @QueryParam("api-version") String apiVersion, - @QueryParam("After") String after, Context context); + Response getSnapshotsSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Head("/snapshots") @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> checkSnapshotsNoCustomHeaders(@HostParam("endpoint") String endpoint, - @HeaderParam("Sync-Token") String syncToken, @QueryParam("api-version") String apiVersion, - @QueryParam("After") String after, Context context); + Mono> checkSnapshots(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, RequestOptions requestOptions, Context context); @Head("/snapshots") @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - ResponseBase checkSnapshotsSync(@HostParam("endpoint") String endpoint, - @HeaderParam("Sync-Token") String syncToken, @QueryParam("api-version") String apiVersion, - @QueryParam("After") String after, Context context); - - @Head("/snapshots") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response checkSnapshotsNoCustomHeadersSync(@HostParam("endpoint") String endpoint, - @HeaderParam("Sync-Token") String syncToken, @QueryParam("api-version") String apiVersion, - @QueryParam("After") String after, Context context); + Response checkSnapshotsSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, RequestOptions requestOptions, Context context); @Get("/snapshots/{name}") @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getSnapshot( - @HostParam("endpoint") String endpoint, @HeaderParam("Sync-Token") String syncToken, + Mono> getSnapshot(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("name") String name, - @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, - @QueryParam("$Select") String select, @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/snapshots/{name}") @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getSnapshotNoCustomHeaders(@HostParam("endpoint") String endpoint, - @HeaderParam("Sync-Token") String syncToken, @QueryParam("api-version") String apiVersion, - @PathParam("name") String name, @HeaderParam("If-Match") String ifMatch, - @HeaderParam("If-None-Match") String ifNoneMatch, @QueryParam("$Select") String select, - @HeaderParam("Accept") String accept, Context context); + Response getSnapshotSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("name") String name, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - @Get("/snapshots/{name}") + @Get("/operations") @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - ResponseBase getSnapshotSync(@HostParam("endpoint") String endpoint, - @HeaderParam("Sync-Token") String syncToken, @QueryParam("api-version") String apiVersion, - @PathParam("name") String name, @HeaderParam("If-Match") String ifMatch, - @HeaderParam("If-None-Match") String ifNoneMatch, @QueryParam("$Select") String select, - @HeaderParam("Accept") String accept, Context context); + Mono> getOperationDetails(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @QueryParam("snapshot") String snapshot, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); - @Get("/snapshots/{name}") + @Get("/operations") @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSnapshotNoCustomHeadersSync(@HostParam("endpoint") String endpoint, - @HeaderParam("Sync-Token") String syncToken, @QueryParam("api-version") String apiVersion, - @PathParam("name") String name, @HeaderParam("If-Match") String ifMatch, - @HeaderParam("If-None-Match") String ifNoneMatch, @QueryParam("$Select") String select, - @HeaderParam("Accept") String accept, Context context); - - @Put("/snapshots/{name}") - @ExpectedResponses({ 201 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> createSnapshot( - @HostParam("endpoint") String endpoint, @PathParam("name") String name, - @HeaderParam("Sync-Token") String syncToken, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") ConfigurationSnapshot entity, @HeaderParam("Accept") String accept, - Context context); - - @Put("/snapshots/{name}") - @ExpectedResponses({ 201 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> createSnapshotNoCustomHeaders(@HostParam("endpoint") String endpoint, - @PathParam("name") String name, @HeaderParam("Sync-Token") String syncToken, - @QueryParam("api-version") String apiVersion, @BodyParam("application/json") ConfigurationSnapshot entity, - @HeaderParam("Accept") String accept, Context context); + Response getOperationDetailsSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @QueryParam("snapshot") String snapshot, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/snapshots/{name}") @ExpectedResponses({ 201 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - ResponseBase createSnapshotSync( - @HostParam("endpoint") String endpoint, @PathParam("name") String name, - @HeaderParam("Sync-Token") String syncToken, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") ConfigurationSnapshot entity, @HeaderParam("Accept") String accept, - Context context); + Mono> createSnapshot(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, + @PathParam("name") String name, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData entity, RequestOptions requestOptions, Context context); @Put("/snapshots/{name}") @ExpectedResponses({ 201 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response createSnapshotNoCustomHeadersSync(@HostParam("endpoint") String endpoint, - @PathParam("name") String name, @HeaderParam("Sync-Token") String syncToken, - @QueryParam("api-version") String apiVersion, @BodyParam("application/json") ConfigurationSnapshot entity, - @HeaderParam("Accept") String accept, Context context); - - @Patch("/snapshots/{name}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> updateSnapshot( - @HostParam("endpoint") String endpoint, @PathParam("name") String name, - @HeaderParam("Sync-Token") String syncToken, @QueryParam("api-version") String apiVersion, - @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, - @BodyParam("application/json") SnapshotUpdateParameters entity, @HeaderParam("Accept") String accept, - Context context); - - @Patch("/snapshots/{name}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> updateSnapshotNoCustomHeaders(@HostParam("endpoint") String endpoint, - @PathParam("name") String name, @HeaderParam("Sync-Token") String syncToken, - @QueryParam("api-version") String apiVersion, @HeaderParam("If-Match") String ifMatch, - @HeaderParam("If-None-Match") String ifNoneMatch, - @BodyParam("application/json") SnapshotUpdateParameters entity, @HeaderParam("Accept") String accept, - Context context); + Response createSnapshotSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, + @PathParam("name") String name, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData entity, RequestOptions requestOptions, Context context); @Patch("/snapshots/{name}") @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - ResponseBase updateSnapshotSync( - @HostParam("endpoint") String endpoint, @PathParam("name") String name, - @HeaderParam("Sync-Token") String syncToken, @QueryParam("api-version") String apiVersion, - @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, - @BodyParam("application/json") SnapshotUpdateParameters entity, @HeaderParam("Accept") String accept, - Context context); + Mono> updateSnapshot(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, + @PathParam("name") String name, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData entity, RequestOptions requestOptions, Context context); @Patch("/snapshots/{name}") @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response updateSnapshotNoCustomHeadersSync(@HostParam("endpoint") String endpoint, - @PathParam("name") String name, @HeaderParam("Sync-Token") String syncToken, - @QueryParam("api-version") String apiVersion, @HeaderParam("If-Match") String ifMatch, - @HeaderParam("If-None-Match") String ifNoneMatch, - @BodyParam("application/json") SnapshotUpdateParameters entity, @HeaderParam("Accept") String accept, - Context context); - - @Head("/snapshots/{name}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> checkSnapshot(@HostParam("endpoint") String endpoint, - @PathParam("name") String name, @HeaderParam("Sync-Token") String syncToken, - @QueryParam("api-version") String apiVersion, @HeaderParam("If-Match") String ifMatch, - @HeaderParam("If-None-Match") String ifNoneMatch, Context context); - - @Head("/snapshots/{name}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> checkSnapshotNoCustomHeaders(@HostParam("endpoint") String endpoint, - @PathParam("name") String name, @HeaderParam("Sync-Token") String syncToken, - @QueryParam("api-version") String apiVersion, @HeaderParam("If-Match") String ifMatch, - @HeaderParam("If-None-Match") String ifNoneMatch, Context context); + Response updateSnapshotSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Content-Type") String contentType, + @PathParam("name") String name, @HeaderParam("Accept") String accept, + @BodyParam("application/json") BinaryData entity, RequestOptions requestOptions, Context context); @Head("/snapshots/{name}") @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - ResponseBase checkSnapshotSync(@HostParam("endpoint") String endpoint, - @PathParam("name") String name, @HeaderParam("Sync-Token") String syncToken, - @QueryParam("api-version") String apiVersion, @HeaderParam("If-Match") String ifMatch, - @HeaderParam("If-None-Match") String ifNoneMatch, Context context); + Mono> checkSnapshot(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("name") String name, RequestOptions requestOptions, + Context context); @Head("/snapshots/{name}") @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response checkSnapshotNoCustomHeadersSync(@HostParam("endpoint") String endpoint, - @PathParam("name") String name, @HeaderParam("Sync-Token") String syncToken, - @QueryParam("api-version") String apiVersion, @HeaderParam("If-Match") String ifMatch, - @HeaderParam("If-None-Match") String ifNoneMatch, Context context); - - @Get("/labels") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getLabels(@HostParam("endpoint") String endpoint, - @QueryParam("name") String name, @HeaderParam("Sync-Token") String syncToken, - @QueryParam("api-version") String apiVersion, @QueryParam("After") String after, - @HeaderParam("Accept-Datetime") String acceptDatetime, @QueryParam("$Select") String select, - @HeaderParam("Accept") String accept, Context context); - - @Get("/labels") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getLabelsNoCustomHeaders(@HostParam("endpoint") String endpoint, - @QueryParam("name") String name, @HeaderParam("Sync-Token") String syncToken, - @QueryParam("api-version") String apiVersion, @QueryParam("After") String after, - @HeaderParam("Accept-Datetime") String acceptDatetime, @QueryParam("$Select") String select, - @HeaderParam("Accept") String accept, Context context); + Response checkSnapshotSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("name") String name, RequestOptions requestOptions, + Context context); @Get("/labels") @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - ResponseBase getLabelsSync(@HostParam("endpoint") String endpoint, - @QueryParam("name") String name, @HeaderParam("Sync-Token") String syncToken, - @QueryParam("api-version") String apiVersion, @QueryParam("After") String after, - @HeaderParam("Accept-Datetime") String acceptDatetime, @QueryParam("$Select") String select, - @HeaderParam("Accept") String accept, Context context); + Mono> getLabels(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/labels") @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getLabelsNoCustomHeadersSync(@HostParam("endpoint") String endpoint, - @QueryParam("name") String name, @HeaderParam("Sync-Token") String syncToken, - @QueryParam("api-version") String apiVersion, @QueryParam("After") String after, - @HeaderParam("Accept-Datetime") String acceptDatetime, @QueryParam("$Select") String select, - @HeaderParam("Accept") String accept, Context context); - - @Head("/labels") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> checkLabels(@HostParam("endpoint") String endpoint, - @QueryParam("name") String name, @HeaderParam("Sync-Token") String syncToken, - @QueryParam("api-version") String apiVersion, @QueryParam("After") String after, - @HeaderParam("Accept-Datetime") String acceptDatetime, @QueryParam("$Select") String select, - Context context); - - @Head("/labels") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> checkLabelsNoCustomHeaders(@HostParam("endpoint") String endpoint, - @QueryParam("name") String name, @HeaderParam("Sync-Token") String syncToken, - @QueryParam("api-version") String apiVersion, @QueryParam("After") String after, - @HeaderParam("Accept-Datetime") String acceptDatetime, @QueryParam("$Select") String select, - Context context); + Response getLabelsSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Head("/labels") @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - ResponseBase checkLabelsSync(@HostParam("endpoint") String endpoint, - @QueryParam("name") String name, @HeaderParam("Sync-Token") String syncToken, - @QueryParam("api-version") String apiVersion, @QueryParam("After") String after, - @HeaderParam("Accept-Datetime") String acceptDatetime, @QueryParam("$Select") String select, - Context context); + Mono> checkLabels(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, RequestOptions requestOptions, Context context); @Head("/labels") @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response checkLabelsNoCustomHeadersSync(@HostParam("endpoint") String endpoint, - @QueryParam("name") String name, @HeaderParam("Sync-Token") String syncToken, - @QueryParam("api-version") String apiVersion, @QueryParam("After") String after, - @HeaderParam("Accept-Datetime") String acceptDatetime, @QueryParam("$Select") String select, - Context context); - - @Put("/locks/{key}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putLock(@HostParam("endpoint") String endpoint, - @PathParam("key") String key, @QueryParam("label") String label, - @HeaderParam("Sync-Token") String syncToken, @QueryParam("api-version") String apiVersion, - @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, - @HeaderParam("Accept") String accept, Context context); - - @Put("/locks/{key}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> putLockNoCustomHeaders(@HostParam("endpoint") String endpoint, - @PathParam("key") String key, @QueryParam("label") String label, - @HeaderParam("Sync-Token") String syncToken, @QueryParam("api-version") String apiVersion, - @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, - @HeaderParam("Accept") String accept, Context context); + Response checkLabelsSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, RequestOptions requestOptions, Context context); @Put("/locks/{key}") @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - ResponseBase putLockSync(@HostParam("endpoint") String endpoint, - @PathParam("key") String key, @QueryParam("label") String label, - @HeaderParam("Sync-Token") String syncToken, @QueryParam("api-version") String apiVersion, - @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, - @HeaderParam("Accept") String accept, Context context); + Mono> putLock(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("key") String key, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Put("/locks/{key}") @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response putLockNoCustomHeadersSync(@HostParam("endpoint") String endpoint, - @PathParam("key") String key, @QueryParam("label") String label, - @HeaderParam("Sync-Token") String syncToken, @QueryParam("api-version") String apiVersion, - @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, - @HeaderParam("Accept") String accept, Context context); - - @Delete("/locks/{key}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> deleteLock(@HostParam("endpoint") String endpoint, - @PathParam("key") String key, @QueryParam("label") String label, - @HeaderParam("Sync-Token") String syncToken, @QueryParam("api-version") String apiVersion, - @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, - @HeaderParam("Accept") String accept, Context context); - - @Delete("/locks/{key}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> deleteLockNoCustomHeaders(@HostParam("endpoint") String endpoint, - @PathParam("key") String key, @QueryParam("label") String label, - @HeaderParam("Sync-Token") String syncToken, @QueryParam("api-version") String apiVersion, - @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, - @HeaderParam("Accept") String accept, Context context); + Response putLockSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("key") String key, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Delete("/locks/{key}") @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - ResponseBase deleteLockSync(@HostParam("endpoint") String endpoint, - @PathParam("key") String key, @QueryParam("label") String label, - @HeaderParam("Sync-Token") String syncToken, @QueryParam("api-version") String apiVersion, - @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, - @HeaderParam("Accept") String accept, Context context); + Mono> deleteLock(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("key") String key, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Delete("/locks/{key}") @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response deleteLockNoCustomHeadersSync(@HostParam("endpoint") String endpoint, - @PathParam("key") String key, @QueryParam("label") String label, - @HeaderParam("Sync-Token") String syncToken, @QueryParam("api-version") String apiVersion, - @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, - @HeaderParam("Accept") String accept, Context context); - - @Get("/revisions") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getRevisions(@HostParam("endpoint") String endpoint, - @QueryParam("key") String key, @QueryParam("label") String label, - @HeaderParam("Sync-Token") String syncToken, @QueryParam("api-version") String apiVersion, - @QueryParam("After") String after, @HeaderParam("Accept-Datetime") String acceptDatetime, - @QueryParam("$Select") String select, - @QueryParam(value = "tags", multipleQueryParams = true) List tags, - @HeaderParam("Accept") String accept, Context context); - - @Get("/revisions") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getRevisionsNoCustomHeaders(@HostParam("endpoint") String endpoint, - @QueryParam("key") String key, @QueryParam("label") String label, - @HeaderParam("Sync-Token") String syncToken, @QueryParam("api-version") String apiVersion, - @QueryParam("After") String after, @HeaderParam("Accept-Datetime") String acceptDatetime, - @QueryParam("$Select") String select, - @QueryParam(value = "tags", multipleQueryParams = true) List tags, - @HeaderParam("Accept") String accept, Context context); + Response deleteLockSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("key") String key, + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("/revisions") @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - ResponseBase getRevisionsSync(@HostParam("endpoint") String endpoint, - @QueryParam("key") String key, @QueryParam("label") String label, - @HeaderParam("Sync-Token") String syncToken, @QueryParam("api-version") String apiVersion, - @QueryParam("After") String after, @HeaderParam("Accept-Datetime") String acceptDatetime, - @QueryParam("$Select") String select, - @QueryParam(value = "tags", multipleQueryParams = true) List tags, - @HeaderParam("Accept") String accept, Context context); + Mono> getRevisions(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Get("/revisions") @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getRevisionsNoCustomHeadersSync(@HostParam("endpoint") String endpoint, - @QueryParam("key") String key, @QueryParam("label") String label, - @HeaderParam("Sync-Token") String syncToken, @QueryParam("api-version") String apiVersion, - @QueryParam("After") String after, @HeaderParam("Accept-Datetime") String acceptDatetime, - @QueryParam("$Select") String select, - @QueryParam(value = "tags", multipleQueryParams = true) List tags, - @HeaderParam("Accept") String accept, Context context); - - @Head("/revisions") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> checkRevisions(@HostParam("endpoint") String endpoint, - @QueryParam("key") String key, @QueryParam("label") String label, - @HeaderParam("Sync-Token") String syncToken, @QueryParam("api-version") String apiVersion, - @QueryParam("After") String after, @HeaderParam("Accept-Datetime") String acceptDatetime, - @QueryParam("$Select") String select, - @QueryParam(value = "tags", multipleQueryParams = true) List tags, Context context); - - @Head("/revisions") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> checkRevisionsNoCustomHeaders(@HostParam("endpoint") String endpoint, - @QueryParam("key") String key, @QueryParam("label") String label, - @HeaderParam("Sync-Token") String syncToken, @QueryParam("api-version") String apiVersion, - @QueryParam("After") String after, @HeaderParam("Accept-Datetime") String acceptDatetime, - @QueryParam("$Select") String select, - @QueryParam(value = "tags", multipleQueryParams = true) List tags, Context context); + Response getRevisionsSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, + RequestOptions requestOptions, Context context); @Head("/revisions") @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - ResponseBase checkRevisionsSync(@HostParam("endpoint") String endpoint, - @QueryParam("key") String key, @QueryParam("label") String label, - @HeaderParam("Sync-Token") String syncToken, @QueryParam("api-version") String apiVersion, - @QueryParam("After") String after, @HeaderParam("Accept-Datetime") String acceptDatetime, - @QueryParam("$Select") String select, - @QueryParam(value = "tags", multipleQueryParams = true) List tags, Context context); + Mono> checkRevisions(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, RequestOptions requestOptions, Context context); @Head("/revisions") @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response checkRevisionsNoCustomHeadersSync(@HostParam("endpoint") String endpoint, - @QueryParam("key") String key, @QueryParam("label") String label, - @HeaderParam("Sync-Token") String syncToken, @QueryParam("api-version") String apiVersion, - @QueryParam("After") String after, @HeaderParam("Accept-Datetime") String acceptDatetime, - @QueryParam("$Select") String select, - @QueryParam(value = "tags", multipleQueryParams = true) List tags, Context context); - - @Get("/operations") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getOperationDetails(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @QueryParam("snapshot") String snapshot, - @HeaderParam("Accept") String accept, Context context); - - @Get("/operations") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getOperationDetailsSync(@HostParam("endpoint") String endpoint, - @QueryParam("api-version") String apiVersion, @QueryParam("snapshot") String snapshot, - @HeaderParam("Accept") String accept, Context context); + Response checkRevisionsSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, RequestOptions requestOptions, Context context); @Get("{nextLink}") @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getKeysNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Sync-Token") String syncToken, @HeaderParam("Accept-Datetime") String acceptDatetime, - @HeaderParam("Accept") String accept, Context context); + Mono> getKeysNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + Context context); @Get("{nextLink}") @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getKeysNextNoCustomHeaders( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Sync-Token") String syncToken, @HeaderParam("Accept-Datetime") String acceptDatetime, - @HeaderParam("Accept") String accept, Context context); + Response getKeysNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + Context context); @Get("{nextLink}") @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - ResponseBase getKeysNextSync( + Mono> listConfigurationSettingsNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Sync-Token") String syncToken, @HeaderParam("Accept-Datetime") String acceptDatetime, - @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("{nextLink}") @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getKeysNextNoCustomHeadersSync( + Response listConfigurationSettingsNextSync( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Sync-Token") String syncToken, @HeaderParam("Accept-Datetime") String acceptDatetime, - @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Accept") String accept, RequestOptions requestOptions, Context context); @Get("{nextLink}") @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getKeyValuesNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Sync-Token") String syncToken, @HeaderParam("Accept-Datetime") String acceptDatetime, - @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, - @HeaderParam("Accept") String accept, Context context); + Mono> getSnapshotsNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + Context context); @Get("{nextLink}") @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getKeyValuesNextNoCustomHeaders( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Sync-Token") String syncToken, @HeaderParam("Accept-Datetime") String acceptDatetime, - @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, - @HeaderParam("Accept") String accept, Context context); + Response getSnapshotsNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + Context context); @Get("{nextLink}") @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - ResponseBase getKeyValuesNextSync( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Sync-Token") String syncToken, @HeaderParam("Accept-Datetime") String acceptDatetime, - @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, - @HeaderParam("Accept") String accept, Context context); + Mono> getLabelsNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + Context context); @Get("{nextLink}") @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getKeyValuesNextNoCustomHeadersSync( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Sync-Token") String syncToken, @HeaderParam("Accept-Datetime") String acceptDatetime, - @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch, - @HeaderParam("Accept") String accept, Context context); + Response getLabelsNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + Context context); @Get("{nextLink}") @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getSnapshotsNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Sync-Token") String syncToken, @HeaderParam("Accept") String accept, Context context); + Mono> getRevisionsNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + Context context); @Get("{nextLink}") @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getSnapshotsNextNoCustomHeaders( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Sync-Token") String syncToken, @HeaderParam("Accept") String accept, Context context); + Response getRevisionsNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, RequestOptions requestOptions, + Context context); + } - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - ResponseBase getSnapshotsNextSync( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Sync-Token") String syncToken, @HeaderParam("Accept") String accept, Context context); + /** + * Gets a list of keys. + *

Query Parameters

+ * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
nameStringNoA filter for the name of the returned keys.
AfterStringNoInstructs the server to return elements that appear after the + * element referred + * to by the specified token.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Sync-TokenStringNoUsed to guarantee real-time consistency between + * requests.
Accept-DatetimeStringNoRequests the server to respond with the state of the + * resource at the specified + * time.
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     name: String (Required)
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a list of keys along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getKeysSinglePageAsync(RequestOptions requestOptions) { + final String accept = "application/vnd.microsoft.appconfig.keyset+json, application/problem+json"; + return FluxUtil + .withContext(context -> service.getKeys(this.getEndpoint(), this.getServiceVersion().getVersion(), accept, + requestOptions, context)) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "items"), getNextLink(res.getValue(), "@nextLink"), null)); + } - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getSnapshotsNextNoCustomHeadersSync( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Sync-Token") String syncToken, @HeaderParam("Accept") String accept, Context context); + /** + * Gets a list of keys. + *

Query Parameters

+ * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
nameStringNoA filter for the name of the returned keys.
AfterStringNoInstructs the server to return elements that appear after the + * element referred + * to by the specified token.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Sync-TokenStringNoUsed to guarantee real-time consistency between + * requests.
Accept-DatetimeStringNoRequests the server to respond with the state of the + * resource at the specified + * time.
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     name: String (Required)
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a list of keys as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux getKeysAsync(RequestOptions requestOptions) { + RequestOptions requestOptionsForNextPage = new RequestOptions(); + requestOptionsForNextPage.setContext( + requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); + return new PagedFlux<>(() -> getKeysSinglePageAsync(requestOptions), + nextLink -> getKeysNextSinglePageAsync(nextLink, requestOptionsForNextPage)); + } - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getLabelsNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Sync-Token") String syncToken, @HeaderParam("Accept-Datetime") String acceptDatetime, - @HeaderParam("Accept") String accept, Context context); - - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getLabelsNextNoCustomHeaders( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Sync-Token") String syncToken, @HeaderParam("Accept-Datetime") String acceptDatetime, - @HeaderParam("Accept") String accept, Context context); - - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - ResponseBase getLabelsNextSync( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Sync-Token") String syncToken, @HeaderParam("Accept-Datetime") String acceptDatetime, - @HeaderParam("Accept") String accept, Context context); - - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getLabelsNextNoCustomHeadersSync( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Sync-Token") String syncToken, @HeaderParam("Accept-Datetime") String acceptDatetime, - @HeaderParam("Accept") String accept, Context context); - - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getRevisionsNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Sync-Token") String syncToken, @HeaderParam("Accept-Datetime") String acceptDatetime, - @HeaderParam("Accept") String accept, Context context); - - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Mono> getRevisionsNextNoCustomHeaders( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Sync-Token") String syncToken, @HeaderParam("Accept-Datetime") String acceptDatetime, - @HeaderParam("Accept") String accept, Context context); - - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - ResponseBase getRevisionsNextSync( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Sync-Token") String syncToken, @HeaderParam("Accept-Datetime") String acceptDatetime, - @HeaderParam("Accept") String accept, Context context); - - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(HttpResponseException.class) - Response getRevisionsNextNoCustomHeadersSync( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, - @HeaderParam("Sync-Token") String syncToken, @HeaderParam("Accept-Datetime") String acceptDatetime, - @HeaderParam("Accept") String accept, Context context); - } + /** + * Gets a list of keys. + *

Query Parameters

+ * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
nameStringNoA filter for the name of the returned keys.
AfterStringNoInstructs the server to return elements that appear after the + * element referred + * to by the specified token.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Sync-TokenStringNoUsed to guarantee real-time consistency between + * requests.
Accept-DatetimeStringNoRequests the server to respond with the state of the + * resource at the specified + * time.
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     name: String (Required)
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a list of keys along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PagedResponse getKeysSinglePage(RequestOptions requestOptions) { + final String accept = "application/vnd.microsoft.appconfig.keyset+json, application/problem+json"; + Response res = service.getKeysSync(this.getEndpoint(), this.getServiceVersion().getVersion(), + accept, requestOptions, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "items"), getNextLink(res.getValue(), "@nextLink"), null); + } /** * Gets a list of keys. - * - * @param name A filter for the name of the returned keys. - * @param after Instructs the server to return elements that appear after the element referred to by the specified - * token. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of keys along with {@link PagedResponse} on successful completion of {@link Mono}. + *

Query Parameters

+ * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
nameStringNoA filter for the name of the returned keys.
AfterStringNoInstructs the server to return elements that appear after the + * element referred + * to by the specified token.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Sync-TokenStringNoUsed to guarantee real-time consistency between + * requests.
Accept-DatetimeStringNoRequests the server to respond with the state of the + * resource at the specified + * time.
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     name: String (Required)
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a list of keys as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getKeysSinglePageAsync(String name, String after, String acceptDatetime) { - final String accept = "application/vnd.microsoft.appconfig.keyset+json, application/problem+json"; - return FluxUtil - .withContext(context -> service.getKeys(this.getEndpoint(), name, this.getSyncToken(), this.getApiVersion(), - after, acceptDatetime, accept, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getItems(), res.getValue().getNextLink(), res.getDeserializedHeaders())); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable getKeys(RequestOptions requestOptions) { + RequestOptions requestOptionsForNextPage = new RequestOptions(); + requestOptionsForNextPage.setContext( + requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); + return new PagedIterable<>(() -> getKeysSinglePage(requestOptions), + nextLink -> getKeysNextSinglePage(nextLink, requestOptionsForNextPage)); } /** - * Gets a list of keys. - * - * @param name A filter for the name of the returned keys. - * @param after Instructs the server to return elements that appear after the element referred to by the specified - * token. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of keys along with {@link PagedResponse} on successful completion of {@link Mono}. + * Requests the headers and status of the given resource. + *

Query Parameters

+ * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
nameStringNoA filter for the name of the returned keys.
AfterStringNoInstructs the server to return elements that appear after the + * element referred + * to by the specified token.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Sync-TokenStringNoUsed to guarantee real-time consistency between + * requests.
Accept-DatetimeStringNoRequests the server to respond with the state of the + * resource at the specified + * time.
+ * You can add these to a request with {@link RequestOptions#addHeader} + * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getKeysSinglePageAsync(String name, String after, String acceptDatetime, - Context context) { - final String accept = "application/vnd.microsoft.appconfig.keyset+json, application/problem+json"; - return service - .getKeys(this.getEndpoint(), name, this.getSyncToken(), this.getApiVersion(), after, acceptDatetime, accept, - context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getItems(), res.getValue().getNextLink(), res.getDeserializedHeaders())); - } - - /** - * Gets a list of keys. - * - * @param name A filter for the name of the returned keys. - * @param after Instructs the server to return elements that appear after the element referred to by the specified - * token. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of keys as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux getKeysAsync(String name, String after, String acceptDatetime) { - return new PagedFlux<>(() -> getKeysSinglePageAsync(name, after, acceptDatetime), - nextLink -> getKeysNextSinglePageAsync(nextLink, acceptDatetime)); + public Mono> checkKeysWithResponseAsync(RequestOptions requestOptions) { + return FluxUtil.withContext(context -> service.checkKeys(this.getEndpoint(), + this.getServiceVersion().getVersion(), requestOptions, context)); } /** - * Gets a list of keys. - * - * @param name A filter for the name of the returned keys. - * @param after Instructs the server to return elements that appear after the element referred to by the specified - * token. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of keys as paginated response with {@link PagedFlux}. + * Requests the headers and status of the given resource. + *

Query Parameters

+ * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
nameStringNoA filter for the name of the returned keys.
AfterStringNoInstructs the server to return elements that appear after the + * element referred + * to by the specified token.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Sync-TokenStringNoUsed to guarantee real-time consistency between + * requests.
Accept-DatetimeStringNoRequests the server to respond with the state of the + * resource at the specified + * time.
+ * You can add these to a request with {@link RequestOptions#addHeader} + * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux getKeysAsync(String name, String after, String acceptDatetime, Context context) { - return new PagedFlux<>(() -> getKeysSinglePageAsync(name, after, acceptDatetime, context), - nextLink -> getKeysNextSinglePageAsync(nextLink, acceptDatetime, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Response checkKeysWithResponse(RequestOptions requestOptions) { + return service.checkKeysSync(this.getEndpoint(), this.getServiceVersion().getVersion(), requestOptions, + Context.NONE); } /** - * Gets a list of keys. - * - * @param name A filter for the name of the returned keys. - * @param after Instructs the server to return elements that appear after the element referred to by the specified - * token. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of keys along with {@link PagedResponse} on successful completion of {@link Mono}. + * Gets a list of key-values. + *

Query Parameters

+ * + * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
keyStringNoA filter used to match keys. Syntax reference: + * https://aka.ms/azconfig/docs/keyvaluefiltering
labelStringNoA filter used to match labels. Syntax reference: + * https://aka.ms/azconfig/docs/keyvaluefiltering
AfterStringNoInstructs the server to return elements that appear after the + * element referred + * to by the specified token.
$SelectList<String>NoUsed to select what fields are present in the + * returned resource(s). In the form of "," separated string.
snapshotStringNoA filter used get key-values for a snapshot. The value should + * be the name of + * the snapshot. Not valid when used with 'key' and 'label' filters.
tagsList<String>NoA filter used to query by tags. Syntax reference: + * https://aka.ms/azconfig/docs/keyvaluefiltering. Call {@link RequestOptions#addQueryParam} to add string to + * array.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Sync-TokenStringNoUsed to guarantee real-time consistency between + * requests.
Accept-DatetimeStringNoRequests the server to respond with the state of the + * resource at the specified + * time.
If-MatchStringNoUsed to perform an operation only if the targeted resource's + * etag matches the + * value provided.
If-None-MatchStringNoUsed to perform an operation only if the targeted + * resource's etag does not + * match the value provided.
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     key: String (Required)
+     *     label: String (Optional)
+     *     content_type: String (Optional)
+     *     value: String (Optional)
+     *     last_modified: OffsetDateTime (Optional)
+     *     tags (Optional): {
+     *         String: String (Required)
+     *     }
+     *     locked: Boolean (Optional)
+     *     etag: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a list of key-values along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getKeysNoCustomHeadersSinglePageAsync(String name, String after, - String acceptDatetime) { - final String accept = "application/vnd.microsoft.appconfig.keyset+json, application/problem+json"; + public Mono> listConfigurationSettingsSinglePageAsync(RequestOptions requestOptions) { + final String accept = "application/vnd.microsoft.appconfig.kvset+json, application/problem+json"; return FluxUtil - .withContext(context -> service.getKeysNoCustomHeaders(this.getEndpoint(), name, this.getSyncToken(), - this.getApiVersion(), after, acceptDatetime, accept, context)) + .withContext(context -> service.listConfigurationSettings(this.getEndpoint(), + this.getServiceVersion().getVersion(), accept, requestOptions, context)) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getItems(), res.getValue().getNextLink(), null)); + getValues(res.getValue(), "items"), getNextLink(res.getValue(), "@nextLink"), null)); } /** - * Gets a list of keys. - * - * @param name A filter for the name of the returned keys. - * @param after Instructs the server to return elements that appear after the element referred to by the specified - * token. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of keys along with {@link PagedResponse} on successful completion of {@link Mono}. + * Gets a list of key-values. + *

Query Parameters

+ * + * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
keyStringNoA filter used to match keys. Syntax reference: + * https://aka.ms/azconfig/docs/keyvaluefiltering
labelStringNoA filter used to match labels. Syntax reference: + * https://aka.ms/azconfig/docs/keyvaluefiltering
AfterStringNoInstructs the server to return elements that appear after the + * element referred + * to by the specified token.
$SelectList<String>NoUsed to select what fields are present in the + * returned resource(s). In the form of "," separated string.
snapshotStringNoA filter used get key-values for a snapshot. The value should + * be the name of + * the snapshot. Not valid when used with 'key' and 'label' filters.
tagsList<String>NoA filter used to query by tags. Syntax reference: + * https://aka.ms/azconfig/docs/keyvaluefiltering. Call {@link RequestOptions#addQueryParam} to add string to + * array.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Sync-TokenStringNoUsed to guarantee real-time consistency between + * requests.
Accept-DatetimeStringNoRequests the server to respond with the state of the + * resource at the specified + * time.
If-MatchStringNoUsed to perform an operation only if the targeted resource's + * etag matches the + * value provided.
If-None-MatchStringNoUsed to perform an operation only if the targeted + * resource's etag does not + * match the value provided.
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     key: String (Required)
+     *     label: String (Optional)
+     *     content_type: String (Optional)
+     *     value: String (Optional)
+     *     last_modified: OffsetDateTime (Optional)
+     *     tags (Optional): {
+     *         String: String (Required)
+     *     }
+     *     locked: Boolean (Optional)
+     *     etag: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a list of key-values as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getKeysNoCustomHeadersSinglePageAsync(String name, String after, - String acceptDatetime, Context context) { - final String accept = "application/vnd.microsoft.appconfig.keyset+json, application/problem+json"; - return service - .getKeysNoCustomHeaders(this.getEndpoint(), name, this.getSyncToken(), this.getApiVersion(), after, - acceptDatetime, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getItems(), res.getValue().getNextLink(), null)); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listConfigurationSettingsAsync(RequestOptions requestOptions) { + RequestOptions requestOptionsForNextPage = new RequestOptions(); + requestOptionsForNextPage.setContext( + requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); + return new PagedFlux<>(() -> listConfigurationSettingsSinglePageAsync(requestOptions), + nextLink -> listConfigurationSettingsNextSinglePageAsync(nextLink, requestOptionsForNextPage)); } /** - * Gets a list of keys. - * - * @param name A filter for the name of the returned keys. - * @param after Instructs the server to return elements that appear after the element referred to by the specified - * token. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of keys as paginated response with {@link PagedFlux}. + * Gets a list of key-values. + *

Query Parameters

+ * + * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
keyStringNoA filter used to match keys. Syntax reference: + * https://aka.ms/azconfig/docs/keyvaluefiltering
labelStringNoA filter used to match labels. Syntax reference: + * https://aka.ms/azconfig/docs/keyvaluefiltering
AfterStringNoInstructs the server to return elements that appear after the + * element referred + * to by the specified token.
$SelectList<String>NoUsed to select what fields are present in the + * returned resource(s). In the form of "," separated string.
snapshotStringNoA filter used get key-values for a snapshot. The value should + * be the name of + * the snapshot. Not valid when used with 'key' and 'label' filters.
tagsList<String>NoA filter used to query by tags. Syntax reference: + * https://aka.ms/azconfig/docs/keyvaluefiltering. Call {@link RequestOptions#addQueryParam} to add string to + * array.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Sync-TokenStringNoUsed to guarantee real-time consistency between + * requests.
Accept-DatetimeStringNoRequests the server to respond with the state of the + * resource at the specified + * time.
If-MatchStringNoUsed to perform an operation only if the targeted resource's + * etag matches the + * value provided.
If-None-MatchStringNoUsed to perform an operation only if the targeted + * resource's etag does not + * match the value provided.
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     key: String (Required)
+     *     label: String (Optional)
+     *     content_type: String (Optional)
+     *     value: String (Optional)
+     *     last_modified: OffsetDateTime (Optional)
+     *     tags (Optional): {
+     *         String: String (Required)
+     *     }
+     *     locked: Boolean (Optional)
+     *     etag: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a list of key-values along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux getKeysNoCustomHeadersAsync(String name, String after, String acceptDatetime) { - return new PagedFlux<>(() -> getKeysNoCustomHeadersSinglePageAsync(name, after, acceptDatetime), - nextLink -> getKeysNextSinglePageAsync(nextLink, acceptDatetime)); + @ServiceMethod(returns = ReturnType.SINGLE) + public PagedResponse listConfigurationSettingsSinglePage(RequestOptions requestOptions) { + final String accept = "application/vnd.microsoft.appconfig.kvset+json, application/problem+json"; + Response res = service.listConfigurationSettingsSync(this.getEndpoint(), + this.getServiceVersion().getVersion(), accept, requestOptions, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "items"), getNextLink(res.getValue(), "@nextLink"), null); } /** - * Gets a list of keys. - * - * @param name A filter for the name of the returned keys. - * @param after Instructs the server to return elements that appear after the element referred to by the specified - * token. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of keys as paginated response with {@link PagedFlux}. + * Gets a list of key-values. + *

Query Parameters

+ * + * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
keyStringNoA filter used to match keys. Syntax reference: + * https://aka.ms/azconfig/docs/keyvaluefiltering
labelStringNoA filter used to match labels. Syntax reference: + * https://aka.ms/azconfig/docs/keyvaluefiltering
AfterStringNoInstructs the server to return elements that appear after the + * element referred + * to by the specified token.
$SelectList<String>NoUsed to select what fields are present in the + * returned resource(s). In the form of "," separated string.
snapshotStringNoA filter used get key-values for a snapshot. The value should + * be the name of + * the snapshot. Not valid when used with 'key' and 'label' filters.
tagsList<String>NoA filter used to query by tags. Syntax reference: + * https://aka.ms/azconfig/docs/keyvaluefiltering. Call {@link RequestOptions#addQueryParam} to add string to + * array.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Sync-TokenStringNoUsed to guarantee real-time consistency between + * requests.
Accept-DatetimeStringNoRequests the server to respond with the state of the + * resource at the specified + * time.
If-MatchStringNoUsed to perform an operation only if the targeted resource's + * etag matches the + * value provided.
If-None-MatchStringNoUsed to perform an operation only if the targeted + * resource's etag does not + * match the value provided.
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     key: String (Required)
+     *     label: String (Optional)
+     *     content_type: String (Optional)
+     *     value: String (Optional)
+     *     last_modified: OffsetDateTime (Optional)
+     *     tags (Optional): {
+     *         String: String (Required)
+     *     }
+     *     locked: Boolean (Optional)
+     *     etag: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a list of key-values as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux getKeysNoCustomHeadersAsync(String name, String after, String acceptDatetime, - Context context) { - return new PagedFlux<>(() -> getKeysNoCustomHeadersSinglePageAsync(name, after, acceptDatetime, context), - nextLink -> getKeysNextSinglePageAsync(nextLink, acceptDatetime, context)); + public PagedIterable listConfigurationSettings(RequestOptions requestOptions) { + RequestOptions requestOptionsForNextPage = new RequestOptions(); + requestOptionsForNextPage.setContext( + requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); + return new PagedIterable<>(() -> listConfigurationSettingsSinglePage(requestOptions), + nextLink -> listConfigurationSettingsNextSinglePage(nextLink, requestOptionsForNextPage)); } /** - * Gets a list of keys. - * - * @param name A filter for the name of the returned keys. - * @param after Instructs the server to return elements that appear after the element referred to by the specified - * token. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of keys along with {@link PagedResponse}. + * Requests the headers and status of the given resource. + *

Query Parameters

+ * + * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
keyStringNoA filter used to match keys. Syntax reference: + * https://aka.ms/azconfig/docs/keyvaluefiltering
labelStringNoA filter used to match labels. Syntax reference: + * https://aka.ms/azconfig/docs/keyvaluefiltering
AfterStringNoInstructs the server to return elements that appear after the + * element referred + * to by the specified token.
$SelectList<String>NoUsed to select what fields are present in the + * returned resource(s). In the form of "," separated string.
snapshotStringNoA filter used get key-values for a snapshot. The value should + * be the name of + * the snapshot. Not valid when used with 'key' and 'label' filters.
tagsList<String>NoA filter used to query by tags. Syntax reference: + * https://aka.ms/azconfig/docs/keyvaluefiltering. Call {@link RequestOptions#addQueryParam} to add string to + * array.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Sync-TokenStringNoUsed to guarantee real-time consistency between + * requests.
Accept-DatetimeStringNoRequests the server to respond with the state of the + * resource at the specified + * time.
If-MatchStringNoUsed to perform an operation only if the targeted resource's + * etag matches the + * value provided.
If-None-MatchStringNoUsed to perform an operation only if the targeted + * resource's etag does not + * match the value provided.
+ * You can add these to a request with {@link RequestOptions#addHeader} + * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PagedResponse getKeysSinglePage(String name, String after, String acceptDatetime) { - final String accept = "application/vnd.microsoft.appconfig.keyset+json, application/problem+json"; - ResponseBase res = service.getKeysSync(this.getEndpoint(), name, - this.getSyncToken(), this.getApiVersion(), after, acceptDatetime, accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getItems(), res.getValue().getNextLink(), res.getDeserializedHeaders()); + public Mono> checkKeyValuesWithResponseAsync(RequestOptions requestOptions) { + return FluxUtil.withContext(context -> service.checkKeyValues(this.getEndpoint(), + this.getServiceVersion().getVersion(), requestOptions, context)); } /** - * Gets a list of keys. - * - * @param name A filter for the name of the returned keys. - * @param after Instructs the server to return elements that appear after the element referred to by the specified - * token. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of keys along with {@link PagedResponse}. + * Requests the headers and status of the given resource. + *

Query Parameters

+ * + * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
keyStringNoA filter used to match keys. Syntax reference: + * https://aka.ms/azconfig/docs/keyvaluefiltering
labelStringNoA filter used to match labels. Syntax reference: + * https://aka.ms/azconfig/docs/keyvaluefiltering
AfterStringNoInstructs the server to return elements that appear after the + * element referred + * to by the specified token.
$SelectList<String>NoUsed to select what fields are present in the + * returned resource(s). In the form of "," separated string.
snapshotStringNoA filter used get key-values for a snapshot. The value should + * be the name of + * the snapshot. Not valid when used with 'key' and 'label' filters.
tagsList<String>NoA filter used to query by tags. Syntax reference: + * https://aka.ms/azconfig/docs/keyvaluefiltering. Call {@link RequestOptions#addQueryParam} to add string to + * array.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Sync-TokenStringNoUsed to guarantee real-time consistency between + * requests.
Accept-DatetimeStringNoRequests the server to respond with the state of the + * resource at the specified + * time.
If-MatchStringNoUsed to perform an operation only if the targeted resource's + * etag matches the + * value provided.
If-None-MatchStringNoUsed to perform an operation only if the targeted + * resource's etag does not + * match the value provided.
+ * You can add these to a request with {@link RequestOptions#addHeader} + * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PagedResponse getKeysSinglePage(String name, String after, String acceptDatetime, Context context) { - final String accept = "application/vnd.microsoft.appconfig.keyset+json, application/problem+json"; - ResponseBase res = service.getKeysSync(this.getEndpoint(), name, - this.getSyncToken(), this.getApiVersion(), after, acceptDatetime, accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getItems(), res.getValue().getNextLink(), res.getDeserializedHeaders()); + public Response checkKeyValuesWithResponse(RequestOptions requestOptions) { + return service.checkKeyValuesSync(this.getEndpoint(), this.getServiceVersion().getVersion(), requestOptions, + Context.NONE); } /** - * Gets a list of keys. - * - * @param name A filter for the name of the returned keys. - * @param after Instructs the server to return elements that appear after the element referred to by the specified - * token. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of keys as paginated response with {@link PagedIterable}. + * Gets a single key-value. + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
labelStringNoThe label of the key-value to retrieve.
$SelectList<String>NoUsed to select what fields are present in the + * returned resource(s). In the form of "," separated string.
tagsList<String>NoA filter used to query by tags. Syntax reference: + * https://aka.ms/azconfig/docs/keyvaluefiltering. Call {@link RequestOptions#addQueryParam} to add string to + * array.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Sync-TokenStringNoUsed to guarantee real-time consistency between + * requests.
Accept-DatetimeStringNoRequests the server to respond with the state of the + * resource at the specified + * time.
If-MatchStringNoUsed to perform an operation only if the targeted resource's + * etag matches the + * value provided.
If-None-MatchStringNoUsed to perform an operation only if the targeted + * resource's etag does not + * match the value provided.
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     key: String (Required)
+     *     label: String (Optional)
+     *     content_type: String (Optional)
+     *     value: String (Optional)
+     *     last_modified: OffsetDateTime (Optional)
+     *     tags (Optional): {
+     *         String: String (Required)
+     *     }
+     *     locked: Boolean (Optional)
+     *     etag: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param key The key of the key-value. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a single key-value along with {@link Response} on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable getKeys(String name, String after, String acceptDatetime) { - return new PagedIterable<>(() -> getKeysSinglePage(name, after, acceptDatetime), - nextLink -> getKeysNextSinglePage(nextLink, acceptDatetime)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getKeyValueWithResponseAsync(String key, RequestOptions requestOptions) { + final String accept = "application/vnd.microsoft.appconfig.kv+json, application/problem+json"; + return FluxUtil.withContext(context -> service.getKeyValue(this.getEndpoint(), + this.getServiceVersion().getVersion(), key, accept, requestOptions, context)); } /** - * Gets a list of keys. - * - * @param name A filter for the name of the returned keys. - * @param after Instructs the server to return elements that appear after the element referred to by the specified - * token. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of keys as paginated response with {@link PagedIterable}. + * Gets a single key-value. + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
labelStringNoThe label of the key-value to retrieve.
$SelectList<String>NoUsed to select what fields are present in the + * returned resource(s). In the form of "," separated string.
tagsList<String>NoA filter used to query by tags. Syntax reference: + * https://aka.ms/azconfig/docs/keyvaluefiltering. Call {@link RequestOptions#addQueryParam} to add string to + * array.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Sync-TokenStringNoUsed to guarantee real-time consistency between + * requests.
Accept-DatetimeStringNoRequests the server to respond with the state of the + * resource at the specified + * time.
If-MatchStringNoUsed to perform an operation only if the targeted resource's + * etag matches the + * value provided.
If-None-MatchStringNoUsed to perform an operation only if the targeted + * resource's etag does not + * match the value provided.
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     key: String (Required)
+     *     label: String (Optional)
+     *     content_type: String (Optional)
+     *     value: String (Optional)
+     *     last_modified: OffsetDateTime (Optional)
+     *     tags (Optional): {
+     *         String: String (Required)
+     *     }
+     *     locked: Boolean (Optional)
+     *     etag: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param key The key of the key-value. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a single key-value along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable getKeys(String name, String after, String acceptDatetime, Context context) { - return new PagedIterable<>(() -> getKeysSinglePage(name, after, acceptDatetime, context), - nextLink -> getKeysNextSinglePage(nextLink, acceptDatetime, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getKeyValueWithResponse(String key, RequestOptions requestOptions) { + final String accept = "application/vnd.microsoft.appconfig.kv+json, application/problem+json"; + return service.getKeyValueSync(this.getEndpoint(), this.getServiceVersion().getVersion(), key, accept, + requestOptions, Context.NONE); } /** - * Gets a list of keys. + * Creates a key-value. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
labelStringNoThe label of the key-value to create.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Sync-TokenStringNoUsed to guarantee real-time consistency between + * requests.
If-MatchStringNoUsed to perform an operation only if the targeted resource's + * etag matches the + * value provided.
If-None-MatchStringNoUsed to perform an operation only if the targeted + * resource's etag does not + * match the value provided.
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     key: String (Required)
+     *     label: String (Optional)
+     *     content_type: String (Optional)
+     *     value: String (Optional)
+     *     last_modified: OffsetDateTime (Optional)
+     *     tags (Optional): {
+     *         String: String (Required)
+     *     }
+     *     locked: Boolean (Optional)
+     *     etag: String (Optional)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     key: String (Required)
+     *     label: String (Optional)
+     *     content_type: String (Optional)
+     *     value: String (Optional)
+     *     last_modified: OffsetDateTime (Optional)
+     *     tags (Optional): {
+     *         String: String (Required)
+     *     }
+     *     locked: Boolean (Optional)
+     *     etag: String (Optional)
+     * }
+     * }
+     * 
* - * @param name A filter for the name of the returned keys. - * @param after Instructs the server to return elements that appear after the element referred to by the specified - * token. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @throws IllegalArgumentException thrown if parameters fail the validation. + * @param key The key of the key-value to create. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of keys along with {@link PagedResponse}. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a key-value pair representing application settings along with {@link Response} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PagedResponse getKeysNoCustomHeadersSinglePage(String name, String after, String acceptDatetime) { - final String accept = "application/vnd.microsoft.appconfig.keyset+json, application/problem+json"; - Response res = service.getKeysNoCustomHeadersSync(this.getEndpoint(), name, this.getSyncToken(), - this.getApiVersion(), after, acceptDatetime, accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getItems(), res.getValue().getNextLink(), null); + public Mono> setConfigurationSettingWithResponseAsync(String key, + RequestOptions requestOptions) { + final String accept = "application/vnd.microsoft.appconfig.kv+json, application/problem+json"; + RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions; + requestOptionsLocal.addRequestCallback(requestLocal -> { + if (requestLocal.getBody() != null && requestLocal.getHeaders().get(HttpHeaderName.CONTENT_TYPE) == null) { + requestLocal.getHeaders().set(HttpHeaderName.CONTENT_TYPE, "application/json"); + } + }); + return FluxUtil.withContext(context -> service.setConfigurationSetting(this.getEndpoint(), + this.getServiceVersion().getVersion(), key, accept, requestOptionsLocal, context)); } /** - * Gets a list of keys. + * Creates a key-value. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
labelStringNoThe label of the key-value to create.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Sync-TokenStringNoUsed to guarantee real-time consistency between + * requests.
If-MatchStringNoUsed to perform an operation only if the targeted resource's + * etag matches the + * value provided.
If-None-MatchStringNoUsed to perform an operation only if the targeted + * resource's etag does not + * match the value provided.
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     key: String (Required)
+     *     label: String (Optional)
+     *     content_type: String (Optional)
+     *     value: String (Optional)
+     *     last_modified: OffsetDateTime (Optional)
+     *     tags (Optional): {
+     *         String: String (Required)
+     *     }
+     *     locked: Boolean (Optional)
+     *     etag: String (Optional)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     key: String (Required)
+     *     label: String (Optional)
+     *     content_type: String (Optional)
+     *     value: String (Optional)
+     *     last_modified: OffsetDateTime (Optional)
+     *     tags (Optional): {
+     *         String: String (Required)
+     *     }
+     *     locked: Boolean (Optional)
+     *     etag: String (Optional)
+     * }
+     * }
+     * 
* - * @param name A filter for the name of the returned keys. - * @param after Instructs the server to return elements that appear after the element referred to by the specified - * token. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. + * @param key The key of the key-value to create. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of keys along with {@link PagedResponse}. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a key-value pair representing application settings along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PagedResponse getKeysNoCustomHeadersSinglePage(String name, String after, String acceptDatetime, - Context context) { - final String accept = "application/vnd.microsoft.appconfig.keyset+json, application/problem+json"; - Response res = service.getKeysNoCustomHeadersSync(this.getEndpoint(), name, this.getSyncToken(), - this.getApiVersion(), after, acceptDatetime, accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getItems(), res.getValue().getNextLink(), null); + public Response setConfigurationSettingWithResponse(String key, RequestOptions requestOptions) { + final String accept = "application/vnd.microsoft.appconfig.kv+json, application/problem+json"; + RequestOptions requestOptionsLocal = requestOptions == null ? new RequestOptions() : requestOptions; + requestOptionsLocal.addRequestCallback(requestLocal -> { + if (requestLocal.getBody() != null && requestLocal.getHeaders().get(HttpHeaderName.CONTENT_TYPE) == null) { + requestLocal.getHeaders().set(HttpHeaderName.CONTENT_TYPE, "application/json"); + } + }); + return service.setConfigurationSettingSync(this.getEndpoint(), this.getServiceVersion().getVersion(), key, + accept, requestOptionsLocal, Context.NONE); } /** - * Gets a list of keys. + * Deletes a key-value. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
labelStringNoThe label of the key-value to delete.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Sync-TokenStringNoUsed to guarantee real-time consistency between + * requests.
If-MatchStringNoUsed to perform an operation only if the targeted resource's + * etag matches the + * value provided.
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     key: String (Required)
+     *     label: String (Optional)
+     *     content_type: String (Optional)
+     *     value: String (Optional)
+     *     last_modified: OffsetDateTime (Optional)
+     *     tags (Optional): {
+     *         String: String (Required)
+     *     }
+     *     locked: Boolean (Optional)
+     *     etag: String (Optional)
+     * }
+     * }
+     * 
* - * @param name A filter for the name of the returned keys. - * @param after Instructs the server to return elements that appear after the element referred to by the specified - * token. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @throws IllegalArgumentException thrown if parameters fail the validation. + * @param key The key of the key-value to delete. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of keys as paginated response with {@link PagedIterable}. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a key-value pair representing application settings along with {@link Response} on successful completion + * of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable getKeysNoCustomHeaders(String name, String after, String acceptDatetime) { - return new PagedIterable<>(() -> getKeysNoCustomHeadersSinglePage(name, after, acceptDatetime), - nextLink -> getKeysNextSinglePage(nextLink, acceptDatetime)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> deleteConfigurationSettingWithResponseAsync(String key, + RequestOptions requestOptions) { + final String accept = "application/vnd.microsoft.appconfig.kv+json, application/problem+json"; + return FluxUtil.withContext(context -> service.deleteConfigurationSetting(this.getEndpoint(), + this.getServiceVersion().getVersion(), key, accept, requestOptions, context)); } /** - * Gets a list of keys. + * Deletes a key-value. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
labelStringNoThe label of the key-value to delete.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Sync-TokenStringNoUsed to guarantee real-time consistency between + * requests.
If-MatchStringNoUsed to perform an operation only if the targeted resource's + * etag matches the + * value provided.
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     key: String (Required)
+     *     label: String (Optional)
+     *     content_type: String (Optional)
+     *     value: String (Optional)
+     *     last_modified: OffsetDateTime (Optional)
+     *     tags (Optional): {
+     *         String: String (Required)
+     *     }
+     *     locked: Boolean (Optional)
+     *     etag: String (Optional)
+     * }
+     * }
+     * 
* - * @param name A filter for the name of the returned keys. - * @param after Instructs the server to return elements that appear after the element referred to by the specified - * token. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. + * @param key The key of the key-value to delete. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of keys as paginated response with {@link PagedIterable}. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a key-value pair representing application settings along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable getKeysNoCustomHeaders(String name, String after, String acceptDatetime, - Context context) { - return new PagedIterable<>(() -> getKeysNoCustomHeadersSinglePage(name, after, acceptDatetime, context), - nextLink -> getKeysNextSinglePage(nextLink, acceptDatetime, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Response deleteConfigurationSettingWithResponse(String key, RequestOptions requestOptions) { + final String accept = "application/vnd.microsoft.appconfig.kv+json, application/problem+json"; + return service.deleteConfigurationSettingSync(this.getEndpoint(), this.getServiceVersion().getVersion(), key, + accept, requestOptions, Context.NONE); } /** * Requests the headers and status of the given resource. + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
labelStringNoThe label of the key-value to retrieve.
$SelectList<String>NoUsed to select what fields are present in the + * returned resource(s). In the form of "," separated string.
tagsList<String>NoA filter used to query by tags. Syntax reference: + * https://aka.ms/azconfig/docs/keyvaluefiltering. Call {@link RequestOptions#addQueryParam} to add string to + * array.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Sync-TokenStringNoUsed to guarantee real-time consistency between + * requests.
Accept-DatetimeStringNoRequests the server to respond with the state of the + * resource at the specified + * time.
If-MatchStringNoUsed to perform an operation only if the targeted resource's + * etag matches the + * value provided.
If-None-MatchStringNoUsed to perform an operation only if the targeted + * resource's etag does not + * match the value provided.
+ * You can add these to a request with {@link RequestOptions#addHeader} * - * @param name A filter for the name of the returned keys. - * @param after Instructs the server to return elements that appear after the element referred to by the specified - * token. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @throws IllegalArgumentException thrown if parameters fail the validation. + * @param key The key of the key-value to retrieve. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase} on successful completion of {@link Mono}. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> checkKeysWithResponseAsync(String name, String after, - String acceptDatetime) { - return FluxUtil.withContext(context -> checkKeysWithResponseAsync(name, after, acceptDatetime, context)); + public Mono> checkKeyValueWithResponseAsync(String key, RequestOptions requestOptions) { + return FluxUtil.withContext(context -> service.checkKeyValue(this.getEndpoint(), + this.getServiceVersion().getVersion(), key, requestOptions, context)); } /** * Requests the headers and status of the given resource. + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
labelStringNoThe label of the key-value to retrieve.
$SelectList<String>NoUsed to select what fields are present in the + * returned resource(s). In the form of "," separated string.
tagsList<String>NoA filter used to query by tags. Syntax reference: + * https://aka.ms/azconfig/docs/keyvaluefiltering. Call {@link RequestOptions#addQueryParam} to add string to + * array.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Sync-TokenStringNoUsed to guarantee real-time consistency between + * requests.
Accept-DatetimeStringNoRequests the server to respond with the state of the + * resource at the specified + * time.
If-MatchStringNoUsed to perform an operation only if the targeted resource's + * etag matches the + * value provided.
If-None-MatchStringNoUsed to perform an operation only if the targeted + * resource's etag does not + * match the value provided.
+ * You can add these to a request with {@link RequestOptions#addHeader} * - * @param name A filter for the name of the returned keys. - * @param after Instructs the server to return elements that appear after the element referred to by the specified - * token. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. + * @param key The key of the key-value to retrieve. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase} on successful completion of {@link Mono}. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> checkKeysWithResponseAsync(String name, String after, - String acceptDatetime, Context context) { - return service.checkKeys(this.getEndpoint(), name, this.getSyncToken(), this.getApiVersion(), after, - acceptDatetime, context); + public Response checkKeyValueWithResponse(String key, RequestOptions requestOptions) { + return service.checkKeyValueSync(this.getEndpoint(), this.getServiceVersion().getVersion(), key, requestOptions, + Context.NONE); } /** - * Requests the headers and status of the given resource. - * - * @param name A filter for the name of the returned keys. - * @param after Instructs the server to return elements that appear after the element referred to by the specified - * token. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * Gets a list of key-value snapshots. + *

Query Parameters

+ * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
nameStringNoA filter for the name of the returned snapshots.
AfterStringNoInstructs the server to return elements that appear after the + * element referred + * to by the specified token.
$SelectList<String>NoUsed to select what fields are present in the + * returned resource(s). In the form of "," separated string.
statusList<String>NoUsed to filter returned snapshots by their status + * property. In the form of "," separated string.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Sync-TokenStringNoUsed to guarantee real-time consistency between + * requests.
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     name: String (Required)
+     *     status: String(provisioning/ready/archived/failed) (Optional)
+     *     filters (Required): [
+     *          (Required){
+     *             key: String (Required)
+     *             label: String (Optional)
+     *             tags (Optional): [
+     *                 String (Optional)
+     *             ]
+     *         }
+     *     ]
+     *     composition_type: String(key/key_label) (Optional)
+     *     created: OffsetDateTime (Optional)
+     *     expires: OffsetDateTime (Optional)
+     *     retention_period: Long (Optional)
+     *     size: Long (Optional)
+     *     items_count: Long (Optional)
+     *     tags (Optional): {
+     *         String: String (Required)
+     *     }
+     *     etag: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a list of key-value snapshots along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono checkKeysAsync(String name, String after, String acceptDatetime) { - return checkKeysWithResponseAsync(name, after, acceptDatetime).flatMap(ignored -> Mono.empty()); + public Mono> getSnapshotsSinglePageAsync(RequestOptions requestOptions) { + final String accept = "application/vnd.microsoft.appconfig.snapshotset+json, application/problem+json"; + return FluxUtil + .withContext(context -> service.getSnapshots(this.getEndpoint(), this.getServiceVersion().getVersion(), + accept, requestOptions, context)) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "items"), getNextLink(res.getValue(), "@nextLink"), null)); } /** - * Requests the headers and status of the given resource. - * - * @param name A filter for the name of the returned keys. - * @param after Instructs the server to return elements that appear after the element referred to by the specified - * token. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * Gets a list of key-value snapshots. + *

Query Parameters

+ * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
nameStringNoA filter for the name of the returned snapshots.
AfterStringNoInstructs the server to return elements that appear after the + * element referred + * to by the specified token.
$SelectList<String>NoUsed to select what fields are present in the + * returned resource(s). In the form of "," separated string.
statusList<String>NoUsed to filter returned snapshots by their status + * property. In the form of "," separated string.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Sync-TokenStringNoUsed to guarantee real-time consistency between + * requests.
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     name: String (Required)
+     *     status: String(provisioning/ready/archived/failed) (Optional)
+     *     filters (Required): [
+     *          (Required){
+     *             key: String (Required)
+     *             label: String (Optional)
+     *             tags (Optional): [
+     *                 String (Optional)
+     *             ]
+     *         }
+     *     ]
+     *     composition_type: String(key/key_label) (Optional)
+     *     created: OffsetDateTime (Optional)
+     *     expires: OffsetDateTime (Optional)
+     *     retention_period: Long (Optional)
+     *     size: Long (Optional)
+     *     items_count: Long (Optional)
+     *     tags (Optional): {
+     *         String: String (Required)
+     *     }
+     *     etag: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a list of key-value snapshots as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono checkKeysAsync(String name, String after, String acceptDatetime, Context context) { - return checkKeysWithResponseAsync(name, after, acceptDatetime, context).flatMap(ignored -> Mono.empty()); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux getSnapshotsAsync(RequestOptions requestOptions) { + RequestOptions requestOptionsForNextPage = new RequestOptions(); + requestOptionsForNextPage.setContext( + requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); + return new PagedFlux<>(() -> getSnapshotsSinglePageAsync(requestOptions), + nextLink -> getSnapshotsNextSinglePageAsync(nextLink, requestOptionsForNextPage)); } /** - * Requests the headers and status of the given resource. - * - * @param name A filter for the name of the returned keys. - * @param after Instructs the server to return elements that appear after the element referred to by the specified - * token. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * Gets a list of key-value snapshots. + *

Query Parameters

+ * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
nameStringNoA filter for the name of the returned snapshots.
AfterStringNoInstructs the server to return elements that appear after the + * element referred + * to by the specified token.
$SelectList<String>NoUsed to select what fields are present in the + * returned resource(s). In the form of "," separated string.
statusList<String>NoUsed to filter returned snapshots by their status + * property. In the form of "," separated string.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Sync-TokenStringNoUsed to guarantee real-time consistency between + * requests.
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     name: String (Required)
+     *     status: String(provisioning/ready/archived/failed) (Optional)
+     *     filters (Required): [
+     *          (Required){
+     *             key: String (Required)
+     *             label: String (Optional)
+     *             tags (Optional): [
+     *                 String (Optional)
+     *             ]
+     *         }
+     *     ]
+     *     composition_type: String(key/key_label) (Optional)
+     *     created: OffsetDateTime (Optional)
+     *     expires: OffsetDateTime (Optional)
+     *     retention_period: Long (Optional)
+     *     size: Long (Optional)
+     *     items_count: Long (Optional)
+     *     tags (Optional): {
+     *         String: String (Required)
+     *     }
+     *     etag: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a list of key-value snapshots along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> checkKeysNoCustomHeadersWithResponseAsync(String name, String after, - String acceptDatetime) { - return FluxUtil - .withContext(context -> checkKeysNoCustomHeadersWithResponseAsync(name, after, acceptDatetime, context)); + public PagedResponse getSnapshotsSinglePage(RequestOptions requestOptions) { + final String accept = "application/vnd.microsoft.appconfig.snapshotset+json, application/problem+json"; + Response res = service.getSnapshotsSync(this.getEndpoint(), this.getServiceVersion().getVersion(), + accept, requestOptions, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "items"), getNextLink(res.getValue(), "@nextLink"), null); + } + + /** + * Gets a list of key-value snapshots. + *

Query Parameters

+ * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
nameStringNoA filter for the name of the returned snapshots.
AfterStringNoInstructs the server to return elements that appear after the + * element referred + * to by the specified token.
$SelectList<String>NoUsed to select what fields are present in the + * returned resource(s). In the form of "," separated string.
statusList<String>NoUsed to filter returned snapshots by their status + * property. In the form of "," separated string.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Sync-TokenStringNoUsed to guarantee real-time consistency between + * requests.
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     name: String (Required)
+     *     status: String(provisioning/ready/archived/failed) (Optional)
+     *     filters (Required): [
+     *          (Required){
+     *             key: String (Required)
+     *             label: String (Optional)
+     *             tags (Optional): [
+     *                 String (Optional)
+     *             ]
+     *         }
+     *     ]
+     *     composition_type: String(key/key_label) (Optional)
+     *     created: OffsetDateTime (Optional)
+     *     expires: OffsetDateTime (Optional)
+     *     retention_period: Long (Optional)
+     *     size: Long (Optional)
+     *     items_count: Long (Optional)
+     *     tags (Optional): {
+     *         String: String (Required)
+     *     }
+     *     etag: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a list of key-value snapshots as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable getSnapshots(RequestOptions requestOptions) { + RequestOptions requestOptionsForNextPage = new RequestOptions(); + requestOptionsForNextPage.setContext( + requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); + return new PagedIterable<>(() -> getSnapshotsSinglePage(requestOptions), + nextLink -> getSnapshotsNextSinglePage(nextLink, requestOptionsForNextPage)); } /** * Requests the headers and status of the given resource. - * - * @param name A filter for the name of the returned keys. - * @param after Instructs the server to return elements that appear after the element referred to by the specified - * token. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
AfterStringNoInstructs the server to return elements that appear after the + * element referred + * to by the specified token.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Sync-TokenStringNoUsed to guarantee real-time consistency between + * requests.
+ * You can add these to a request with {@link RequestOptions#addHeader} + * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> checkKeysNoCustomHeadersWithResponseAsync(String name, String after, - String acceptDatetime, Context context) { - return service.checkKeysNoCustomHeaders(this.getEndpoint(), name, this.getSyncToken(), this.getApiVersion(), - after, acceptDatetime, context); + public Mono> checkSnapshotsWithResponseAsync(RequestOptions requestOptions) { + return FluxUtil.withContext(context -> service.checkSnapshots(this.getEndpoint(), + this.getServiceVersion().getVersion(), requestOptions, context)); } /** * Requests the headers and status of the given resource. - * - * @param name A filter for the name of the returned keys. - * @param after Instructs the server to return elements that appear after the element referred to by the specified - * token. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase}. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
AfterStringNoInstructs the server to return elements that appear after the + * element referred + * to by the specified token.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Sync-TokenStringNoUsed to guarantee real-time consistency between + * requests.
+ * You can add these to a request with {@link RequestOptions#addHeader} + * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase checkKeysWithResponse(String name, String after, String acceptDatetime, - Context context) { - return service.checkKeysSync(this.getEndpoint(), name, this.getSyncToken(), this.getApiVersion(), after, - acceptDatetime, context); + public Response checkSnapshotsWithResponse(RequestOptions requestOptions) { + return service.checkSnapshotsSync(this.getEndpoint(), this.getServiceVersion().getVersion(), requestOptions, + Context.NONE); } /** - * Requests the headers and status of the given resource. - * - * @param name A filter for the name of the returned keys. - * @param after Instructs the server to return elements that appear after the element referred to by the specified - * token. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * Gets a single key-value snapshot. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
$SelectList<String>NoUsed to select what fields are present in the + * returned resource(s). In the form of "," separated string.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Sync-TokenStringNoUsed to guarantee real-time consistency between + * requests.
If-MatchStringNoUsed to perform an operation only if the targeted resource's + * etag matches the + * value provided.
If-None-MatchStringNoUsed to perform an operation only if the targeted + * resource's etag does not + * match the value provided.
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     name: String (Required)
+     *     status: String(provisioning/ready/archived/failed) (Optional)
+     *     filters (Required): [
+     *          (Required){
+     *             key: String (Required)
+     *             label: String (Optional)
+     *             tags (Optional): [
+     *                 String (Optional)
+     *             ]
+     *         }
+     *     ]
+     *     composition_type: String(key/key_label) (Optional)
+     *     created: OffsetDateTime (Optional)
+     *     expires: OffsetDateTime (Optional)
+     *     retention_period: Long (Optional)
+     *     size: Long (Optional)
+     *     items_count: Long (Optional)
+     *     tags (Optional): {
+     *         String: String (Required)
+     *     }
+     *     etag: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param name The name of the snapshot. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a single key-value snapshot along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void checkKeys(String name, String after, String acceptDatetime) { - checkKeysWithResponse(name, after, acceptDatetime, Context.NONE); + public Mono> getSnapshotWithResponseAsync(String name, RequestOptions requestOptions) { + final String accept = "application/vnd.microsoft.appconfig.snapshot+json, application/problem+json"; + return FluxUtil.withContext(context -> service.getSnapshot(this.getEndpoint(), + this.getServiceVersion().getVersion(), name, accept, requestOptions, context)); } /** - * Requests the headers and status of the given resource. - * - * @param name A filter for the name of the returned keys. - * @param after Instructs the server to return elements that appear after the element referred to by the specified - * token. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. + * Gets a single key-value snapshot. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
$SelectList<String>NoUsed to select what fields are present in the + * returned resource(s). In the form of "," separated string.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Sync-TokenStringNoUsed to guarantee real-time consistency between + * requests.
If-MatchStringNoUsed to perform an operation only if the targeted resource's + * etag matches the + * value provided.
If-None-MatchStringNoUsed to perform an operation only if the targeted + * resource's etag does not + * match the value provided.
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     name: String (Required)
+     *     status: String(provisioning/ready/archived/failed) (Optional)
+     *     filters (Required): [
+     *          (Required){
+     *             key: String (Required)
+     *             label: String (Optional)
+     *             tags (Optional): [
+     *                 String (Optional)
+     *             ]
+     *         }
+     *     ]
+     *     composition_type: String(key/key_label) (Optional)
+     *     created: OffsetDateTime (Optional)
+     *     expires: OffsetDateTime (Optional)
+     *     retention_period: Long (Optional)
+     *     size: Long (Optional)
+     *     items_count: Long (Optional)
+     *     tags (Optional): {
+     *         String: String (Required)
+     *     }
+     *     etag: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param name The name of the snapshot. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a single key-value snapshot along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response checkKeysNoCustomHeadersWithResponse(String name, String after, String acceptDatetime, - Context context) { - return service.checkKeysNoCustomHeadersSync(this.getEndpoint(), name, this.getSyncToken(), this.getApiVersion(), - after, acceptDatetime, context); + public Response getSnapshotWithResponse(String name, RequestOptions requestOptions) { + final String accept = "application/vnd.microsoft.appconfig.snapshot+json, application/problem+json"; + return service.getSnapshotSync(this.getEndpoint(), this.getServiceVersion().getVersion(), name, accept, + requestOptions, Context.NONE); } /** - * Gets a list of key-values. + * Gets the state of a long running operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     status: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required)
+     *     error (Optional): {
+     *         code: String (Required)
+     *         message: String (Required)
+     *         target: String (Optional)
+     *         details (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *         innererror (Optional): {
+     *             code: String (Optional)
+     *             innererror (Optional): (recursive schema, see innererror above)
+     *         }
+     *     }
+     * }
+     * }
+     * 
* - * @param key A filter used to match keys. Syntax reference: https://aka.ms/azconfig/docs/keyvaluefiltering. - * @param label A filter used to match labels. Syntax reference: https://aka.ms/azconfig/docs/keyvaluefiltering. - * @param after Instructs the server to return elements that appear after the element referred to by the specified - * token. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @param select Used to select what fields are present in the returned resource(s). - * @param snapshot A filter used get key-values for a snapshot. The value should be the name of the snapshot. Not - * valid when used with 'key' and 'label' filters. - * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided. - * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value - * provided. - * @param tags A filter used to query by tags. Syntax reference: https://aka.ms/azconfig/docs/keyvaluefiltering. - * @throws IllegalArgumentException thrown if parameters fail the validation. + * @param snapshot Snapshot identifier for the long running operation. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of key-values along with {@link PagedResponse} on successful completion of {@link Mono}. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the state of a long running operation along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getKeyValuesSinglePageAsync(String key, String label, String after, - String acceptDatetime, List select, String snapshot, String ifMatch, String ifNoneMatch, - List tags) { - final String accept = "application/vnd.microsoft.appconfig.kvset+json, application/problem+json"; - String selectConverted = (select == null) - ? null - : select.stream() - .map(paramItemValue -> Objects.toString(paramItemValue, "")) - .collect(Collectors.joining(",")); - List tagsConverted = (tags == null) - ? new ArrayList<>() - : tags.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); - return FluxUtil - .withContext(context -> service.getKeyValues(this.getEndpoint(), key, label, this.getSyncToken(), - this.getApiVersion(), after, acceptDatetime, selectConverted, snapshot, ifMatch, ifNoneMatch, - tagsConverted, accept, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getItems(), res.getValue().getNextLink(), res.getDeserializedHeaders())); + public Mono> getOperationDetailsWithResponseAsync(String snapshot, + RequestOptions requestOptions) { + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.getOperationDetails(this.getEndpoint(), + this.getServiceVersion().getVersion(), snapshot, accept, requestOptions, context)); } /** - * Gets a list of key-values. + * Gets the state of a long running operation. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     id: String (Required)
+     *     status: String(NotStarted/Running/Succeeded/Failed/Canceled) (Required)
+     *     error (Optional): {
+     *         code: String (Required)
+     *         message: String (Required)
+     *         target: String (Optional)
+     *         details (Optional): [
+     *             (recursive schema, see above)
+     *         ]
+     *         innererror (Optional): {
+     *             code: String (Optional)
+     *             innererror (Optional): (recursive schema, see innererror above)
+     *         }
+     *     }
+     * }
+     * }
+     * 
* - * @param key A filter used to match keys. Syntax reference: https://aka.ms/azconfig/docs/keyvaluefiltering. - * @param label A filter used to match labels. Syntax reference: https://aka.ms/azconfig/docs/keyvaluefiltering. - * @param after Instructs the server to return elements that appear after the element referred to by the specified - * token. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @param select Used to select what fields are present in the returned resource(s). - * @param snapshot A filter used get key-values for a snapshot. The value should be the name of the snapshot. Not - * valid when used with 'key' and 'label' filters. - * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided. - * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value - * provided. - * @param tags A filter used to query by tags. Syntax reference: https://aka.ms/azconfig/docs/keyvaluefiltering. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. + * @param snapshot Snapshot identifier for the long running operation. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of key-values along with {@link PagedResponse} on successful completion of {@link Mono}. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the state of a long running operation along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getKeyValuesSinglePageAsync(String key, String label, String after, - String acceptDatetime, List select, String snapshot, String ifMatch, String ifNoneMatch, - List tags, Context context) { - final String accept = "application/vnd.microsoft.appconfig.kvset+json, application/problem+json"; - String selectConverted = (select == null) - ? null - : select.stream() - .map(paramItemValue -> Objects.toString(paramItemValue, "")) - .collect(Collectors.joining(",")); - List tagsConverted = (tags == null) - ? new ArrayList<>() - : tags.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); - return service - .getKeyValues(this.getEndpoint(), key, label, this.getSyncToken(), this.getApiVersion(), after, - acceptDatetime, selectConverted, snapshot, ifMatch, ifNoneMatch, tagsConverted, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getItems(), res.getValue().getNextLink(), res.getDeserializedHeaders())); + public Response getOperationDetailsWithResponse(String snapshot, RequestOptions requestOptions) { + final String accept = "application/json"; + return service.getOperationDetailsSync(this.getEndpoint(), this.getServiceVersion().getVersion(), snapshot, + accept, requestOptions, Context.NONE); } /** - * Gets a list of key-values. - * - * @param key A filter used to match keys. Syntax reference: https://aka.ms/azconfig/docs/keyvaluefiltering. - * @param label A filter used to match labels. Syntax reference: https://aka.ms/azconfig/docs/keyvaluefiltering. - * @param after Instructs the server to return elements that appear after the element referred to by the specified - * token. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @param select Used to select what fields are present in the returned resource(s). - * @param snapshot A filter used get key-values for a snapshot. The value should be the name of the snapshot. Not - * valid when used with 'key' and 'label' filters. - * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided. - * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value - * provided. - * @param tags A filter used to query by tags. Syntax reference: https://aka.ms/azconfig/docs/keyvaluefiltering. - * @throws IllegalArgumentException thrown if parameters fail the validation. + * Creates a key-value snapshot. + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Sync-TokenStringNoUsed to guarantee real-time consistency between + * requests.
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     name: String (Required)
+     *     status: String(provisioning/ready/archived/failed) (Optional)
+     *     filters (Required): [
+     *          (Required){
+     *             key: String (Required)
+     *             label: String (Optional)
+     *             tags (Optional): [
+     *                 String (Optional)
+     *             ]
+     *         }
+     *     ]
+     *     composition_type: String(key/key_label) (Optional)
+     *     created: OffsetDateTime (Optional)
+     *     expires: OffsetDateTime (Optional)
+     *     retention_period: Long (Optional)
+     *     size: Long (Optional)
+     *     items_count: Long (Optional)
+     *     tags (Optional): {
+     *         String: String (Required)
+     *     }
+     *     etag: String (Optional)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     name: String (Required)
+     *     status: String(provisioning/ready/archived/failed) (Optional)
+     *     filters (Required): [
+     *          (Required){
+     *             key: String (Required)
+     *             label: String (Optional)
+     *             tags (Optional): [
+     *                 String (Optional)
+     *             ]
+     *         }
+     *     ]
+     *     composition_type: String(key/key_label) (Optional)
+     *     created: OffsetDateTime (Optional)
+     *     expires: OffsetDateTime (Optional)
+     *     retention_period: Long (Optional)
+     *     size: Long (Optional)
+     *     items_count: Long (Optional)
+     *     tags (Optional): {
+     *         String: String (Required)
+     *     }
+     *     etag: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param contentType Content-Type header. Allowed values: "application/vnd.microsoft.appconfig.snapshot+json", + * "application/json". + * @param name The name of the key-value snapshot to create. + * @param entity The key-value snapshot to create. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of key-values as paginated response with {@link PagedFlux}. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a snapshot is a named, immutable subset of an App Configuration store's key-values along with + * {@link Response} on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux getKeyValuesAsync(String key, String label, String after, String acceptDatetime, - List select, String snapshot, String ifMatch, String ifNoneMatch, List tags) { - return new PagedFlux<>(() -> getKeyValuesSinglePageAsync(key, label, after, acceptDatetime, select, snapshot, - ifMatch, ifNoneMatch, tags), - nextLink -> getKeyValuesNextSinglePageAsync(nextLink, acceptDatetime, ifMatch, ifNoneMatch)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createSnapshotWithResponseAsync(String contentType, String name, + BinaryData entity, RequestOptions requestOptions) { + final String accept = "application/vnd.microsoft.appconfig.snapshot+json, application/problem+json"; + return FluxUtil.withContext(context -> service.createSnapshot(this.getEndpoint(), + this.getServiceVersion().getVersion(), contentType, name, accept, entity, requestOptions, context)); } /** - * Gets a list of key-values. - * - * @param key A filter used to match keys. Syntax reference: https://aka.ms/azconfig/docs/keyvaluefiltering. - * @param label A filter used to match labels. Syntax reference: https://aka.ms/azconfig/docs/keyvaluefiltering. - * @param after Instructs the server to return elements that appear after the element referred to by the specified - * token. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @param select Used to select what fields are present in the returned resource(s). - * @param snapshot A filter used get key-values for a snapshot. The value should be the name of the snapshot. Not - * valid when used with 'key' and 'label' filters. - * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided. - * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value - * provided. - * @param tags A filter used to query by tags. Syntax reference: https://aka.ms/azconfig/docs/keyvaluefiltering. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. + * Creates a key-value snapshot. + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Sync-TokenStringNoUsed to guarantee real-time consistency between + * requests.
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     name: String (Required)
+     *     status: String(provisioning/ready/archived/failed) (Optional)
+     *     filters (Required): [
+     *          (Required){
+     *             key: String (Required)
+     *             label: String (Optional)
+     *             tags (Optional): [
+     *                 String (Optional)
+     *             ]
+     *         }
+     *     ]
+     *     composition_type: String(key/key_label) (Optional)
+     *     created: OffsetDateTime (Optional)
+     *     expires: OffsetDateTime (Optional)
+     *     retention_period: Long (Optional)
+     *     size: Long (Optional)
+     *     items_count: Long (Optional)
+     *     tags (Optional): {
+     *         String: String (Required)
+     *     }
+     *     etag: String (Optional)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     name: String (Required)
+     *     status: String(provisioning/ready/archived/failed) (Optional)
+     *     filters (Required): [
+     *          (Required){
+     *             key: String (Required)
+     *             label: String (Optional)
+     *             tags (Optional): [
+     *                 String (Optional)
+     *             ]
+     *         }
+     *     ]
+     *     composition_type: String(key/key_label) (Optional)
+     *     created: OffsetDateTime (Optional)
+     *     expires: OffsetDateTime (Optional)
+     *     retention_period: Long (Optional)
+     *     size: Long (Optional)
+     *     items_count: Long (Optional)
+     *     tags (Optional): {
+     *         String: String (Required)
+     *     }
+     *     etag: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param contentType Content-Type header. Allowed values: "application/vnd.microsoft.appconfig.snapshot+json", + * "application/json". + * @param name The name of the key-value snapshot to create. + * @param entity The key-value snapshot to create. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of key-values as paginated response with {@link PagedFlux}. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a snapshot is a named, immutable subset of an App Configuration store's key-values along with + * {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux getKeyValuesAsync(String key, String label, String after, String acceptDatetime, - List select, String snapshot, String ifMatch, String ifNoneMatch, List tags, - Context context) { - return new PagedFlux<>( - () -> getKeyValuesSinglePageAsync(key, label, after, acceptDatetime, select, snapshot, ifMatch, ifNoneMatch, - tags, context), - nextLink -> getKeyValuesNextSinglePageAsync(nextLink, acceptDatetime, ifMatch, ifNoneMatch, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createSnapshotWithResponse(String contentType, String name, BinaryData entity, + RequestOptions requestOptions) { + final String accept = "application/vnd.microsoft.appconfig.snapshot+json, application/problem+json"; + return service.createSnapshotSync(this.getEndpoint(), this.getServiceVersion().getVersion(), contentType, name, + accept, entity, requestOptions, Context.NONE); } /** - * Gets a list of key-values. - * - * @param key A filter used to match keys. Syntax reference: https://aka.ms/azconfig/docs/keyvaluefiltering. - * @param label A filter used to match labels. Syntax reference: https://aka.ms/azconfig/docs/keyvaluefiltering. - * @param after Instructs the server to return elements that appear after the element referred to by the specified - * token. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @param select Used to select what fields are present in the returned resource(s). - * @param snapshot A filter used get key-values for a snapshot. The value should be the name of the snapshot. Not - * valid when used with 'key' and 'label' filters. - * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided. - * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value - * provided. - * @param tags A filter used to query by tags. Syntax reference: https://aka.ms/azconfig/docs/keyvaluefiltering. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of key-values along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getKeyValuesNoCustomHeadersSinglePageAsync(String key, String label, - String after, String acceptDatetime, List select, String snapshot, String ifMatch, - String ifNoneMatch, List tags) { - final String accept = "application/vnd.microsoft.appconfig.kvset+json, application/problem+json"; - String selectConverted = (select == null) - ? null - : select.stream() - .map(paramItemValue -> Objects.toString(paramItemValue, "")) - .collect(Collectors.joining(",")); - List tagsConverted = (tags == null) - ? new ArrayList<>() - : tags.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); - return FluxUtil - .withContext(context -> service.getKeyValuesNoCustomHeaders(this.getEndpoint(), key, label, - this.getSyncToken(), this.getApiVersion(), after, acceptDatetime, selectConverted, snapshot, ifMatch, - ifNoneMatch, tagsConverted, accept, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getItems(), res.getValue().getNextLink(), null)); - } - - /** - * Gets a list of key-values. - * - * @param key A filter used to match keys. Syntax reference: https://aka.ms/azconfig/docs/keyvaluefiltering. - * @param label A filter used to match labels. Syntax reference: https://aka.ms/azconfig/docs/keyvaluefiltering. - * @param after Instructs the server to return elements that appear after the element referred to by the specified - * token. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @param select Used to select what fields are present in the returned resource(s). - * @param snapshot A filter used get key-values for a snapshot. The value should be the name of the snapshot. Not - * valid when used with 'key' and 'label' filters. - * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided. - * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value - * provided. - * @param tags A filter used to query by tags. Syntax reference: https://aka.ms/azconfig/docs/keyvaluefiltering. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of key-values along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getKeyValuesNoCustomHeadersSinglePageAsync(String key, String label, - String after, String acceptDatetime, List select, String snapshot, String ifMatch, - String ifNoneMatch, List tags, Context context) { - final String accept = "application/vnd.microsoft.appconfig.kvset+json, application/problem+json"; - String selectConverted = (select == null) - ? null - : select.stream() - .map(paramItemValue -> Objects.toString(paramItemValue, "")) - .collect(Collectors.joining(",")); - List tagsConverted = (tags == null) - ? new ArrayList<>() - : tags.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); - return service - .getKeyValuesNoCustomHeaders(this.getEndpoint(), key, label, this.getSyncToken(), this.getApiVersion(), - after, acceptDatetime, selectConverted, snapshot, ifMatch, ifNoneMatch, tagsConverted, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getItems(), res.getValue().getNextLink(), null)); - } - - /** - * Gets a list of key-values. - * - * @param key A filter used to match keys. Syntax reference: https://aka.ms/azconfig/docs/keyvaluefiltering. - * @param label A filter used to match labels. Syntax reference: https://aka.ms/azconfig/docs/keyvaluefiltering. - * @param after Instructs the server to return elements that appear after the element referred to by the specified - * token. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @param select Used to select what fields are present in the returned resource(s). - * @param snapshot A filter used get key-values for a snapshot. The value should be the name of the snapshot. Not - * valid when used with 'key' and 'label' filters. - * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided. - * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value - * provided. - * @param tags A filter used to query by tags. Syntax reference: https://aka.ms/azconfig/docs/keyvaluefiltering. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of key-values as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux getKeyValuesNoCustomHeadersAsync(String key, String label, String after, - String acceptDatetime, List select, String snapshot, String ifMatch, String ifNoneMatch, - List tags) { - return new PagedFlux<>( - () -> getKeyValuesNoCustomHeadersSinglePageAsync(key, label, after, acceptDatetime, select, snapshot, - ifMatch, ifNoneMatch, tags), - nextLink -> getKeyValuesNextSinglePageAsync(nextLink, acceptDatetime, ifMatch, ifNoneMatch)); - } - - /** - * Gets a list of key-values. - * - * @param key A filter used to match keys. Syntax reference: https://aka.ms/azconfig/docs/keyvaluefiltering. - * @param label A filter used to match labels. Syntax reference: https://aka.ms/azconfig/docs/keyvaluefiltering. - * @param after Instructs the server to return elements that appear after the element referred to by the specified - * token. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @param select Used to select what fields are present in the returned resource(s). - * @param snapshot A filter used get key-values for a snapshot. The value should be the name of the snapshot. Not - * valid when used with 'key' and 'label' filters. - * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided. - * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value - * provided. - * @param tags A filter used to query by tags. Syntax reference: https://aka.ms/azconfig/docs/keyvaluefiltering. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of key-values as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux getKeyValuesNoCustomHeadersAsync(String key, String label, String after, - String acceptDatetime, List select, String snapshot, String ifMatch, String ifNoneMatch, - List tags, Context context) { - return new PagedFlux<>( - () -> getKeyValuesNoCustomHeadersSinglePageAsync(key, label, after, acceptDatetime, select, snapshot, - ifMatch, ifNoneMatch, tags, context), - nextLink -> getKeyValuesNextSinglePageAsync(nextLink, acceptDatetime, ifMatch, ifNoneMatch, context)); - } - - /** - * Gets a list of key-values. - * - * @param key A filter used to match keys. Syntax reference: https://aka.ms/azconfig/docs/keyvaluefiltering. - * @param label A filter used to match labels. Syntax reference: https://aka.ms/azconfig/docs/keyvaluefiltering. - * @param after Instructs the server to return elements that appear after the element referred to by the specified - * token. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @param select Used to select what fields are present in the returned resource(s). - * @param snapshot A filter used get key-values for a snapshot. The value should be the name of the snapshot. Not - * valid when used with 'key' and 'label' filters. - * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided. - * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value - * provided. - * @param tags A filter used to query by tags. Syntax reference: https://aka.ms/azconfig/docs/keyvaluefiltering. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of key-values along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PagedResponse getKeyValuesSinglePage(String key, String label, String after, String acceptDatetime, - List select, String snapshot, String ifMatch, String ifNoneMatch, List tags) { - final String accept = "application/vnd.microsoft.appconfig.kvset+json, application/problem+json"; - String selectConverted = (select == null) - ? null - : select.stream() - .map(paramItemValue -> Objects.toString(paramItemValue, "")) - .collect(Collectors.joining(",")); - List tagsConverted = (tags == null) - ? new ArrayList<>() - : tags.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); - ResponseBase res - = service.getKeyValuesSync(this.getEndpoint(), key, label, this.getSyncToken(), this.getApiVersion(), after, - acceptDatetime, selectConverted, snapshot, ifMatch, ifNoneMatch, tagsConverted, accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getItems(), res.getValue().getNextLink(), res.getDeserializedHeaders()); - } - - /** - * Gets a list of key-values. - * - * @param key A filter used to match keys. Syntax reference: https://aka.ms/azconfig/docs/keyvaluefiltering. - * @param label A filter used to match labels. Syntax reference: https://aka.ms/azconfig/docs/keyvaluefiltering. - * @param after Instructs the server to return elements that appear after the element referred to by the specified - * token. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @param select Used to select what fields are present in the returned resource(s). - * @param snapshot A filter used get key-values for a snapshot. The value should be the name of the snapshot. Not - * valid when used with 'key' and 'label' filters. - * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided. - * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value - * provided. - * @param tags A filter used to query by tags. Syntax reference: https://aka.ms/azconfig/docs/keyvaluefiltering. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of key-values along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PagedResponse getKeyValuesSinglePage(String key, String label, String after, String acceptDatetime, - List select, String snapshot, String ifMatch, String ifNoneMatch, List tags, - Context context) { - final String accept = "application/vnd.microsoft.appconfig.kvset+json, application/problem+json"; - String selectConverted = (select == null) - ? null - : select.stream() - .map(paramItemValue -> Objects.toString(paramItemValue, "")) - .collect(Collectors.joining(",")); - List tagsConverted = (tags == null) - ? new ArrayList<>() - : tags.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); - ResponseBase res - = service.getKeyValuesSync(this.getEndpoint(), key, label, this.getSyncToken(), this.getApiVersion(), after, - acceptDatetime, selectConverted, snapshot, ifMatch, ifNoneMatch, tagsConverted, accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getItems(), res.getValue().getNextLink(), res.getDeserializedHeaders()); - } - - /** - * Gets a list of key-values. - * - * @param key A filter used to match keys. Syntax reference: https://aka.ms/azconfig/docs/keyvaluefiltering. - * @param label A filter used to match labels. Syntax reference: https://aka.ms/azconfig/docs/keyvaluefiltering. - * @param after Instructs the server to return elements that appear after the element referred to by the specified - * token. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @param select Used to select what fields are present in the returned resource(s). - * @param snapshot A filter used get key-values for a snapshot. The value should be the name of the snapshot. Not - * valid when used with 'key' and 'label' filters. - * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided. - * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value - * provided. - * @param tags A filter used to query by tags. Syntax reference: https://aka.ms/azconfig/docs/keyvaluefiltering. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of key-values as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable getKeyValues(String key, String label, String after, String acceptDatetime, - List select, String snapshot, String ifMatch, String ifNoneMatch, List tags) { - return new PagedIterable<>(() -> getKeyValuesSinglePage(key, label, after, acceptDatetime, select, snapshot, - ifMatch, ifNoneMatch, tags), - nextLink -> getKeyValuesNextSinglePage(nextLink, acceptDatetime, ifMatch, ifNoneMatch)); - } - - /** - * Gets a list of key-values. - * - * @param key A filter used to match keys. Syntax reference: https://aka.ms/azconfig/docs/keyvaluefiltering. - * @param label A filter used to match labels. Syntax reference: https://aka.ms/azconfig/docs/keyvaluefiltering. - * @param after Instructs the server to return elements that appear after the element referred to by the specified - * token. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @param select Used to select what fields are present in the returned resource(s). - * @param snapshot A filter used get key-values for a snapshot. The value should be the name of the snapshot. Not - * valid when used with 'key' and 'label' filters. - * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided. - * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value - * provided. - * @param tags A filter used to query by tags. Syntax reference: https://aka.ms/azconfig/docs/keyvaluefiltering. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of key-values as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable getKeyValues(String key, String label, String after, String acceptDatetime, - List select, String snapshot, String ifMatch, String ifNoneMatch, List tags, - Context context) { - return new PagedIterable<>( - () -> getKeyValuesSinglePage(key, label, after, acceptDatetime, select, snapshot, ifMatch, ifNoneMatch, - tags, context), - nextLink -> getKeyValuesNextSinglePage(nextLink, acceptDatetime, ifMatch, ifNoneMatch, context)); - } - - /** - * Gets a list of key-values. - * - * @param key A filter used to match keys. Syntax reference: https://aka.ms/azconfig/docs/keyvaluefiltering. - * @param label A filter used to match labels. Syntax reference: https://aka.ms/azconfig/docs/keyvaluefiltering. - * @param after Instructs the server to return elements that appear after the element referred to by the specified - * token. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @param select Used to select what fields are present in the returned resource(s). - * @param snapshot A filter used get key-values for a snapshot. The value should be the name of the snapshot. Not - * valid when used with 'key' and 'label' filters. - * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided. - * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value - * provided. - * @param tags A filter used to query by tags. Syntax reference: https://aka.ms/azconfig/docs/keyvaluefiltering. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of key-values along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PagedResponse getKeyValuesNoCustomHeadersSinglePage(String key, String label, String after, - String acceptDatetime, List select, String snapshot, String ifMatch, String ifNoneMatch, - List tags) { - final String accept = "application/vnd.microsoft.appconfig.kvset+json, application/problem+json"; - String selectConverted = (select == null) - ? null - : select.stream() - .map(paramItemValue -> Objects.toString(paramItemValue, "")) - .collect(Collectors.joining(",")); - List tagsConverted = (tags == null) - ? new ArrayList<>() - : tags.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); - Response res = service.getKeyValuesNoCustomHeadersSync(this.getEndpoint(), key, label, - this.getSyncToken(), this.getApiVersion(), after, acceptDatetime, selectConverted, snapshot, ifMatch, - ifNoneMatch, tagsConverted, accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getItems(), res.getValue().getNextLink(), null); - } - - /** - * Gets a list of key-values. - * - * @param key A filter used to match keys. Syntax reference: https://aka.ms/azconfig/docs/keyvaluefiltering. - * @param label A filter used to match labels. Syntax reference: https://aka.ms/azconfig/docs/keyvaluefiltering. - * @param after Instructs the server to return elements that appear after the element referred to by the specified - * token. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @param select Used to select what fields are present in the returned resource(s). - * @param snapshot A filter used get key-values for a snapshot. The value should be the name of the snapshot. Not - * valid when used with 'key' and 'label' filters. - * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided. - * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value - * provided. - * @param tags A filter used to query by tags. Syntax reference: https://aka.ms/azconfig/docs/keyvaluefiltering. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of key-values along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PagedResponse getKeyValuesNoCustomHeadersSinglePage(String key, String label, String after, - String acceptDatetime, List select, String snapshot, String ifMatch, String ifNoneMatch, - List tags, Context context) { - final String accept = "application/vnd.microsoft.appconfig.kvset+json, application/problem+json"; - String selectConverted = (select == null) - ? null - : select.stream() - .map(paramItemValue -> Objects.toString(paramItemValue, "")) - .collect(Collectors.joining(",")); - List tagsConverted = (tags == null) - ? new ArrayList<>() - : tags.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); - Response res = service.getKeyValuesNoCustomHeadersSync(this.getEndpoint(), key, label, - this.getSyncToken(), this.getApiVersion(), after, acceptDatetime, selectConverted, snapshot, ifMatch, - ifNoneMatch, tagsConverted, accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getItems(), res.getValue().getNextLink(), null); - } - - /** - * Gets a list of key-values. - * - * @param key A filter used to match keys. Syntax reference: https://aka.ms/azconfig/docs/keyvaluefiltering. - * @param label A filter used to match labels. Syntax reference: https://aka.ms/azconfig/docs/keyvaluefiltering. - * @param after Instructs the server to return elements that appear after the element referred to by the specified - * token. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @param select Used to select what fields are present in the returned resource(s). - * @param snapshot A filter used get key-values for a snapshot. The value should be the name of the snapshot. Not - * valid when used with 'key' and 'label' filters. - * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided. - * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value - * provided. - * @param tags A filter used to query by tags. Syntax reference: https://aka.ms/azconfig/docs/keyvaluefiltering. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of key-values as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable getKeyValuesNoCustomHeaders(String key, String label, String after, - String acceptDatetime, List select, String snapshot, String ifMatch, String ifNoneMatch, - List tags) { - return new PagedIterable<>( - () -> getKeyValuesNoCustomHeadersSinglePage(key, label, after, acceptDatetime, select, snapshot, ifMatch, - ifNoneMatch, tags), - nextLink -> getKeyValuesNextSinglePage(nextLink, acceptDatetime, ifMatch, ifNoneMatch)); - } - - /** - * Gets a list of key-values. - * - * @param key A filter used to match keys. Syntax reference: https://aka.ms/azconfig/docs/keyvaluefiltering. - * @param label A filter used to match labels. Syntax reference: https://aka.ms/azconfig/docs/keyvaluefiltering. - * @param after Instructs the server to return elements that appear after the element referred to by the specified - * token. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @param select Used to select what fields are present in the returned resource(s). - * @param snapshot A filter used get key-values for a snapshot. The value should be the name of the snapshot. Not - * valid when used with 'key' and 'label' filters. - * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided. - * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value - * provided. - * @param tags A filter used to query by tags. Syntax reference: https://aka.ms/azconfig/docs/keyvaluefiltering. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of key-values as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable getKeyValuesNoCustomHeaders(String key, String label, String after, - String acceptDatetime, List select, String snapshot, String ifMatch, String ifNoneMatch, - List tags, Context context) { - return new PagedIterable<>( - () -> getKeyValuesNoCustomHeadersSinglePage(key, label, after, acceptDatetime, select, snapshot, ifMatch, - ifNoneMatch, tags, context), - nextLink -> getKeyValuesNextSinglePage(nextLink, acceptDatetime, ifMatch, ifNoneMatch, context)); - } - - /** - * Requests the headers and status of the given resource. - * - * @param key A filter used to match keys. Syntax reference: https://aka.ms/azconfig/docs/keyvaluefiltering. - * @param label A filter used to match labels. Syntax reference: https://aka.ms/azconfig/docs/keyvaluefiltering. - * @param after Instructs the server to return elements that appear after the element referred to by the specified - * token. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @param select Used to select what fields are present in the returned resource(s). - * @param snapshot A filter used get key-values for a snapshot. Not valid when used with 'key' and 'label' filters. - * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided. - * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value - * provided. - * @param tags A filter used to query by tags. Syntax reference: https://aka.ms/azconfig/docs/keyvaluefiltering. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> checkKeyValuesWithResponseAsync(String key, String label, - String after, String acceptDatetime, List select, String snapshot, String ifMatch, - String ifNoneMatch, List tags) { - return FluxUtil.withContext(context -> checkKeyValuesWithResponseAsync(key, label, after, acceptDatetime, - select, snapshot, ifMatch, ifNoneMatch, tags, context)); - } - - /** - * Requests the headers and status of the given resource. - * - * @param key A filter used to match keys. Syntax reference: https://aka.ms/azconfig/docs/keyvaluefiltering. - * @param label A filter used to match labels. Syntax reference: https://aka.ms/azconfig/docs/keyvaluefiltering. - * @param after Instructs the server to return elements that appear after the element referred to by the specified - * token. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @param select Used to select what fields are present in the returned resource(s). - * @param snapshot A filter used get key-values for a snapshot. Not valid when used with 'key' and 'label' filters. - * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided. - * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value - * provided. - * @param tags A filter used to query by tags. Syntax reference: https://aka.ms/azconfig/docs/keyvaluefiltering. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> checkKeyValuesWithResponseAsync(String key, String label, - String after, String acceptDatetime, List select, String snapshot, String ifMatch, - String ifNoneMatch, List tags, Context context) { - String selectConverted = (select == null) - ? null - : select.stream() - .map(paramItemValue -> Objects.toString(paramItemValue, "")) - .collect(Collectors.joining(",")); - List tagsConverted = (tags == null) - ? new ArrayList<>() - : tags.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); - return service.checkKeyValues(this.getEndpoint(), key, label, this.getSyncToken(), this.getApiVersion(), after, - acceptDatetime, selectConverted, snapshot, ifMatch, ifNoneMatch, tagsConverted, context); - } - - /** - * Requests the headers and status of the given resource. - * - * @param key A filter used to match keys. Syntax reference: https://aka.ms/azconfig/docs/keyvaluefiltering. - * @param label A filter used to match labels. Syntax reference: https://aka.ms/azconfig/docs/keyvaluefiltering. - * @param after Instructs the server to return elements that appear after the element referred to by the specified - * token. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @param select Used to select what fields are present in the returned resource(s). - * @param snapshot A filter used get key-values for a snapshot. Not valid when used with 'key' and 'label' filters. - * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided. - * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value - * provided. - * @param tags A filter used to query by tags. Syntax reference: https://aka.ms/azconfig/docs/keyvaluefiltering. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono checkKeyValuesAsync(String key, String label, String after, String acceptDatetime, - List select, String snapshot, String ifMatch, String ifNoneMatch, List tags) { - return checkKeyValuesWithResponseAsync(key, label, after, acceptDatetime, select, snapshot, ifMatch, - ifNoneMatch, tags).flatMap(ignored -> Mono.empty()); - } - - /** - * Requests the headers and status of the given resource. - * - * @param key A filter used to match keys. Syntax reference: https://aka.ms/azconfig/docs/keyvaluefiltering. - * @param label A filter used to match labels. Syntax reference: https://aka.ms/azconfig/docs/keyvaluefiltering. - * @param after Instructs the server to return elements that appear after the element referred to by the specified - * token. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @param select Used to select what fields are present in the returned resource(s). - * @param snapshot A filter used get key-values for a snapshot. Not valid when used with 'key' and 'label' filters. - * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided. - * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value - * provided. - * @param tags A filter used to query by tags. Syntax reference: https://aka.ms/azconfig/docs/keyvaluefiltering. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono checkKeyValuesAsync(String key, String label, String after, String acceptDatetime, - List select, String snapshot, String ifMatch, String ifNoneMatch, List tags, - Context context) { - return checkKeyValuesWithResponseAsync(key, label, after, acceptDatetime, select, snapshot, ifMatch, - ifNoneMatch, tags, context).flatMap(ignored -> Mono.empty()); - } - - /** - * Requests the headers and status of the given resource. - * - * @param key A filter used to match keys. Syntax reference: https://aka.ms/azconfig/docs/keyvaluefiltering. - * @param label A filter used to match labels. Syntax reference: https://aka.ms/azconfig/docs/keyvaluefiltering. - * @param after Instructs the server to return elements that appear after the element referred to by the specified - * token. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @param select Used to select what fields are present in the returned resource(s). - * @param snapshot A filter used get key-values for a snapshot. Not valid when used with 'key' and 'label' filters. - * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided. - * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value - * provided. - * @param tags A filter used to query by tags. Syntax reference: https://aka.ms/azconfig/docs/keyvaluefiltering. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> checkKeyValuesNoCustomHeadersWithResponseAsync(String key, String label, String after, - String acceptDatetime, List select, String snapshot, String ifMatch, String ifNoneMatch, - List tags) { - return FluxUtil.withContext(context -> checkKeyValuesNoCustomHeadersWithResponseAsync(key, label, after, - acceptDatetime, select, snapshot, ifMatch, ifNoneMatch, tags, context)); - } - - /** - * Requests the headers and status of the given resource. - * - * @param key A filter used to match keys. Syntax reference: https://aka.ms/azconfig/docs/keyvaluefiltering. - * @param label A filter used to match labels. Syntax reference: https://aka.ms/azconfig/docs/keyvaluefiltering. - * @param after Instructs the server to return elements that appear after the element referred to by the specified - * token. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @param select Used to select what fields are present in the returned resource(s). - * @param snapshot A filter used get key-values for a snapshot. Not valid when used with 'key' and 'label' filters. - * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided. - * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value - * provided. - * @param tags A filter used to query by tags. Syntax reference: https://aka.ms/azconfig/docs/keyvaluefiltering. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> checkKeyValuesNoCustomHeadersWithResponseAsync(String key, String label, String after, - String acceptDatetime, List select, String snapshot, String ifMatch, String ifNoneMatch, - List tags, Context context) { - String selectConverted = (select == null) - ? null - : select.stream() - .map(paramItemValue -> Objects.toString(paramItemValue, "")) - .collect(Collectors.joining(",")); - List tagsConverted = (tags == null) - ? new ArrayList<>() - : tags.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); - return service.checkKeyValuesNoCustomHeaders(this.getEndpoint(), key, label, this.getSyncToken(), - this.getApiVersion(), after, acceptDatetime, selectConverted, snapshot, ifMatch, ifNoneMatch, tagsConverted, - context); - } - - /** - * Requests the headers and status of the given resource. - * - * @param key A filter used to match keys. Syntax reference: https://aka.ms/azconfig/docs/keyvaluefiltering. - * @param label A filter used to match labels. Syntax reference: https://aka.ms/azconfig/docs/keyvaluefiltering. - * @param after Instructs the server to return elements that appear after the element referred to by the specified - * token. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @param select Used to select what fields are present in the returned resource(s). - * @param snapshot A filter used get key-values for a snapshot. Not valid when used with 'key' and 'label' filters. - * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided. - * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value - * provided. - * @param tags A filter used to query by tags. Syntax reference: https://aka.ms/azconfig/docs/keyvaluefiltering. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase checkKeyValuesWithResponse(String key, String label, String after, - String acceptDatetime, List select, String snapshot, String ifMatch, String ifNoneMatch, - List tags, Context context) { - String selectConverted = (select == null) - ? null - : select.stream() - .map(paramItemValue -> Objects.toString(paramItemValue, "")) - .collect(Collectors.joining(",")); - List tagsConverted = (tags == null) - ? new ArrayList<>() - : tags.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); - return service.checkKeyValuesSync(this.getEndpoint(), key, label, this.getSyncToken(), this.getApiVersion(), - after, acceptDatetime, selectConverted, snapshot, ifMatch, ifNoneMatch, tagsConverted, context); - } - - /** - * Requests the headers and status of the given resource. - * - * @param key A filter used to match keys. Syntax reference: https://aka.ms/azconfig/docs/keyvaluefiltering. - * @param label A filter used to match labels. Syntax reference: https://aka.ms/azconfig/docs/keyvaluefiltering. - * @param after Instructs the server to return elements that appear after the element referred to by the specified - * token. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @param select Used to select what fields are present in the returned resource(s). - * @param snapshot A filter used get key-values for a snapshot. Not valid when used with 'key' and 'label' filters. - * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided. - * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value - * provided. - * @param tags A filter used to query by tags. Syntax reference: https://aka.ms/azconfig/docs/keyvaluefiltering. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void checkKeyValues(String key, String label, String after, String acceptDatetime, - List select, String snapshot, String ifMatch, String ifNoneMatch, List tags) { - checkKeyValuesWithResponse(key, label, after, acceptDatetime, select, snapshot, ifMatch, ifNoneMatch, tags, - Context.NONE); - } - - /** - * Requests the headers and status of the given resource. - * - * @param key A filter used to match keys. Syntax reference: https://aka.ms/azconfig/docs/keyvaluefiltering. - * @param label A filter used to match labels. Syntax reference: https://aka.ms/azconfig/docs/keyvaluefiltering. - * @param after Instructs the server to return elements that appear after the element referred to by the specified - * token. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @param select Used to select what fields are present in the returned resource(s). - * @param snapshot A filter used get key-values for a snapshot. Not valid when used with 'key' and 'label' filters. - * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided. - * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value - * provided. - * @param tags A filter used to query by tags. Syntax reference: https://aka.ms/azconfig/docs/keyvaluefiltering. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response checkKeyValuesNoCustomHeadersWithResponse(String key, String label, String after, - String acceptDatetime, List select, String snapshot, String ifMatch, String ifNoneMatch, - List tags, Context context) { - String selectConverted = (select == null) - ? null - : select.stream() - .map(paramItemValue -> Objects.toString(paramItemValue, "")) - .collect(Collectors.joining(",")); - List tagsConverted = (tags == null) - ? new ArrayList<>() - : tags.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); - return service.checkKeyValuesNoCustomHeadersSync(this.getEndpoint(), key, label, this.getSyncToken(), - this.getApiVersion(), after, acceptDatetime, selectConverted, snapshot, ifMatch, ifNoneMatch, tagsConverted, - context); - } - - /** - * Gets a single key-value. - * - * @param key The key of the key-value to retrieve. - * @param label The label of the key-value to retrieve. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided. - * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value - * provided. - * @param select Used to select what fields are present in the returned resource(s). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a single key-value along with {@link ResponseBase} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getKeyValueWithResponseAsync(String key, String label, - String acceptDatetime, String ifMatch, String ifNoneMatch, List select) { - return FluxUtil.withContext( - context -> getKeyValueWithResponseAsync(key, label, acceptDatetime, ifMatch, ifNoneMatch, select, context)); - } - - /** - * Gets a single key-value. - * - * @param key The key of the key-value to retrieve. - * @param label The label of the key-value to retrieve. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided. - * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value - * provided. - * @param select Used to select what fields are present in the returned resource(s). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a single key-value along with {@link ResponseBase} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getKeyValueWithResponseAsync(String key, String label, - String acceptDatetime, String ifMatch, String ifNoneMatch, List select, Context context) { - final String accept = "application/vnd.microsoft.appconfig.kv+json, application/problem+json"; - String selectConverted = (select == null) - ? null - : select.stream() - .map(paramItemValue -> Objects.toString(paramItemValue, "")) - .collect(Collectors.joining(",")); - return service.getKeyValue(this.getEndpoint(), key, label, this.getSyncToken(), this.getApiVersion(), - acceptDatetime, ifMatch, ifNoneMatch, selectConverted, accept, context); - } - - /** - * Gets a single key-value. - * - * @param key The key of the key-value to retrieve. - * @param label The label of the key-value to retrieve. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided. - * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value - * provided. - * @param select Used to select what fields are present in the returned resource(s). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a single key-value on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getKeyValueAsync(String key, String label, String acceptDatetime, String ifMatch, - String ifNoneMatch, List select) { - return getKeyValueWithResponseAsync(key, label, acceptDatetime, ifMatch, ifNoneMatch, select) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets a single key-value. - * - * @param key The key of the key-value to retrieve. - * @param label The label of the key-value to retrieve. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided. - * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value - * provided. - * @param select Used to select what fields are present in the returned resource(s). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a single key-value on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getKeyValueAsync(String key, String label, String acceptDatetime, String ifMatch, - String ifNoneMatch, List select, Context context) { - return getKeyValueWithResponseAsync(key, label, acceptDatetime, ifMatch, ifNoneMatch, select, context) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets a single key-value. - * - * @param key The key of the key-value to retrieve. - * @param label The label of the key-value to retrieve. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided. - * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value - * provided. - * @param select Used to select what fields are present in the returned resource(s). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a single key-value along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getKeyValueNoCustomHeadersWithResponseAsync(String key, String label, - String acceptDatetime, String ifMatch, String ifNoneMatch, List select) { - return FluxUtil.withContext(context -> getKeyValueNoCustomHeadersWithResponseAsync(key, label, acceptDatetime, - ifMatch, ifNoneMatch, select, context)); - } - - /** - * Gets a single key-value. - * - * @param key The key of the key-value to retrieve. - * @param label The label of the key-value to retrieve. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided. - * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value - * provided. - * @param select Used to select what fields are present in the returned resource(s). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a single key-value along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getKeyValueNoCustomHeadersWithResponseAsync(String key, String label, - String acceptDatetime, String ifMatch, String ifNoneMatch, List select, Context context) { - final String accept = "application/vnd.microsoft.appconfig.kv+json, application/problem+json"; - String selectConverted = (select == null) - ? null - : select.stream() - .map(paramItemValue -> Objects.toString(paramItemValue, "")) - .collect(Collectors.joining(",")); - return service.getKeyValueNoCustomHeaders(this.getEndpoint(), key, label, this.getSyncToken(), - this.getApiVersion(), acceptDatetime, ifMatch, ifNoneMatch, selectConverted, accept, context); - } - - /** - * Gets a single key-value. - * - * @param key The key of the key-value to retrieve. - * @param label The label of the key-value to retrieve. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided. - * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value - * provided. - * @param select Used to select what fields are present in the returned resource(s). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a single key-value along with {@link ResponseBase}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase getKeyValueWithResponse(String key, String label, - String acceptDatetime, String ifMatch, String ifNoneMatch, List select, Context context) { - final String accept = "application/vnd.microsoft.appconfig.kv+json, application/problem+json"; - String selectConverted = (select == null) - ? null - : select.stream() - .map(paramItemValue -> Objects.toString(paramItemValue, "")) - .collect(Collectors.joining(",")); - return service.getKeyValueSync(this.getEndpoint(), key, label, this.getSyncToken(), this.getApiVersion(), - acceptDatetime, ifMatch, ifNoneMatch, selectConverted, accept, context); - } - - /** - * Gets a single key-value. - * - * @param key The key of the key-value to retrieve. - * @param label The label of the key-value to retrieve. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided. - * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value - * provided. - * @param select Used to select what fields are present in the returned resource(s). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a single key-value. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public KeyValue getKeyValue(String key, String label, String acceptDatetime, String ifMatch, String ifNoneMatch, - List select) { - return getKeyValueWithResponse(key, label, acceptDatetime, ifMatch, ifNoneMatch, select, Context.NONE) - .getValue(); - } - - /** - * Gets a single key-value. - * - * @param key The key of the key-value to retrieve. - * @param label The label of the key-value to retrieve. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided. - * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value - * provided. - * @param select Used to select what fields are present in the returned resource(s). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a single key-value along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getKeyValueNoCustomHeadersWithResponse(String key, String label, String acceptDatetime, - String ifMatch, String ifNoneMatch, List select, Context context) { - final String accept = "application/vnd.microsoft.appconfig.kv+json, application/problem+json"; - String selectConverted = (select == null) - ? null - : select.stream() - .map(paramItemValue -> Objects.toString(paramItemValue, "")) - .collect(Collectors.joining(",")); - return service.getKeyValueNoCustomHeadersSync(this.getEndpoint(), key, label, this.getSyncToken(), - this.getApiVersion(), acceptDatetime, ifMatch, ifNoneMatch, selectConverted, accept, context); - } - - /** - * Creates a key-value. - * - * @param key The key of the key-value to create. - * @param label The label of the key-value to create. - * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided. - * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value - * provided. - * @param entity The key-value to create. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link ResponseBase} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> putKeyValueWithResponseAsync(String key, String label, - String ifMatch, String ifNoneMatch, KeyValue entity) { - return FluxUtil - .withContext(context -> putKeyValueWithResponseAsync(key, label, ifMatch, ifNoneMatch, entity, context)); - } - - /** - * Creates a key-value. - * - * @param key The key of the key-value to create. - * @param label The label of the key-value to create. - * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided. - * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value - * provided. - * @param entity The key-value to create. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link ResponseBase} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> putKeyValueWithResponseAsync(String key, String label, - String ifMatch, String ifNoneMatch, KeyValue entity, Context context) { - final String accept = "application/vnd.microsoft.appconfig.kv+json, application/problem+json"; - return service.putKeyValue(this.getEndpoint(), key, label, this.getSyncToken(), this.getApiVersion(), ifMatch, - ifNoneMatch, entity, accept, context); - } - - /** - * Creates a key-value. - * - * @param key The key of the key-value to create. - * @param label The label of the key-value to create. - * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided. - * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value - * provided. - * @param entity The key-value to create. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono putKeyValueAsync(String key, String label, String ifMatch, String ifNoneMatch, - KeyValue entity) { - return putKeyValueWithResponseAsync(key, label, ifMatch, ifNoneMatch, entity) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Creates a key-value. - * - * @param key The key of the key-value to create. - * @param label The label of the key-value to create. - * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided. - * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value - * provided. - * @param entity The key-value to create. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono putKeyValueAsync(String key, String label, String ifMatch, String ifNoneMatch, - KeyValue entity, Context context) { - return putKeyValueWithResponseAsync(key, label, ifMatch, ifNoneMatch, entity, context) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Creates a key-value. - * - * @param key The key of the key-value to create. - * @param label The label of the key-value to create. - * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided. - * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value - * provided. - * @param entity The key-value to create. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> putKeyValueNoCustomHeadersWithResponseAsync(String key, String label, - String ifMatch, String ifNoneMatch, KeyValue entity) { - return FluxUtil.withContext( - context -> putKeyValueNoCustomHeadersWithResponseAsync(key, label, ifMatch, ifNoneMatch, entity, context)); - } - - /** - * Creates a key-value. - * - * @param key The key of the key-value to create. - * @param label The label of the key-value to create. - * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided. - * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value - * provided. - * @param entity The key-value to create. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> putKeyValueNoCustomHeadersWithResponseAsync(String key, String label, - String ifMatch, String ifNoneMatch, KeyValue entity, Context context) { - final String accept = "application/vnd.microsoft.appconfig.kv+json, application/problem+json"; - return service.putKeyValueNoCustomHeaders(this.getEndpoint(), key, label, this.getSyncToken(), - this.getApiVersion(), ifMatch, ifNoneMatch, entity, accept, context); - } - - /** - * Creates a key-value. - * - * @param key The key of the key-value to create. - * @param label The label of the key-value to create. - * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided. - * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value - * provided. - * @param entity The key-value to create. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link ResponseBase}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase putKeyValueWithResponse(String key, String label, String ifMatch, - String ifNoneMatch, KeyValue entity, Context context) { - final String accept = "application/vnd.microsoft.appconfig.kv+json, application/problem+json"; - return service.putKeyValueSync(this.getEndpoint(), key, label, this.getSyncToken(), this.getApiVersion(), - ifMatch, ifNoneMatch, entity, accept, context); - } - - /** - * Creates a key-value. - * - * @param key The key of the key-value to create. - * @param label The label of the key-value to create. - * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided. - * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value - * provided. - * @param entity The key-value to create. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public KeyValue putKeyValue(String key, String label, String ifMatch, String ifNoneMatch, KeyValue entity) { - return putKeyValueWithResponse(key, label, ifMatch, ifNoneMatch, entity, Context.NONE).getValue(); - } - - /** - * Creates a key-value. - * - * @param key The key of the key-value to create. - * @param label The label of the key-value to create. - * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided. - * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value - * provided. - * @param entity The key-value to create. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response putKeyValueNoCustomHeadersWithResponse(String key, String label, String ifMatch, - String ifNoneMatch, KeyValue entity, Context context) { - final String accept = "application/vnd.microsoft.appconfig.kv+json, application/problem+json"; - return service.putKeyValueNoCustomHeadersSync(this.getEndpoint(), key, label, this.getSyncToken(), - this.getApiVersion(), ifMatch, ifNoneMatch, entity, accept, context); - } - - /** - * Deletes a key-value. - * - * @param key The key of the key-value to delete. - * @param label The label of the key-value to delete. - * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link ResponseBase} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteKeyValueWithResponseAsync(String key, String label, - String ifMatch) { - return FluxUtil.withContext(context -> deleteKeyValueWithResponseAsync(key, label, ifMatch, context)); - } - - /** - * Deletes a key-value. - * - * @param key The key of the key-value to delete. - * @param label The label of the key-value to delete. - * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link ResponseBase} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteKeyValueWithResponseAsync(String key, String label, - String ifMatch, Context context) { - final String accept = "application/vnd.microsoft.appconfig.kv+json, application/problem+json"; - return service.deleteKeyValue(this.getEndpoint(), key, label, this.getSyncToken(), this.getApiVersion(), - ifMatch, accept, context); - } - - /** - * Deletes a key-value. - * - * @param key The key of the key-value to delete. - * @param label The label of the key-value to delete. - * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteKeyValueAsync(String key, String label, String ifMatch) { - return deleteKeyValueWithResponseAsync(key, label, ifMatch).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Deletes a key-value. - * - * @param key The key of the key-value to delete. - * @param label The label of the key-value to delete. - * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteKeyValueAsync(String key, String label, String ifMatch, Context context) { - return deleteKeyValueWithResponseAsync(key, label, ifMatch, context) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Deletes a key-value. - * - * @param key The key of the key-value to delete. - * @param label The label of the key-value to delete. - * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteKeyValueNoCustomHeadersWithResponseAsync(String key, String label, - String ifMatch) { - return FluxUtil - .withContext(context -> deleteKeyValueNoCustomHeadersWithResponseAsync(key, label, ifMatch, context)); - } - - /** - * Deletes a key-value. - * - * @param key The key of the key-value to delete. - * @param label The label of the key-value to delete. - * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteKeyValueNoCustomHeadersWithResponseAsync(String key, String label, - String ifMatch, Context context) { - final String accept = "application/vnd.microsoft.appconfig.kv+json, application/problem+json"; - return service.deleteKeyValueNoCustomHeaders(this.getEndpoint(), key, label, this.getSyncToken(), - this.getApiVersion(), ifMatch, accept, context); - } - - /** - * Deletes a key-value. - * - * @param key The key of the key-value to delete. - * @param label The label of the key-value to delete. - * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link ResponseBase}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase deleteKeyValueWithResponse(String key, String label, - String ifMatch, Context context) { - final String accept = "application/vnd.microsoft.appconfig.kv+json, application/problem+json"; - return service.deleteKeyValueSync(this.getEndpoint(), key, label, this.getSyncToken(), this.getApiVersion(), - ifMatch, accept, context); - } - - /** - * Deletes a key-value. - * - * @param key The key of the key-value to delete. - * @param label The label of the key-value to delete. - * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public KeyValue deleteKeyValue(String key, String label, String ifMatch) { - return deleteKeyValueWithResponse(key, label, ifMatch, Context.NONE).getValue(); - } - - /** - * Deletes a key-value. - * - * @param key The key of the key-value to delete. - * @param label The label of the key-value to delete. - * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteKeyValueNoCustomHeadersWithResponse(String key, String label, String ifMatch, - Context context) { - final String accept = "application/vnd.microsoft.appconfig.kv+json, application/problem+json"; - return service.deleteKeyValueNoCustomHeadersSync(this.getEndpoint(), key, label, this.getSyncToken(), - this.getApiVersion(), ifMatch, accept, context); - } - - /** - * Requests the headers and status of the given resource. - * - * @param key The key of the key-value to retrieve. - * @param label The label of the key-value to retrieve. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided. - * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value - * provided. - * @param select Used to select what fields are present in the returned resource(s). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> checkKeyValueWithResponseAsync(String key, String label, - String acceptDatetime, String ifMatch, String ifNoneMatch, List select) { - return FluxUtil.withContext(context -> checkKeyValueWithResponseAsync(key, label, acceptDatetime, ifMatch, - ifNoneMatch, select, context)); - } - - /** - * Requests the headers and status of the given resource. - * - * @param key The key of the key-value to retrieve. - * @param label The label of the key-value to retrieve. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided. - * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value - * provided. - * @param select Used to select what fields are present in the returned resource(s). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> checkKeyValueWithResponseAsync(String key, String label, - String acceptDatetime, String ifMatch, String ifNoneMatch, List select, Context context) { - String selectConverted = (select == null) - ? null - : select.stream() - .map(paramItemValue -> Objects.toString(paramItemValue, "")) - .collect(Collectors.joining(",")); - return service.checkKeyValue(this.getEndpoint(), key, label, this.getSyncToken(), this.getApiVersion(), - acceptDatetime, ifMatch, ifNoneMatch, selectConverted, context); - } - - /** - * Requests the headers and status of the given resource. - * - * @param key The key of the key-value to retrieve. - * @param label The label of the key-value to retrieve. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided. - * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value - * provided. - * @param select Used to select what fields are present in the returned resource(s). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono checkKeyValueAsync(String key, String label, String acceptDatetime, String ifMatch, - String ifNoneMatch, List select) { - return checkKeyValueWithResponseAsync(key, label, acceptDatetime, ifMatch, ifNoneMatch, select) - .flatMap(ignored -> Mono.empty()); - } - - /** - * Requests the headers and status of the given resource. - * - * @param key The key of the key-value to retrieve. - * @param label The label of the key-value to retrieve. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided. - * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value - * provided. - * @param select Used to select what fields are present in the returned resource(s). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono checkKeyValueAsync(String key, String label, String acceptDatetime, String ifMatch, - String ifNoneMatch, List select, Context context) { - return checkKeyValueWithResponseAsync(key, label, acceptDatetime, ifMatch, ifNoneMatch, select, context) - .flatMap(ignored -> Mono.empty()); - } - - /** - * Requests the headers and status of the given resource. - * - * @param key The key of the key-value to retrieve. - * @param label The label of the key-value to retrieve. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided. - * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value - * provided. - * @param select Used to select what fields are present in the returned resource(s). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> checkKeyValueNoCustomHeadersWithResponseAsync(String key, String label, - String acceptDatetime, String ifMatch, String ifNoneMatch, List select) { - return FluxUtil.withContext(context -> checkKeyValueNoCustomHeadersWithResponseAsync(key, label, acceptDatetime, - ifMatch, ifNoneMatch, select, context)); - } - - /** - * Requests the headers and status of the given resource. - * - * @param key The key of the key-value to retrieve. - * @param label The label of the key-value to retrieve. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided. - * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value - * provided. - * @param select Used to select what fields are present in the returned resource(s). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> checkKeyValueNoCustomHeadersWithResponseAsync(String key, String label, - String acceptDatetime, String ifMatch, String ifNoneMatch, List select, Context context) { - String selectConverted = (select == null) - ? null - : select.stream() - .map(paramItemValue -> Objects.toString(paramItemValue, "")) - .collect(Collectors.joining(",")); - return service.checkKeyValueNoCustomHeaders(this.getEndpoint(), key, label, this.getSyncToken(), - this.getApiVersion(), acceptDatetime, ifMatch, ifNoneMatch, selectConverted, context); - } - - /** - * Requests the headers and status of the given resource. - * - * @param key The key of the key-value to retrieve. - * @param label The label of the key-value to retrieve. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided. - * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value - * provided. - * @param select Used to select what fields are present in the returned resource(s). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase checkKeyValueWithResponse(String key, String label, - String acceptDatetime, String ifMatch, String ifNoneMatch, List select, Context context) { - String selectConverted = (select == null) - ? null - : select.stream() - .map(paramItemValue -> Objects.toString(paramItemValue, "")) - .collect(Collectors.joining(",")); - return service.checkKeyValueSync(this.getEndpoint(), key, label, this.getSyncToken(), this.getApiVersion(), - acceptDatetime, ifMatch, ifNoneMatch, selectConverted, context); - } - - /** - * Requests the headers and status of the given resource. - * - * @param key The key of the key-value to retrieve. - * @param label The label of the key-value to retrieve. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided. - * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value - * provided. - * @param select Used to select what fields are present in the returned resource(s). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void checkKeyValue(String key, String label, String acceptDatetime, String ifMatch, String ifNoneMatch, - List select) { - checkKeyValueWithResponse(key, label, acceptDatetime, ifMatch, ifNoneMatch, select, Context.NONE); - } - - /** - * Requests the headers and status of the given resource. - * - * @param key The key of the key-value to retrieve. - * @param label The label of the key-value to retrieve. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided. - * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value - * provided. - * @param select Used to select what fields are present in the returned resource(s). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response checkKeyValueNoCustomHeadersWithResponse(String key, String label, String acceptDatetime, - String ifMatch, String ifNoneMatch, List select, Context context) { - String selectConverted = (select == null) - ? null - : select.stream() - .map(paramItemValue -> Objects.toString(paramItemValue, "")) - .collect(Collectors.joining(",")); - return service.checkKeyValueNoCustomHeadersSync(this.getEndpoint(), key, label, this.getSyncToken(), - this.getApiVersion(), acceptDatetime, ifMatch, ifNoneMatch, selectConverted, context); - } - - /** - * Gets a list of key-value snapshots. - * - * @param name A filter for the name of the returned snapshots. - * @param after Instructs the server to return elements that appear after the element referred to by the specified - * token. - * @param select Used to select what fields are present in the returned resource(s). - * @param status Used to filter returned snapshots by their status property. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of key-value snapshots along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getSnapshotsSinglePageAsync(String name, String after, - List select, List status) { - final String accept = "application/vnd.microsoft.appconfig.snapshotset+json, application/problem+json"; - String selectConverted = (select == null) - ? null - : select.stream() - .map(paramItemValue -> Objects.toString(paramItemValue, "")) - .collect(Collectors.joining(",")); - String statusConverted = (status == null) - ? null - : status.stream() - .map(paramItemValue -> Objects.toString(paramItemValue, "")) - .collect(Collectors.joining(",")); - return FluxUtil - .withContext(context -> service.getSnapshots(this.getEndpoint(), name, this.getSyncToken(), - this.getApiVersion(), after, selectConverted, statusConverted, accept, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getItems(), res.getValue().getNextLink(), res.getDeserializedHeaders())); - } - - /** - * Gets a list of key-value snapshots. - * - * @param name A filter for the name of the returned snapshots. - * @param after Instructs the server to return elements that appear after the element referred to by the specified - * token. - * @param select Used to select what fields are present in the returned resource(s). - * @param status Used to filter returned snapshots by their status property. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of key-value snapshots along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getSnapshotsSinglePageAsync(String name, String after, - List select, List status, Context context) { - final String accept = "application/vnd.microsoft.appconfig.snapshotset+json, application/problem+json"; - String selectConverted = (select == null) - ? null - : select.stream() - .map(paramItemValue -> Objects.toString(paramItemValue, "")) - .collect(Collectors.joining(",")); - String statusConverted = (status == null) - ? null - : status.stream() - .map(paramItemValue -> Objects.toString(paramItemValue, "")) - .collect(Collectors.joining(",")); - return service - .getSnapshots(this.getEndpoint(), name, this.getSyncToken(), this.getApiVersion(), after, selectConverted, - statusConverted, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getItems(), res.getValue().getNextLink(), res.getDeserializedHeaders())); - } - - /** - * Gets a list of key-value snapshots. - * - * @param name A filter for the name of the returned snapshots. - * @param after Instructs the server to return elements that appear after the element referred to by the specified - * token. - * @param select Used to select what fields are present in the returned resource(s). - * @param status Used to filter returned snapshots by their status property. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of key-value snapshots as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux getSnapshotsAsync(String name, String after, List select, - List status) { - return new PagedFlux<>(() -> getSnapshotsSinglePageAsync(name, after, select, status), - nextLink -> getSnapshotsNextSinglePageAsync(nextLink)); - } - - /** - * Gets a list of key-value snapshots. - * - * @param name A filter for the name of the returned snapshots. - * @param after Instructs the server to return elements that appear after the element referred to by the specified - * token. - * @param select Used to select what fields are present in the returned resource(s). - * @param status Used to filter returned snapshots by their status property. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of key-value snapshots as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux getSnapshotsAsync(String name, String after, List select, - List status, Context context) { - return new PagedFlux<>(() -> getSnapshotsSinglePageAsync(name, after, select, status, context), - nextLink -> getSnapshotsNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets a list of key-value snapshots. - * - * @param name A filter for the name of the returned snapshots. - * @param after Instructs the server to return elements that appear after the element referred to by the specified - * token. - * @param select Used to select what fields are present in the returned resource(s). - * @param status Used to filter returned snapshots by their status property. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of key-value snapshots along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getSnapshotsNoCustomHeadersSinglePageAsync(String name, - String after, List select, List status) { - final String accept = "application/vnd.microsoft.appconfig.snapshotset+json, application/problem+json"; - String selectConverted = (select == null) - ? null - : select.stream() - .map(paramItemValue -> Objects.toString(paramItemValue, "")) - .collect(Collectors.joining(",")); - String statusConverted = (status == null) - ? null - : status.stream() - .map(paramItemValue -> Objects.toString(paramItemValue, "")) - .collect(Collectors.joining(",")); - return FluxUtil - .withContext(context -> service.getSnapshotsNoCustomHeaders(this.getEndpoint(), name, this.getSyncToken(), - this.getApiVersion(), after, selectConverted, statusConverted, accept, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getItems(), res.getValue().getNextLink(), null)); - } - - /** - * Gets a list of key-value snapshots. - * - * @param name A filter for the name of the returned snapshots. - * @param after Instructs the server to return elements that appear after the element referred to by the specified - * token. - * @param select Used to select what fields are present in the returned resource(s). - * @param status Used to filter returned snapshots by their status property. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of key-value snapshots along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getSnapshotsNoCustomHeadersSinglePageAsync(String name, - String after, List select, List status, Context context) { - final String accept = "application/vnd.microsoft.appconfig.snapshotset+json, application/problem+json"; - String selectConverted = (select == null) - ? null - : select.stream() - .map(paramItemValue -> Objects.toString(paramItemValue, "")) - .collect(Collectors.joining(",")); - String statusConverted = (status == null) - ? null - : status.stream() - .map(paramItemValue -> Objects.toString(paramItemValue, "")) - .collect(Collectors.joining(",")); - return service - .getSnapshotsNoCustomHeaders(this.getEndpoint(), name, this.getSyncToken(), this.getApiVersion(), after, - selectConverted, statusConverted, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getItems(), res.getValue().getNextLink(), null)); - } - - /** - * Gets a list of key-value snapshots. - * - * @param name A filter for the name of the returned snapshots. - * @param after Instructs the server to return elements that appear after the element referred to by the specified - * token. - * @param select Used to select what fields are present in the returned resource(s). - * @param status Used to filter returned snapshots by their status property. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of key-value snapshots as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux getSnapshotsNoCustomHeadersAsync(String name, String after, - List select, List status) { - return new PagedFlux<>(() -> getSnapshotsNoCustomHeadersSinglePageAsync(name, after, select, status), - nextLink -> getSnapshotsNextSinglePageAsync(nextLink)); - } - - /** - * Gets a list of key-value snapshots. - * - * @param name A filter for the name of the returned snapshots. - * @param after Instructs the server to return elements that appear after the element referred to by the specified - * token. - * @param select Used to select what fields are present in the returned resource(s). - * @param status Used to filter returned snapshots by their status property. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of key-value snapshots as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux getSnapshotsNoCustomHeadersAsync(String name, String after, - List select, List status, Context context) { - return new PagedFlux<>(() -> getSnapshotsNoCustomHeadersSinglePageAsync(name, after, select, status, context), - nextLink -> getSnapshotsNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets a list of key-value snapshots. - * - * @param name A filter for the name of the returned snapshots. - * @param after Instructs the server to return elements that appear after the element referred to by the specified - * token. - * @param select Used to select what fields are present in the returned resource(s). - * @param status Used to filter returned snapshots by their status property. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of key-value snapshots along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PagedResponse getSnapshotsSinglePage(String name, String after, - List select, List status) { - final String accept = "application/vnd.microsoft.appconfig.snapshotset+json, application/problem+json"; - String selectConverted = (select == null) - ? null - : select.stream() - .map(paramItemValue -> Objects.toString(paramItemValue, "")) - .collect(Collectors.joining(",")); - String statusConverted = (status == null) - ? null - : status.stream() - .map(paramItemValue -> Objects.toString(paramItemValue, "")) - .collect(Collectors.joining(",")); - ResponseBase res = service.getSnapshotsSync(this.getEndpoint(), name, - this.getSyncToken(), this.getApiVersion(), after, selectConverted, statusConverted, accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getItems(), res.getValue().getNextLink(), res.getDeserializedHeaders()); - } - - /** - * Gets a list of key-value snapshots. - * - * @param name A filter for the name of the returned snapshots. - * @param after Instructs the server to return elements that appear after the element referred to by the specified - * token. - * @param select Used to select what fields are present in the returned resource(s). - * @param status Used to filter returned snapshots by their status property. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of key-value snapshots along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PagedResponse getSnapshotsSinglePage(String name, String after, - List select, List status, Context context) { - final String accept = "application/vnd.microsoft.appconfig.snapshotset+json, application/problem+json"; - String selectConverted = (select == null) - ? null - : select.stream() - .map(paramItemValue -> Objects.toString(paramItemValue, "")) - .collect(Collectors.joining(",")); - String statusConverted = (status == null) - ? null - : status.stream() - .map(paramItemValue -> Objects.toString(paramItemValue, "")) - .collect(Collectors.joining(",")); - ResponseBase res = service.getSnapshotsSync(this.getEndpoint(), name, - this.getSyncToken(), this.getApiVersion(), after, selectConverted, statusConverted, accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getItems(), res.getValue().getNextLink(), res.getDeserializedHeaders()); - } - - /** - * Gets a list of key-value snapshots. - * - * @param name A filter for the name of the returned snapshots. - * @param after Instructs the server to return elements that appear after the element referred to by the specified - * token. - * @param select Used to select what fields are present in the returned resource(s). - * @param status Used to filter returned snapshots by their status property. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of key-value snapshots as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable getSnapshots(String name, String after, List select, - List status) { - return new PagedIterable<>(() -> getSnapshotsSinglePage(name, after, select, status), - nextLink -> getSnapshotsNextSinglePage(nextLink)); - } - - /** - * Gets a list of key-value snapshots. - * - * @param name A filter for the name of the returned snapshots. - * @param after Instructs the server to return elements that appear after the element referred to by the specified - * token. - * @param select Used to select what fields are present in the returned resource(s). - * @param status Used to filter returned snapshots by their status property. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of key-value snapshots as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable getSnapshots(String name, String after, List select, - List status, Context context) { - return new PagedIterable<>(() -> getSnapshotsSinglePage(name, after, select, status, context), - nextLink -> getSnapshotsNextSinglePage(nextLink, context)); - } - - /** - * Gets a list of key-value snapshots. - * - * @param name A filter for the name of the returned snapshots. - * @param after Instructs the server to return elements that appear after the element referred to by the specified - * token. - * @param select Used to select what fields are present in the returned resource(s). - * @param status Used to filter returned snapshots by their status property. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of key-value snapshots along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PagedResponse getSnapshotsNoCustomHeadersSinglePage(String name, String after, - List select, List status) { - final String accept = "application/vnd.microsoft.appconfig.snapshotset+json, application/problem+json"; - String selectConverted = (select == null) - ? null - : select.stream() - .map(paramItemValue -> Objects.toString(paramItemValue, "")) - .collect(Collectors.joining(",")); - String statusConverted = (status == null) - ? null - : status.stream() - .map(paramItemValue -> Objects.toString(paramItemValue, "")) - .collect(Collectors.joining(",")); - Response res = service.getSnapshotsNoCustomHeadersSync(this.getEndpoint(), name, - this.getSyncToken(), this.getApiVersion(), after, selectConverted, statusConverted, accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getItems(), res.getValue().getNextLink(), null); - } - - /** - * Gets a list of key-value snapshots. - * - * @param name A filter for the name of the returned snapshots. - * @param after Instructs the server to return elements that appear after the element referred to by the specified - * token. - * @param select Used to select what fields are present in the returned resource(s). - * @param status Used to filter returned snapshots by their status property. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of key-value snapshots along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PagedResponse getSnapshotsNoCustomHeadersSinglePage(String name, String after, - List select, List status, Context context) { - final String accept = "application/vnd.microsoft.appconfig.snapshotset+json, application/problem+json"; - String selectConverted = (select == null) - ? null - : select.stream() - .map(paramItemValue -> Objects.toString(paramItemValue, "")) - .collect(Collectors.joining(",")); - String statusConverted = (status == null) - ? null - : status.stream() - .map(paramItemValue -> Objects.toString(paramItemValue, "")) - .collect(Collectors.joining(",")); - Response res = service.getSnapshotsNoCustomHeadersSync(this.getEndpoint(), name, - this.getSyncToken(), this.getApiVersion(), after, selectConverted, statusConverted, accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getItems(), res.getValue().getNextLink(), null); - } - - /** - * Gets a list of key-value snapshots. - * - * @param name A filter for the name of the returned snapshots. - * @param after Instructs the server to return elements that appear after the element referred to by the specified - * token. - * @param select Used to select what fields are present in the returned resource(s). - * @param status Used to filter returned snapshots by their status property. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of key-value snapshots as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable getSnapshotsNoCustomHeaders(String name, String after, - List select, List status) { - return new PagedIterable<>(() -> getSnapshotsNoCustomHeadersSinglePage(name, after, select, status), - nextLink -> getSnapshotsNextSinglePage(nextLink)); - } - - /** - * Gets a list of key-value snapshots. - * - * @param name A filter for the name of the returned snapshots. - * @param after Instructs the server to return elements that appear after the element referred to by the specified - * token. - * @param select Used to select what fields are present in the returned resource(s). - * @param status Used to filter returned snapshots by their status property. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of key-value snapshots as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable getSnapshotsNoCustomHeaders(String name, String after, - List select, List status, Context context) { - return new PagedIterable<>(() -> getSnapshotsNoCustomHeadersSinglePage(name, after, select, status, context), - nextLink -> getSnapshotsNextSinglePage(nextLink, context)); - } - - /** - * Requests the headers and status of the given resource. - * - * @param after Instructs the server to return elements that appear after the element referred to by the specified - * token. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> checkSnapshotsWithResponseAsync(String after) { - return FluxUtil.withContext(context -> checkSnapshotsWithResponseAsync(after, context)); - } - - /** - * Requests the headers and status of the given resource. - * - * @param after Instructs the server to return elements that appear after the element referred to by the specified - * token. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> checkSnapshotsWithResponseAsync(String after, - Context context) { - return service.checkSnapshots(this.getEndpoint(), this.getSyncToken(), this.getApiVersion(), after, context); - } - - /** - * Requests the headers and status of the given resource. - * - * @param after Instructs the server to return elements that appear after the element referred to by the specified - * token. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono checkSnapshotsAsync(String after) { - return checkSnapshotsWithResponseAsync(after).flatMap(ignored -> Mono.empty()); - } - - /** - * Requests the headers and status of the given resource. - * - * @param after Instructs the server to return elements that appear after the element referred to by the specified - * token. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono checkSnapshotsAsync(String after, Context context) { - return checkSnapshotsWithResponseAsync(after, context).flatMap(ignored -> Mono.empty()); - } - - /** - * Requests the headers and status of the given resource. - * - * @param after Instructs the server to return elements that appear after the element referred to by the specified - * token. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> checkSnapshotsNoCustomHeadersWithResponseAsync(String after) { - return FluxUtil.withContext(context -> checkSnapshotsNoCustomHeadersWithResponseAsync(after, context)); - } - - /** - * Requests the headers and status of the given resource. - * - * @param after Instructs the server to return elements that appear after the element referred to by the specified - * token. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> checkSnapshotsNoCustomHeadersWithResponseAsync(String after, Context context) { - return service.checkSnapshotsNoCustomHeaders(this.getEndpoint(), this.getSyncToken(), this.getApiVersion(), - after, context); - } - - /** - * Requests the headers and status of the given resource. - * - * @param after Instructs the server to return elements that appear after the element referred to by the specified - * token. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase checkSnapshotsWithResponse(String after, Context context) { - return service.checkSnapshotsSync(this.getEndpoint(), this.getSyncToken(), this.getApiVersion(), after, - context); - } - - /** - * Requests the headers and status of the given resource. - * - * @param after Instructs the server to return elements that appear after the element referred to by the specified - * token. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void checkSnapshots(String after) { - checkSnapshotsWithResponse(after, Context.NONE); - } - - /** - * Requests the headers and status of the given resource. - * - * @param after Instructs the server to return elements that appear after the element referred to by the specified - * token. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response checkSnapshotsNoCustomHeadersWithResponse(String after, Context context) { - return service.checkSnapshotsNoCustomHeadersSync(this.getEndpoint(), this.getSyncToken(), this.getApiVersion(), - after, context); - } - - /** - * Gets a single key-value snapshot. - * - * @param name The name of the key-value snapshot to retrieve. - * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided. - * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value - * provided. - * @param select Used to select what fields are present in the returned resource(s). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a single key-value snapshot along with {@link ResponseBase} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getSnapshotWithResponseAsync(String name, - String ifMatch, String ifNoneMatch, List select) { - return FluxUtil - .withContext(context -> getSnapshotWithResponseAsync(name, ifMatch, ifNoneMatch, select, context)); - } - - /** - * Gets a single key-value snapshot. - * - * @param name The name of the key-value snapshot to retrieve. - * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided. - * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value - * provided. - * @param select Used to select what fields are present in the returned resource(s). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a single key-value snapshot along with {@link ResponseBase} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getSnapshotWithResponseAsync(String name, - String ifMatch, String ifNoneMatch, List select, Context context) { - final String accept = "application/vnd.microsoft.appconfig.snapshot+json, application/problem+json"; - String selectConverted = (select == null) - ? null - : select.stream() - .map(paramItemValue -> Objects.toString(paramItemValue, "")) - .collect(Collectors.joining(",")); - return service.getSnapshot(this.getEndpoint(), this.getSyncToken(), this.getApiVersion(), name, ifMatch, - ifNoneMatch, selectConverted, accept, context); - } - - /** - * Gets a single key-value snapshot. - * - * @param name The name of the key-value snapshot to retrieve. - * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided. - * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value - * provided. - * @param select Used to select what fields are present in the returned resource(s). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a single key-value snapshot on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getSnapshotAsync(String name, String ifMatch, String ifNoneMatch, - List select) { - return getSnapshotWithResponseAsync(name, ifMatch, ifNoneMatch, select) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets a single key-value snapshot. - * - * @param name The name of the key-value snapshot to retrieve. - * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided. - * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value - * provided. - * @param select Used to select what fields are present in the returned resource(s). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a single key-value snapshot on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getSnapshotAsync(String name, String ifMatch, String ifNoneMatch, - List select, Context context) { - return getSnapshotWithResponseAsync(name, ifMatch, ifNoneMatch, select, context) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets a single key-value snapshot. - * - * @param name The name of the key-value snapshot to retrieve. - * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided. - * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value - * provided. - * @param select Used to select what fields are present in the returned resource(s). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a single key-value snapshot along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getSnapshotNoCustomHeadersWithResponseAsync(String name, - String ifMatch, String ifNoneMatch, List select) { - return FluxUtil.withContext( - context -> getSnapshotNoCustomHeadersWithResponseAsync(name, ifMatch, ifNoneMatch, select, context)); - } - - /** - * Gets a single key-value snapshot. - * - * @param name The name of the key-value snapshot to retrieve. - * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided. - * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value - * provided. - * @param select Used to select what fields are present in the returned resource(s). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a single key-value snapshot along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getSnapshotNoCustomHeadersWithResponseAsync(String name, - String ifMatch, String ifNoneMatch, List select, Context context) { - final String accept = "application/vnd.microsoft.appconfig.snapshot+json, application/problem+json"; - String selectConverted = (select == null) - ? null - : select.stream() - .map(paramItemValue -> Objects.toString(paramItemValue, "")) - .collect(Collectors.joining(",")); - return service.getSnapshotNoCustomHeaders(this.getEndpoint(), this.getSyncToken(), this.getApiVersion(), name, - ifMatch, ifNoneMatch, selectConverted, accept, context); - } - - /** - * Gets a single key-value snapshot. - * - * @param name The name of the key-value snapshot to retrieve. - * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided. - * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value - * provided. - * @param select Used to select what fields are present in the returned resource(s). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a single key-value snapshot along with {@link ResponseBase}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase getSnapshotWithResponse(String name, String ifMatch, - String ifNoneMatch, List select, Context context) { - final String accept = "application/vnd.microsoft.appconfig.snapshot+json, application/problem+json"; - String selectConverted = (select == null) - ? null - : select.stream() - .map(paramItemValue -> Objects.toString(paramItemValue, "")) - .collect(Collectors.joining(",")); - return service.getSnapshotSync(this.getEndpoint(), this.getSyncToken(), this.getApiVersion(), name, ifMatch, - ifNoneMatch, selectConverted, accept, context); - } - - /** - * Gets a single key-value snapshot. - * - * @param name The name of the key-value snapshot to retrieve. - * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided. - * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value - * provided. - * @param select Used to select what fields are present in the returned resource(s). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a single key-value snapshot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ConfigurationSnapshot getSnapshot(String name, String ifMatch, String ifNoneMatch, - List select) { - return getSnapshotWithResponse(name, ifMatch, ifNoneMatch, select, Context.NONE).getValue(); - } - - /** - * Gets a single key-value snapshot. - * - * @param name The name of the key-value snapshot to retrieve. - * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided. - * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value - * provided. - * @param select Used to select what fields are present in the returned resource(s). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a single key-value snapshot along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getSnapshotNoCustomHeadersWithResponse(String name, String ifMatch, - String ifNoneMatch, List select, Context context) { - final String accept = "application/vnd.microsoft.appconfig.snapshot+json, application/problem+json"; - String selectConverted = (select == null) - ? null - : select.stream() - .map(paramItemValue -> Objects.toString(paramItemValue, "")) - .collect(Collectors.joining(",")); - return service.getSnapshotNoCustomHeadersSync(this.getEndpoint(), this.getSyncToken(), this.getApiVersion(), - name, ifMatch, ifNoneMatch, selectConverted, accept, context); - } - - /** - * Creates a key-value snapshot. - * - * @param name The name of the key-value snapshot to create. - * @param entity The key-value snapshot to create. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link ResponseBase} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createSnapshotWithResponseAsync(String name, - ConfigurationSnapshot entity) { - return FluxUtil.withContext(context -> createSnapshotWithResponseAsync(name, entity, context)); - } - - /** - * Creates a key-value snapshot. - * - * @param name The name of the key-value snapshot to create. - * @param entity The key-value snapshot to create. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link ResponseBase} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createSnapshotWithResponseAsync(String name, - ConfigurationSnapshot entity, Context context) { - final String accept = "application/vnd.microsoft.appconfig.snapshot+json, application/problem+json"; - return service.createSnapshot(this.getEndpoint(), name, this.getSyncToken(), this.getApiVersion(), entity, - accept, context); - } - - /** - * Creates a key-value snapshot. - * - * @param name The name of the key-value snapshot to create. - * @param entity The key-value snapshot to create. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createSnapshotAsync(String name, ConfigurationSnapshot entity) { - return createSnapshotWithResponseAsync(name, entity).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Creates a key-value snapshot. - * - * @param name The name of the key-value snapshot to create. - * @param entity The key-value snapshot to create. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createSnapshotAsync(String name, ConfigurationSnapshot entity, Context context) { - return createSnapshotWithResponseAsync(name, entity, context).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Creates a key-value snapshot. - * - * @param name The name of the key-value snapshot to create. - * @param entity The key-value snapshot to create. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createSnapshotNoCustomHeadersWithResponseAsync(String name, - ConfigurationSnapshot entity) { - return FluxUtil.withContext(context -> createSnapshotNoCustomHeadersWithResponseAsync(name, entity, context)); - } - - /** - * Creates a key-value snapshot. - * - * @param name The name of the key-value snapshot to create. - * @param entity The key-value snapshot to create. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> createSnapshotNoCustomHeadersWithResponseAsync(String name, - ConfigurationSnapshot entity, Context context) { - final String accept = "application/vnd.microsoft.appconfig.snapshot+json, application/problem+json"; - return service.createSnapshotNoCustomHeaders(this.getEndpoint(), name, this.getSyncToken(), - this.getApiVersion(), entity, accept, context); - } - - /** - * Creates a key-value snapshot. - * - * @param name The name of the key-value snapshot to create. - * @param entity The key-value snapshot to create. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link ResponseBase}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase createSnapshotWithResponse(String name, - ConfigurationSnapshot entity, Context context) { - final String accept = "application/vnd.microsoft.appconfig.snapshot+json, application/problem+json"; - return service.createSnapshotSync(this.getEndpoint(), name, this.getSyncToken(), this.getApiVersion(), entity, - accept, context); - } - - /** - * Creates a key-value snapshot. - * - * @param name The name of the key-value snapshot to create. - * @param entity The key-value snapshot to create. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ConfigurationSnapshot createSnapshot(String name, ConfigurationSnapshot entity) { - return createSnapshotWithResponse(name, entity, Context.NONE).getValue(); - } - - /** - * Creates a key-value snapshot. - * - * @param name The name of the key-value snapshot to create. - * @param entity The key-value snapshot to create. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createSnapshotNoCustomHeadersWithResponse(String name, - ConfigurationSnapshot entity, Context context) { - final String accept = "application/vnd.microsoft.appconfig.snapshot+json, application/problem+json"; - return service.createSnapshotNoCustomHeadersSync(this.getEndpoint(), name, this.getSyncToken(), - this.getApiVersion(), entity, accept, context); - } - - /** - * Updates the state of a key-value snapshot. - * - * @param name The name of the key-value snapshot to update. - * @param entity The parameters used to update the snapshot. - * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided. - * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value - * provided. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link ResponseBase} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateSnapshotWithResponseAsync(String name, - SnapshotUpdateParameters entity, String ifMatch, String ifNoneMatch) { - return FluxUtil - .withContext(context -> updateSnapshotWithResponseAsync(name, entity, ifMatch, ifNoneMatch, context)); - } - - /** - * Updates the state of a key-value snapshot. - * - * @param name The name of the key-value snapshot to update. - * @param entity The parameters used to update the snapshot. - * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided. - * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value - * provided. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link ResponseBase} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateSnapshotWithResponseAsync(String name, - SnapshotUpdateParameters entity, String ifMatch, String ifNoneMatch, Context context) { - final String accept = "application/vnd.microsoft.appconfig.snapshot+json, application/problem+json"; - return service.updateSnapshot(this.getEndpoint(), name, this.getSyncToken(), this.getApiVersion(), ifMatch, - ifNoneMatch, entity, accept, context); - } - - /** - * Updates the state of a key-value snapshot. - * - * @param name The name of the key-value snapshot to update. - * @param entity The parameters used to update the snapshot. - * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided. - * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value - * provided. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateSnapshotAsync(String name, SnapshotUpdateParameters entity, String ifMatch, - String ifNoneMatch) { - return updateSnapshotWithResponseAsync(name, entity, ifMatch, ifNoneMatch) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Updates the state of a key-value snapshot. - * - * @param name The name of the key-value snapshot to update. - * @param entity The parameters used to update the snapshot. - * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided. - * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value - * provided. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateSnapshotAsync(String name, SnapshotUpdateParameters entity, String ifMatch, - String ifNoneMatch, Context context) { - return updateSnapshotWithResponseAsync(name, entity, ifMatch, ifNoneMatch, context) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Updates the state of a key-value snapshot. - * - * @param name The name of the key-value snapshot to update. - * @param entity The parameters used to update the snapshot. - * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided. - * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value - * provided. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateSnapshotNoCustomHeadersWithResponseAsync(String name, - SnapshotUpdateParameters entity, String ifMatch, String ifNoneMatch) { - return FluxUtil.withContext( - context -> updateSnapshotNoCustomHeadersWithResponseAsync(name, entity, ifMatch, ifNoneMatch, context)); - } - - /** - * Updates the state of a key-value snapshot. - * - * @param name The name of the key-value snapshot to update. - * @param entity The parameters used to update the snapshot. - * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided. - * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value - * provided. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> updateSnapshotNoCustomHeadersWithResponseAsync(String name, - SnapshotUpdateParameters entity, String ifMatch, String ifNoneMatch, Context context) { - final String accept = "application/vnd.microsoft.appconfig.snapshot+json, application/problem+json"; - return service.updateSnapshotNoCustomHeaders(this.getEndpoint(), name, this.getSyncToken(), - this.getApiVersion(), ifMatch, ifNoneMatch, entity, accept, context); - } - - /** - * Updates the state of a key-value snapshot. - * - * @param name The name of the key-value snapshot to update. - * @param entity The parameters used to update the snapshot. - * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided. - * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value - * provided. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link ResponseBase}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase updateSnapshotWithResponse(String name, - SnapshotUpdateParameters entity, String ifMatch, String ifNoneMatch, Context context) { - final String accept = "application/vnd.microsoft.appconfig.snapshot+json, application/problem+json"; - return service.updateSnapshotSync(this.getEndpoint(), name, this.getSyncToken(), this.getApiVersion(), ifMatch, - ifNoneMatch, entity, accept, context); - } - - /** - * Updates the state of a key-value snapshot. - * - * @param name The name of the key-value snapshot to update. - * @param entity The parameters used to update the snapshot. - * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided. - * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value - * provided. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ConfigurationSnapshot updateSnapshot(String name, SnapshotUpdateParameters entity, String ifMatch, - String ifNoneMatch) { - return updateSnapshotWithResponse(name, entity, ifMatch, ifNoneMatch, Context.NONE).getValue(); - } - - /** - * Updates the state of a key-value snapshot. - * - * @param name The name of the key-value snapshot to update. - * @param entity The parameters used to update the snapshot. - * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided. - * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value - * provided. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateSnapshotNoCustomHeadersWithResponse(String name, - SnapshotUpdateParameters entity, String ifMatch, String ifNoneMatch, Context context) { - final String accept = "application/vnd.microsoft.appconfig.snapshot+json, application/problem+json"; - return service.updateSnapshotNoCustomHeadersSync(this.getEndpoint(), name, this.getSyncToken(), - this.getApiVersion(), ifMatch, ifNoneMatch, entity, accept, context); - } - - /** - * Requests the headers and status of the given resource. - * - * @param name The name of the key-value snapshot to check. - * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided. - * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value - * provided. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> checkSnapshotWithResponseAsync(String name, String ifMatch, - String ifNoneMatch) { - return FluxUtil.withContext(context -> checkSnapshotWithResponseAsync(name, ifMatch, ifNoneMatch, context)); - } - - /** - * Requests the headers and status of the given resource. - * - * @param name The name of the key-value snapshot to check. - * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided. - * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value - * provided. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> checkSnapshotWithResponseAsync(String name, String ifMatch, - String ifNoneMatch, Context context) { - return service.checkSnapshot(this.getEndpoint(), name, this.getSyncToken(), this.getApiVersion(), ifMatch, - ifNoneMatch, context); - } - - /** - * Requests the headers and status of the given resource. - * - * @param name The name of the key-value snapshot to check. - * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided. - * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value - * provided. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono checkSnapshotAsync(String name, String ifMatch, String ifNoneMatch) { - return checkSnapshotWithResponseAsync(name, ifMatch, ifNoneMatch).flatMap(ignored -> Mono.empty()); - } - - /** - * Requests the headers and status of the given resource. - * - * @param name The name of the key-value snapshot to check. - * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided. - * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value - * provided. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono checkSnapshotAsync(String name, String ifMatch, String ifNoneMatch, Context context) { - return checkSnapshotWithResponseAsync(name, ifMatch, ifNoneMatch, context).flatMap(ignored -> Mono.empty()); - } - - /** - * Requests the headers and status of the given resource. - * - * @param name The name of the key-value snapshot to check. - * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided. - * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value - * provided. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> checkSnapshotNoCustomHeadersWithResponseAsync(String name, String ifMatch, - String ifNoneMatch) { - return FluxUtil - .withContext(context -> checkSnapshotNoCustomHeadersWithResponseAsync(name, ifMatch, ifNoneMatch, context)); - } - - /** - * Requests the headers and status of the given resource. - * - * @param name The name of the key-value snapshot to check. - * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided. - * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value - * provided. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> checkSnapshotNoCustomHeadersWithResponseAsync(String name, String ifMatch, - String ifNoneMatch, Context context) { - return service.checkSnapshotNoCustomHeaders(this.getEndpoint(), name, this.getSyncToken(), this.getApiVersion(), - ifMatch, ifNoneMatch, context); - } - - /** - * Requests the headers and status of the given resource. - * - * @param name The name of the key-value snapshot to check. - * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided. - * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value - * provided. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase checkSnapshotWithResponse(String name, String ifMatch, - String ifNoneMatch, Context context) { - return service.checkSnapshotSync(this.getEndpoint(), name, this.getSyncToken(), this.getApiVersion(), ifMatch, - ifNoneMatch, context); - } - - /** - * Requests the headers and status of the given resource. - * - * @param name The name of the key-value snapshot to check. - * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided. - * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value - * provided. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void checkSnapshot(String name, String ifMatch, String ifNoneMatch) { - checkSnapshotWithResponse(name, ifMatch, ifNoneMatch, Context.NONE); - } - - /** - * Requests the headers and status of the given resource. - * - * @param name The name of the key-value snapshot to check. - * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided. - * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value - * provided. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response checkSnapshotNoCustomHeadersWithResponse(String name, String ifMatch, String ifNoneMatch, - Context context) { - return service.checkSnapshotNoCustomHeadersSync(this.getEndpoint(), name, this.getSyncToken(), - this.getApiVersion(), ifMatch, ifNoneMatch, context); - } - - /** - * Gets a list of labels. - * - * @param name A filter for the name of the returned labels. - * @param after Instructs the server to return elements that appear after the element referred to by the specified - * token. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @param select Used to select what fields are present in the returned resource(s). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of labels along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getLabelsSinglePageAsync(String name, String after, String acceptDatetime, - List select) { - final String accept = "application/vnd.microsoft.appconfig.labelset+json, application/problem+json"; - String selectConverted = (select == null) - ? null - : select.stream() - .map(paramItemValue -> Objects.toString(paramItemValue, "")) - .collect(Collectors.joining(",")); - return FluxUtil - .withContext(context -> service.getLabels(this.getEndpoint(), name, this.getSyncToken(), - this.getApiVersion(), after, acceptDatetime, selectConverted, accept, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getItems(), res.getValue().getNextLink(), res.getDeserializedHeaders())); - } - - /** - * Gets a list of labels. - * - * @param name A filter for the name of the returned labels. - * @param after Instructs the server to return elements that appear after the element referred to by the specified - * token. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @param select Used to select what fields are present in the returned resource(s). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of labels along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getLabelsSinglePageAsync(String name, String after, String acceptDatetime, - List select, Context context) { - final String accept = "application/vnd.microsoft.appconfig.labelset+json, application/problem+json"; - String selectConverted = (select == null) - ? null - : select.stream() - .map(paramItemValue -> Objects.toString(paramItemValue, "")) - .collect(Collectors.joining(",")); - return service - .getLabels(this.getEndpoint(), name, this.getSyncToken(), this.getApiVersion(), after, acceptDatetime, - selectConverted, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getItems(), res.getValue().getNextLink(), res.getDeserializedHeaders())); - } - - /** - * Gets a list of labels. - * - * @param name A filter for the name of the returned labels. - * @param after Instructs the server to return elements that appear after the element referred to by the specified - * token. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @param select Used to select what fields are present in the returned resource(s). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of labels as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux getLabelsAsync(String name, String after, String acceptDatetime, - List select) { - return new PagedFlux<>(() -> getLabelsSinglePageAsync(name, after, acceptDatetime, select), - nextLink -> getLabelsNextSinglePageAsync(nextLink, acceptDatetime)); - } - - /** - * Gets a list of labels. - * - * @param name A filter for the name of the returned labels. - * @param after Instructs the server to return elements that appear after the element referred to by the specified - * token. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @param select Used to select what fields are present in the returned resource(s). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of labels as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux getLabelsAsync(String name, String after, String acceptDatetime, - List select, Context context) { - return new PagedFlux<>(() -> getLabelsSinglePageAsync(name, after, acceptDatetime, select, context), - nextLink -> getLabelsNextSinglePageAsync(nextLink, acceptDatetime, context)); - } - - /** - * Gets a list of labels. - * - * @param name A filter for the name of the returned labels. - * @param after Instructs the server to return elements that appear after the element referred to by the specified - * token. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @param select Used to select what fields are present in the returned resource(s). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of labels along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getLabelsNoCustomHeadersSinglePageAsync(String name, String after, - String acceptDatetime, List select) { - final String accept = "application/vnd.microsoft.appconfig.labelset+json, application/problem+json"; - String selectConverted = (select == null) - ? null - : select.stream() - .map(paramItemValue -> Objects.toString(paramItemValue, "")) - .collect(Collectors.joining(",")); - return FluxUtil - .withContext(context -> service.getLabelsNoCustomHeaders(this.getEndpoint(), name, this.getSyncToken(), - this.getApiVersion(), after, acceptDatetime, selectConverted, accept, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getItems(), res.getValue().getNextLink(), null)); - } - - /** - * Gets a list of labels. - * - * @param name A filter for the name of the returned labels. - * @param after Instructs the server to return elements that appear after the element referred to by the specified - * token. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @param select Used to select what fields are present in the returned resource(s). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of labels along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getLabelsNoCustomHeadersSinglePageAsync(String name, String after, - String acceptDatetime, List select, Context context) { - final String accept = "application/vnd.microsoft.appconfig.labelset+json, application/problem+json"; - String selectConverted = (select == null) - ? null - : select.stream() - .map(paramItemValue -> Objects.toString(paramItemValue, "")) - .collect(Collectors.joining(",")); - return service - .getLabelsNoCustomHeaders(this.getEndpoint(), name, this.getSyncToken(), this.getApiVersion(), after, - acceptDatetime, selectConverted, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getItems(), res.getValue().getNextLink(), null)); - } - - /** - * Gets a list of labels. - * - * @param name A filter for the name of the returned labels. - * @param after Instructs the server to return elements that appear after the element referred to by the specified - * token. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @param select Used to select what fields are present in the returned resource(s). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of labels as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux getLabelsNoCustomHeadersAsync(String name, String after, String acceptDatetime, - List select) { - return new PagedFlux<>(() -> getLabelsNoCustomHeadersSinglePageAsync(name, after, acceptDatetime, select), - nextLink -> getLabelsNextSinglePageAsync(nextLink, acceptDatetime)); - } - - /** - * Gets a list of labels. - * - * @param name A filter for the name of the returned labels. - * @param after Instructs the server to return elements that appear after the element referred to by the specified - * token. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @param select Used to select what fields are present in the returned resource(s). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of labels as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux getLabelsNoCustomHeadersAsync(String name, String after, String acceptDatetime, - List select, Context context) { - return new PagedFlux<>( - () -> getLabelsNoCustomHeadersSinglePageAsync(name, after, acceptDatetime, select, context), - nextLink -> getLabelsNextSinglePageAsync(nextLink, acceptDatetime, context)); - } - - /** - * Gets a list of labels. - * - * @param name A filter for the name of the returned labels. - * @param after Instructs the server to return elements that appear after the element referred to by the specified - * token. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @param select Used to select what fields are present in the returned resource(s). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of labels along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PagedResponse getLabelsSinglePage(String name, String after, String acceptDatetime, - List select) { - final String accept = "application/vnd.microsoft.appconfig.labelset+json, application/problem+json"; - String selectConverted = (select == null) - ? null - : select.stream() - .map(paramItemValue -> Objects.toString(paramItemValue, "")) - .collect(Collectors.joining(",")); - ResponseBase res = service.getLabelsSync(this.getEndpoint(), name, - this.getSyncToken(), this.getApiVersion(), after, acceptDatetime, selectConverted, accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getItems(), res.getValue().getNextLink(), res.getDeserializedHeaders()); - } - - /** - * Gets a list of labels. - * - * @param name A filter for the name of the returned labels. - * @param after Instructs the server to return elements that appear after the element referred to by the specified - * token. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @param select Used to select what fields are present in the returned resource(s). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of labels along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PagedResponse getLabelsSinglePage(String name, String after, String acceptDatetime, - List select, Context context) { - final String accept = "application/vnd.microsoft.appconfig.labelset+json, application/problem+json"; - String selectConverted = (select == null) - ? null - : select.stream() - .map(paramItemValue -> Objects.toString(paramItemValue, "")) - .collect(Collectors.joining(",")); - ResponseBase res = service.getLabelsSync(this.getEndpoint(), name, - this.getSyncToken(), this.getApiVersion(), after, acceptDatetime, selectConverted, accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getItems(), res.getValue().getNextLink(), res.getDeserializedHeaders()); - } - - /** - * Gets a list of labels. - * - * @param name A filter for the name of the returned labels. - * @param after Instructs the server to return elements that appear after the element referred to by the specified - * token. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @param select Used to select what fields are present in the returned resource(s). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of labels as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable getLabels(String name, String after, String acceptDatetime, - List select) { - return new PagedIterable<>(() -> getLabelsSinglePage(name, after, acceptDatetime, select), - nextLink -> getLabelsNextSinglePage(nextLink, acceptDatetime)); - } - - /** - * Gets a list of labels. - * - * @param name A filter for the name of the returned labels. - * @param after Instructs the server to return elements that appear after the element referred to by the specified - * token. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @param select Used to select what fields are present in the returned resource(s). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of labels as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable getLabels(String name, String after, String acceptDatetime, - List select, Context context) { - return new PagedIterable<>(() -> getLabelsSinglePage(name, after, acceptDatetime, select, context), - nextLink -> getLabelsNextSinglePage(nextLink, acceptDatetime, context)); - } - - /** - * Gets a list of labels. - * - * @param name A filter for the name of the returned labels. - * @param after Instructs the server to return elements that appear after the element referred to by the specified - * token. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @param select Used to select what fields are present in the returned resource(s). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of labels along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PagedResponse getLabelsNoCustomHeadersSinglePage(String name, String after, - String acceptDatetime, List select) { - final String accept = "application/vnd.microsoft.appconfig.labelset+json, application/problem+json"; - String selectConverted = (select == null) - ? null - : select.stream() - .map(paramItemValue -> Objects.toString(paramItemValue, "")) - .collect(Collectors.joining(",")); - Response res = service.getLabelsNoCustomHeadersSync(this.getEndpoint(), name, - this.getSyncToken(), this.getApiVersion(), after, acceptDatetime, selectConverted, accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getItems(), res.getValue().getNextLink(), null); - } - - /** - * Gets a list of labels. - * - * @param name A filter for the name of the returned labels. - * @param after Instructs the server to return elements that appear after the element referred to by the specified - * token. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @param select Used to select what fields are present in the returned resource(s). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of labels along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PagedResponse getLabelsNoCustomHeadersSinglePage(String name, String after, - String acceptDatetime, List select, Context context) { - final String accept = "application/vnd.microsoft.appconfig.labelset+json, application/problem+json"; - String selectConverted = (select == null) - ? null - : select.stream() - .map(paramItemValue -> Objects.toString(paramItemValue, "")) - .collect(Collectors.joining(",")); - Response res = service.getLabelsNoCustomHeadersSync(this.getEndpoint(), name, - this.getSyncToken(), this.getApiVersion(), after, acceptDatetime, selectConverted, accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getItems(), res.getValue().getNextLink(), null); - } - - /** - * Gets a list of labels. - * - * @param name A filter for the name of the returned labels. - * @param after Instructs the server to return elements that appear after the element referred to by the specified - * token. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @param select Used to select what fields are present in the returned resource(s). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of labels as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable getLabelsNoCustomHeaders(String name, String after, String acceptDatetime, - List select) { - return new PagedIterable<>(() -> getLabelsNoCustomHeadersSinglePage(name, after, acceptDatetime, select), - nextLink -> getLabelsNextSinglePage(nextLink, acceptDatetime)); - } - - /** - * Gets a list of labels. - * - * @param name A filter for the name of the returned labels. - * @param after Instructs the server to return elements that appear after the element referred to by the specified - * token. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @param select Used to select what fields are present in the returned resource(s). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of labels as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable getLabelsNoCustomHeaders(String name, String after, String acceptDatetime, - List select, Context context) { - return new PagedIterable<>( - () -> getLabelsNoCustomHeadersSinglePage(name, after, acceptDatetime, select, context), - nextLink -> getLabelsNextSinglePage(nextLink, acceptDatetime, context)); - } - - /** - * Requests the headers and status of the given resource. - * - * @param name A filter for the name of the returned labels. - * @param after Instructs the server to return elements that appear after the element referred to by the specified - * token. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @param select Used to select what fields are present in the returned resource(s). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> checkLabelsWithResponseAsync(String name, String after, - String acceptDatetime, List select) { - return FluxUtil - .withContext(context -> checkLabelsWithResponseAsync(name, after, acceptDatetime, select, context)); - } - - /** - * Requests the headers and status of the given resource. - * - * @param name A filter for the name of the returned labels. - * @param after Instructs the server to return elements that appear after the element referred to by the specified - * token. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @param select Used to select what fields are present in the returned resource(s). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> checkLabelsWithResponseAsync(String name, String after, - String acceptDatetime, List select, Context context) { - String selectConverted = (select == null) - ? null - : select.stream() - .map(paramItemValue -> Objects.toString(paramItemValue, "")) - .collect(Collectors.joining(",")); - return service.checkLabels(this.getEndpoint(), name, this.getSyncToken(), this.getApiVersion(), after, - acceptDatetime, selectConverted, context); - } - - /** - * Requests the headers and status of the given resource. - * - * @param name A filter for the name of the returned labels. - * @param after Instructs the server to return elements that appear after the element referred to by the specified - * token. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @param select Used to select what fields are present in the returned resource(s). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono checkLabelsAsync(String name, String after, String acceptDatetime, - List select) { - return checkLabelsWithResponseAsync(name, after, acceptDatetime, select).flatMap(ignored -> Mono.empty()); - } - - /** - * Requests the headers and status of the given resource. - * - * @param name A filter for the name of the returned labels. - * @param after Instructs the server to return elements that appear after the element referred to by the specified - * token. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @param select Used to select what fields are present in the returned resource(s). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono checkLabelsAsync(String name, String after, String acceptDatetime, - List select, Context context) { - return checkLabelsWithResponseAsync(name, after, acceptDatetime, select, context) - .flatMap(ignored -> Mono.empty()); - } - - /** - * Requests the headers and status of the given resource. - * - * @param name A filter for the name of the returned labels. - * @param after Instructs the server to return elements that appear after the element referred to by the specified - * token. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @param select Used to select what fields are present in the returned resource(s). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> checkLabelsNoCustomHeadersWithResponseAsync(String name, String after, - String acceptDatetime, List select) { - return FluxUtil.withContext( - context -> checkLabelsNoCustomHeadersWithResponseAsync(name, after, acceptDatetime, select, context)); - } - - /** - * Requests the headers and status of the given resource. - * - * @param name A filter for the name of the returned labels. - * @param after Instructs the server to return elements that appear after the element referred to by the specified - * token. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @param select Used to select what fields are present in the returned resource(s). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> checkLabelsNoCustomHeadersWithResponseAsync(String name, String after, - String acceptDatetime, List select, Context context) { - String selectConverted = (select == null) - ? null - : select.stream() - .map(paramItemValue -> Objects.toString(paramItemValue, "")) - .collect(Collectors.joining(",")); - return service.checkLabelsNoCustomHeaders(this.getEndpoint(), name, this.getSyncToken(), this.getApiVersion(), - after, acceptDatetime, selectConverted, context); - } - - /** - * Requests the headers and status of the given resource. - * - * @param name A filter for the name of the returned labels. - * @param after Instructs the server to return elements that appear after the element referred to by the specified - * token. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @param select Used to select what fields are present in the returned resource(s). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase checkLabelsWithResponse(String name, String after, - String acceptDatetime, List select, Context context) { - String selectConverted = (select == null) - ? null - : select.stream() - .map(paramItemValue -> Objects.toString(paramItemValue, "")) - .collect(Collectors.joining(",")); - return service.checkLabelsSync(this.getEndpoint(), name, this.getSyncToken(), this.getApiVersion(), after, - acceptDatetime, selectConverted, context); - } - - /** - * Requests the headers and status of the given resource. - * - * @param name A filter for the name of the returned labels. - * @param after Instructs the server to return elements that appear after the element referred to by the specified - * token. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @param select Used to select what fields are present in the returned resource(s). - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void checkLabels(String name, String after, String acceptDatetime, List select) { - checkLabelsWithResponse(name, after, acceptDatetime, select, Context.NONE); - } - - /** - * Requests the headers and status of the given resource. - * - * @param name A filter for the name of the returned labels. - * @param after Instructs the server to return elements that appear after the element referred to by the specified - * token. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @param select Used to select what fields are present in the returned resource(s). - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response checkLabelsNoCustomHeadersWithResponse(String name, String after, String acceptDatetime, - List select, Context context) { - String selectConverted = (select == null) - ? null - : select.stream() - .map(paramItemValue -> Objects.toString(paramItemValue, "")) - .collect(Collectors.joining(",")); - return service.checkLabelsNoCustomHeadersSync(this.getEndpoint(), name, this.getSyncToken(), - this.getApiVersion(), after, acceptDatetime, selectConverted, context); - } - - /** - * Locks a key-value. - * - * @param key The key of the key-value to lock. - * @param label The label, if any, of the key-value to lock. - * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided. - * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value - * provided. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link ResponseBase} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> putLockWithResponseAsync(String key, String label, - String ifMatch, String ifNoneMatch) { - return FluxUtil.withContext(context -> putLockWithResponseAsync(key, label, ifMatch, ifNoneMatch, context)); - } - - /** - * Locks a key-value. - * - * @param key The key of the key-value to lock. - * @param label The label, if any, of the key-value to lock. - * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided. - * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value - * provided. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link ResponseBase} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> putLockWithResponseAsync(String key, String label, - String ifMatch, String ifNoneMatch, Context context) { - final String accept = "application/vnd.microsoft.appconfig.kv+json, application/problem+json"; - return service.putLock(this.getEndpoint(), key, label, this.getSyncToken(), this.getApiVersion(), ifMatch, - ifNoneMatch, accept, context); - } - - /** - * Locks a key-value. - * - * @param key The key of the key-value to lock. - * @param label The label, if any, of the key-value to lock. - * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided. - * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value - * provided. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono putLockAsync(String key, String label, String ifMatch, String ifNoneMatch) { - return putLockWithResponseAsync(key, label, ifMatch, ifNoneMatch) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Locks a key-value. - * - * @param key The key of the key-value to lock. - * @param label The label, if any, of the key-value to lock. - * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided. - * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value - * provided. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono putLockAsync(String key, String label, String ifMatch, String ifNoneMatch, Context context) { - return putLockWithResponseAsync(key, label, ifMatch, ifNoneMatch, context) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Locks a key-value. - * - * @param key The key of the key-value to lock. - * @param label The label, if any, of the key-value to lock. - * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided. - * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value - * provided. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> putLockNoCustomHeadersWithResponseAsync(String key, String label, String ifMatch, - String ifNoneMatch) { - return FluxUtil - .withContext(context -> putLockNoCustomHeadersWithResponseAsync(key, label, ifMatch, ifNoneMatch, context)); - } - - /** - * Locks a key-value. - * - * @param key The key of the key-value to lock. - * @param label The label, if any, of the key-value to lock. - * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided. - * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value - * provided. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> putLockNoCustomHeadersWithResponseAsync(String key, String label, String ifMatch, - String ifNoneMatch, Context context) { - final String accept = "application/vnd.microsoft.appconfig.kv+json, application/problem+json"; - return service.putLockNoCustomHeaders(this.getEndpoint(), key, label, this.getSyncToken(), this.getApiVersion(), - ifMatch, ifNoneMatch, accept, context); - } - - /** - * Locks a key-value. - * - * @param key The key of the key-value to lock. - * @param label The label, if any, of the key-value to lock. - * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided. - * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value - * provided. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link ResponseBase}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase putLockWithResponse(String key, String label, String ifMatch, - String ifNoneMatch, Context context) { - final String accept = "application/vnd.microsoft.appconfig.kv+json, application/problem+json"; - return service.putLockSync(this.getEndpoint(), key, label, this.getSyncToken(), this.getApiVersion(), ifMatch, - ifNoneMatch, accept, context); - } - - /** - * Locks a key-value. - * - * @param key The key of the key-value to lock. - * @param label The label, if any, of the key-value to lock. - * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided. - * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value - * provided. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public KeyValue putLock(String key, String label, String ifMatch, String ifNoneMatch) { - return putLockWithResponse(key, label, ifMatch, ifNoneMatch, Context.NONE).getValue(); - } - - /** - * Locks a key-value. - * - * @param key The key of the key-value to lock. - * @param label The label, if any, of the key-value to lock. - * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided. - * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value - * provided. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response putLockNoCustomHeadersWithResponse(String key, String label, String ifMatch, - String ifNoneMatch, Context context) { - final String accept = "application/vnd.microsoft.appconfig.kv+json, application/problem+json"; - return service.putLockNoCustomHeadersSync(this.getEndpoint(), key, label, this.getSyncToken(), - this.getApiVersion(), ifMatch, ifNoneMatch, accept, context); - } - - /** - * Unlocks a key-value. - * - * @param key The key of the key-value to unlock. - * @param label The label, if any, of the key-value to unlock. - * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided. - * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value - * provided. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link ResponseBase} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteLockWithResponseAsync(String key, String label, - String ifMatch, String ifNoneMatch) { - return FluxUtil.withContext(context -> deleteLockWithResponseAsync(key, label, ifMatch, ifNoneMatch, context)); - } - - /** - * Unlocks a key-value. - * - * @param key The key of the key-value to unlock. - * @param label The label, if any, of the key-value to unlock. - * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided. - * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value - * provided. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link ResponseBase} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteLockWithResponseAsync(String key, String label, - String ifMatch, String ifNoneMatch, Context context) { - final String accept = "application/vnd.microsoft.appconfig.kv+json, application/problem+json"; - return service.deleteLock(this.getEndpoint(), key, label, this.getSyncToken(), this.getApiVersion(), ifMatch, - ifNoneMatch, accept, context); - } - - /** - * Unlocks a key-value. - * - * @param key The key of the key-value to unlock. - * @param label The label, if any, of the key-value to unlock. - * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided. - * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value - * provided. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteLockAsync(String key, String label, String ifMatch, String ifNoneMatch) { - return deleteLockWithResponseAsync(key, label, ifMatch, ifNoneMatch) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Unlocks a key-value. - * - * @param key The key of the key-value to unlock. - * @param label The label, if any, of the key-value to unlock. - * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided. - * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value - * provided. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteLockAsync(String key, String label, String ifMatch, String ifNoneMatch, - Context context) { - return deleteLockWithResponseAsync(key, label, ifMatch, ifNoneMatch, context) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Unlocks a key-value. - * - * @param key The key of the key-value to unlock. - * @param label The label, if any, of the key-value to unlock. - * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided. - * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value - * provided. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteLockNoCustomHeadersWithResponseAsync(String key, String label, String ifMatch, - String ifNoneMatch) { - return FluxUtil.withContext( - context -> deleteLockNoCustomHeadersWithResponseAsync(key, label, ifMatch, ifNoneMatch, context)); - } - - /** - * Unlocks a key-value. - * - * @param key The key of the key-value to unlock. - * @param label The label, if any, of the key-value to unlock. - * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided. - * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value - * provided. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> deleteLockNoCustomHeadersWithResponseAsync(String key, String label, String ifMatch, - String ifNoneMatch, Context context) { - final String accept = "application/vnd.microsoft.appconfig.kv+json, application/problem+json"; - return service.deleteLockNoCustomHeaders(this.getEndpoint(), key, label, this.getSyncToken(), - this.getApiVersion(), ifMatch, ifNoneMatch, accept, context); - } - - /** - * Unlocks a key-value. - * - * @param key The key of the key-value to unlock. - * @param label The label, if any, of the key-value to unlock. - * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided. - * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value - * provided. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link ResponseBase}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase deleteLockWithResponse(String key, String label, String ifMatch, - String ifNoneMatch, Context context) { - final String accept = "application/vnd.microsoft.appconfig.kv+json, application/problem+json"; - return service.deleteLockSync(this.getEndpoint(), key, label, this.getSyncToken(), this.getApiVersion(), - ifMatch, ifNoneMatch, accept, context); - } - - /** - * Unlocks a key-value. - * - * @param key The key of the key-value to unlock. - * @param label The label, if any, of the key-value to unlock. - * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided. - * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value - * provided. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public KeyValue deleteLock(String key, String label, String ifMatch, String ifNoneMatch) { - return deleteLockWithResponse(key, label, ifMatch, ifNoneMatch, Context.NONE).getValue(); - } - - /** - * Unlocks a key-value. - * - * @param key The key of the key-value to unlock. - * @param label The label, if any, of the key-value to unlock. - * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided. - * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value - * provided. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response body along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteLockNoCustomHeadersWithResponse(String key, String label, String ifMatch, - String ifNoneMatch, Context context) { - final String accept = "application/vnd.microsoft.appconfig.kv+json, application/problem+json"; - return service.deleteLockNoCustomHeadersSync(this.getEndpoint(), key, label, this.getSyncToken(), - this.getApiVersion(), ifMatch, ifNoneMatch, accept, context); - } - - /** - * Gets a list of key-value revisions. - * - * @param key A filter used to match keys. Syntax reference: https://aka.ms/azconfig/docs/restapirevisions. - * @param label A filter used to match labels. Syntax reference: https://aka.ms/azconfig/docs/restapirevisions. - * @param after Instructs the server to return elements that appear after the element referred to by the specified - * token. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @param select Used to select what fields are present in the returned resource(s). - * @param tags A filter used to query by tags. Syntax reference: https://aka.ms/azconfig/docs/restapirevisions. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of key-value revisions along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getRevisionsSinglePageAsync(String key, String label, String after, - String acceptDatetime, List select, List tags) { - final String accept = "application/vnd.microsoft.appconfig.kvset+json, application/problem+json"; - String selectConverted = (select == null) - ? null - : select.stream() - .map(paramItemValue -> Objects.toString(paramItemValue, "")) - .collect(Collectors.joining(",")); - List tagsConverted = (tags == null) - ? new ArrayList<>() - : tags.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); - return FluxUtil - .withContext(context -> service.getRevisions(this.getEndpoint(), key, label, this.getSyncToken(), - this.getApiVersion(), after, acceptDatetime, selectConverted, tagsConverted, accept, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getItems(), res.getValue().getNextLink(), res.getDeserializedHeaders())); - } - - /** - * Gets a list of key-value revisions. - * - * @param key A filter used to match keys. Syntax reference: https://aka.ms/azconfig/docs/restapirevisions. - * @param label A filter used to match labels. Syntax reference: https://aka.ms/azconfig/docs/restapirevisions. - * @param after Instructs the server to return elements that appear after the element referred to by the specified - * token. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @param select Used to select what fields are present in the returned resource(s). - * @param tags A filter used to query by tags. Syntax reference: https://aka.ms/azconfig/docs/restapirevisions. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of key-value revisions along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getRevisionsSinglePageAsync(String key, String label, String after, - String acceptDatetime, List select, List tags, Context context) { - final String accept = "application/vnd.microsoft.appconfig.kvset+json, application/problem+json"; - String selectConverted = (select == null) - ? null - : select.stream() - .map(paramItemValue -> Objects.toString(paramItemValue, "")) - .collect(Collectors.joining(",")); - List tagsConverted = (tags == null) - ? new ArrayList<>() - : tags.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); - return service - .getRevisions(this.getEndpoint(), key, label, this.getSyncToken(), this.getApiVersion(), after, - acceptDatetime, selectConverted, tagsConverted, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getItems(), res.getValue().getNextLink(), res.getDeserializedHeaders())); - } - - /** - * Gets a list of key-value revisions. - * - * @param key A filter used to match keys. Syntax reference: https://aka.ms/azconfig/docs/restapirevisions. - * @param label A filter used to match labels. Syntax reference: https://aka.ms/azconfig/docs/restapirevisions. - * @param after Instructs the server to return elements that appear after the element referred to by the specified - * token. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @param select Used to select what fields are present in the returned resource(s). - * @param tags A filter used to query by tags. Syntax reference: https://aka.ms/azconfig/docs/restapirevisions. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of key-value revisions as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux getRevisionsAsync(String key, String label, String after, String acceptDatetime, - List select, List tags) { - return new PagedFlux<>(() -> getRevisionsSinglePageAsync(key, label, after, acceptDatetime, select, tags), - nextLink -> getRevisionsNextSinglePageAsync(nextLink, acceptDatetime)); - } - - /** - * Gets a list of key-value revisions. - * - * @param key A filter used to match keys. Syntax reference: https://aka.ms/azconfig/docs/restapirevisions. - * @param label A filter used to match labels. Syntax reference: https://aka.ms/azconfig/docs/restapirevisions. - * @param after Instructs the server to return elements that appear after the element referred to by the specified - * token. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @param select Used to select what fields are present in the returned resource(s). - * @param tags A filter used to query by tags. Syntax reference: https://aka.ms/azconfig/docs/restapirevisions. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of key-value revisions as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux getRevisionsAsync(String key, String label, String after, String acceptDatetime, - List select, List tags, Context context) { - return new PagedFlux<>( - () -> getRevisionsSinglePageAsync(key, label, after, acceptDatetime, select, tags, context), - nextLink -> getRevisionsNextSinglePageAsync(nextLink, acceptDatetime, context)); - } - - /** - * Gets a list of key-value revisions. - * - * @param key A filter used to match keys. Syntax reference: https://aka.ms/azconfig/docs/restapirevisions. - * @param label A filter used to match labels. Syntax reference: https://aka.ms/azconfig/docs/restapirevisions. - * @param after Instructs the server to return elements that appear after the element referred to by the specified - * token. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @param select Used to select what fields are present in the returned resource(s). - * @param tags A filter used to query by tags. Syntax reference: https://aka.ms/azconfig/docs/restapirevisions. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of key-value revisions along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getRevisionsNoCustomHeadersSinglePageAsync(String key, String label, - String after, String acceptDatetime, List select, List tags) { - final String accept = "application/vnd.microsoft.appconfig.kvset+json, application/problem+json"; - String selectConverted = (select == null) - ? null - : select.stream() - .map(paramItemValue -> Objects.toString(paramItemValue, "")) - .collect(Collectors.joining(",")); - List tagsConverted = (tags == null) - ? new ArrayList<>() - : tags.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); - return FluxUtil - .withContext( - context -> service.getRevisionsNoCustomHeaders(this.getEndpoint(), key, label, this.getSyncToken(), - this.getApiVersion(), after, acceptDatetime, selectConverted, tagsConverted, accept, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getItems(), res.getValue().getNextLink(), null)); - } - - /** - * Gets a list of key-value revisions. - * - * @param key A filter used to match keys. Syntax reference: https://aka.ms/azconfig/docs/restapirevisions. - * @param label A filter used to match labels. Syntax reference: https://aka.ms/azconfig/docs/restapirevisions. - * @param after Instructs the server to return elements that appear after the element referred to by the specified - * token. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @param select Used to select what fields are present in the returned resource(s). - * @param tags A filter used to query by tags. Syntax reference: https://aka.ms/azconfig/docs/restapirevisions. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of key-value revisions along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getRevisionsNoCustomHeadersSinglePageAsync(String key, String label, - String after, String acceptDatetime, List select, List tags, Context context) { - final String accept = "application/vnd.microsoft.appconfig.kvset+json, application/problem+json"; - String selectConverted = (select == null) - ? null - : select.stream() - .map(paramItemValue -> Objects.toString(paramItemValue, "")) - .collect(Collectors.joining(",")); - List tagsConverted = (tags == null) - ? new ArrayList<>() - : tags.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); - return service - .getRevisionsNoCustomHeaders(this.getEndpoint(), key, label, this.getSyncToken(), this.getApiVersion(), - after, acceptDatetime, selectConverted, tagsConverted, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getItems(), res.getValue().getNextLink(), null)); - } - - /** - * Gets a list of key-value revisions. - * - * @param key A filter used to match keys. Syntax reference: https://aka.ms/azconfig/docs/restapirevisions. - * @param label A filter used to match labels. Syntax reference: https://aka.ms/azconfig/docs/restapirevisions. - * @param after Instructs the server to return elements that appear after the element referred to by the specified - * token. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @param select Used to select what fields are present in the returned resource(s). - * @param tags A filter used to query by tags. Syntax reference: https://aka.ms/azconfig/docs/restapirevisions. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of key-value revisions as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux getRevisionsNoCustomHeadersAsync(String key, String label, String after, - String acceptDatetime, List select, List tags) { - return new PagedFlux<>( - () -> getRevisionsNoCustomHeadersSinglePageAsync(key, label, after, acceptDatetime, select, tags), - nextLink -> getRevisionsNextSinglePageAsync(nextLink, acceptDatetime)); - } - - /** - * Gets a list of key-value revisions. - * - * @param key A filter used to match keys. Syntax reference: https://aka.ms/azconfig/docs/restapirevisions. - * @param label A filter used to match labels. Syntax reference: https://aka.ms/azconfig/docs/restapirevisions. - * @param after Instructs the server to return elements that appear after the element referred to by the specified - * token. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @param select Used to select what fields are present in the returned resource(s). - * @param tags A filter used to query by tags. Syntax reference: https://aka.ms/azconfig/docs/restapirevisions. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of key-value revisions as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux getRevisionsNoCustomHeadersAsync(String key, String label, String after, - String acceptDatetime, List select, List tags, Context context) { - return new PagedFlux<>( - () -> getRevisionsNoCustomHeadersSinglePageAsync(key, label, after, acceptDatetime, select, tags, context), - nextLink -> getRevisionsNextSinglePageAsync(nextLink, acceptDatetime, context)); - } - - /** - * Gets a list of key-value revisions. - * - * @param key A filter used to match keys. Syntax reference: https://aka.ms/azconfig/docs/restapirevisions. - * @param label A filter used to match labels. Syntax reference: https://aka.ms/azconfig/docs/restapirevisions. - * @param after Instructs the server to return elements that appear after the element referred to by the specified - * token. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @param select Used to select what fields are present in the returned resource(s). - * @param tags A filter used to query by tags. Syntax reference: https://aka.ms/azconfig/docs/restapirevisions. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of key-value revisions along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PagedResponse getRevisionsSinglePage(String key, String label, String after, String acceptDatetime, - List select, List tags) { - final String accept = "application/vnd.microsoft.appconfig.kvset+json, application/problem+json"; - String selectConverted = (select == null) - ? null - : select.stream() - .map(paramItemValue -> Objects.toString(paramItemValue, "")) - .collect(Collectors.joining(",")); - List tagsConverted = (tags == null) - ? new ArrayList<>() - : tags.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); - ResponseBase res - = service.getRevisionsSync(this.getEndpoint(), key, label, this.getSyncToken(), this.getApiVersion(), after, - acceptDatetime, selectConverted, tagsConverted, accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getItems(), res.getValue().getNextLink(), res.getDeserializedHeaders()); - } - - /** - * Gets a list of key-value revisions. - * - * @param key A filter used to match keys. Syntax reference: https://aka.ms/azconfig/docs/restapirevisions. - * @param label A filter used to match labels. Syntax reference: https://aka.ms/azconfig/docs/restapirevisions. - * @param after Instructs the server to return elements that appear after the element referred to by the specified - * token. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @param select Used to select what fields are present in the returned resource(s). - * @param tags A filter used to query by tags. Syntax reference: https://aka.ms/azconfig/docs/restapirevisions. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of key-value revisions along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PagedResponse getRevisionsSinglePage(String key, String label, String after, String acceptDatetime, - List select, List tags, Context context) { - final String accept = "application/vnd.microsoft.appconfig.kvset+json, application/problem+json"; - String selectConverted = (select == null) - ? null - : select.stream() - .map(paramItemValue -> Objects.toString(paramItemValue, "")) - .collect(Collectors.joining(",")); - List tagsConverted = (tags == null) - ? new ArrayList<>() - : tags.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); - ResponseBase res - = service.getRevisionsSync(this.getEndpoint(), key, label, this.getSyncToken(), this.getApiVersion(), after, - acceptDatetime, selectConverted, tagsConverted, accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getItems(), res.getValue().getNextLink(), res.getDeserializedHeaders()); - } - - /** - * Gets a list of key-value revisions. - * - * @param key A filter used to match keys. Syntax reference: https://aka.ms/azconfig/docs/restapirevisions. - * @param label A filter used to match labels. Syntax reference: https://aka.ms/azconfig/docs/restapirevisions. - * @param after Instructs the server to return elements that appear after the element referred to by the specified - * token. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @param select Used to select what fields are present in the returned resource(s). - * @param tags A filter used to query by tags. Syntax reference: https://aka.ms/azconfig/docs/restapirevisions. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of key-value revisions as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable getRevisions(String key, String label, String after, String acceptDatetime, - List select, List tags) { - return new PagedIterable<>(() -> getRevisionsSinglePage(key, label, after, acceptDatetime, select, tags), - nextLink -> getRevisionsNextSinglePage(nextLink, acceptDatetime)); - } - - /** - * Gets a list of key-value revisions. - * - * @param key A filter used to match keys. Syntax reference: https://aka.ms/azconfig/docs/restapirevisions. - * @param label A filter used to match labels. Syntax reference: https://aka.ms/azconfig/docs/restapirevisions. - * @param after Instructs the server to return elements that appear after the element referred to by the specified - * token. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @param select Used to select what fields are present in the returned resource(s). - * @param tags A filter used to query by tags. Syntax reference: https://aka.ms/azconfig/docs/restapirevisions. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of key-value revisions as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable getRevisions(String key, String label, String after, String acceptDatetime, - List select, List tags, Context context) { - return new PagedIterable<>( - () -> getRevisionsSinglePage(key, label, after, acceptDatetime, select, tags, context), - nextLink -> getRevisionsNextSinglePage(nextLink, acceptDatetime, context)); - } - - /** - * Gets a list of key-value revisions. - * - * @param key A filter used to match keys. Syntax reference: https://aka.ms/azconfig/docs/restapirevisions. - * @param label A filter used to match labels. Syntax reference: https://aka.ms/azconfig/docs/restapirevisions. - * @param after Instructs the server to return elements that appear after the element referred to by the specified - * token. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @param select Used to select what fields are present in the returned resource(s). - * @param tags A filter used to query by tags. Syntax reference: https://aka.ms/azconfig/docs/restapirevisions. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of key-value revisions along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PagedResponse getRevisionsNoCustomHeadersSinglePage(String key, String label, String after, - String acceptDatetime, List select, List tags) { - final String accept = "application/vnd.microsoft.appconfig.kvset+json, application/problem+json"; - String selectConverted = (select == null) - ? null - : select.stream() - .map(paramItemValue -> Objects.toString(paramItemValue, "")) - .collect(Collectors.joining(",")); - List tagsConverted = (tags == null) - ? new ArrayList<>() - : tags.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); - Response res - = service.getRevisionsNoCustomHeadersSync(this.getEndpoint(), key, label, this.getSyncToken(), - this.getApiVersion(), after, acceptDatetime, selectConverted, tagsConverted, accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getItems(), res.getValue().getNextLink(), null); - } - - /** - * Gets a list of key-value revisions. - * - * @param key A filter used to match keys. Syntax reference: https://aka.ms/azconfig/docs/restapirevisions. - * @param label A filter used to match labels. Syntax reference: https://aka.ms/azconfig/docs/restapirevisions. - * @param after Instructs the server to return elements that appear after the element referred to by the specified - * token. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @param select Used to select what fields are present in the returned resource(s). - * @param tags A filter used to query by tags. Syntax reference: https://aka.ms/azconfig/docs/restapirevisions. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of key-value revisions along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PagedResponse getRevisionsNoCustomHeadersSinglePage(String key, String label, String after, - String acceptDatetime, List select, List tags, Context context) { - final String accept = "application/vnd.microsoft.appconfig.kvset+json, application/problem+json"; - String selectConverted = (select == null) - ? null - : select.stream() - .map(paramItemValue -> Objects.toString(paramItemValue, "")) - .collect(Collectors.joining(",")); - List tagsConverted = (tags == null) - ? new ArrayList<>() - : tags.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); - Response res - = service.getRevisionsNoCustomHeadersSync(this.getEndpoint(), key, label, this.getSyncToken(), - this.getApiVersion(), after, acceptDatetime, selectConverted, tagsConverted, accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getItems(), res.getValue().getNextLink(), null); - } - - /** - * Gets a list of key-value revisions. - * - * @param key A filter used to match keys. Syntax reference: https://aka.ms/azconfig/docs/restapirevisions. - * @param label A filter used to match labels. Syntax reference: https://aka.ms/azconfig/docs/restapirevisions. - * @param after Instructs the server to return elements that appear after the element referred to by the specified - * token. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @param select Used to select what fields are present in the returned resource(s). - * @param tags A filter used to query by tags. Syntax reference: https://aka.ms/azconfig/docs/restapirevisions. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of key-value revisions as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable getRevisionsNoCustomHeaders(String key, String label, String after, - String acceptDatetime, List select, List tags) { - return new PagedIterable<>( - () -> getRevisionsNoCustomHeadersSinglePage(key, label, after, acceptDatetime, select, tags), - nextLink -> getRevisionsNextSinglePage(nextLink, acceptDatetime)); - } - - /** - * Gets a list of key-value revisions. - * - * @param key A filter used to match keys. Syntax reference: https://aka.ms/azconfig/docs/restapirevisions. - * @param label A filter used to match labels. Syntax reference: https://aka.ms/azconfig/docs/restapirevisions. - * @param after Instructs the server to return elements that appear after the element referred to by the specified - * token. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @param select Used to select what fields are present in the returned resource(s). - * @param tags A filter used to query by tags. Syntax reference: https://aka.ms/azconfig/docs/restapirevisions. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of key-value revisions as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable getRevisionsNoCustomHeaders(String key, String label, String after, - String acceptDatetime, List select, List tags, Context context) { - return new PagedIterable<>( - () -> getRevisionsNoCustomHeadersSinglePage(key, label, after, acceptDatetime, select, tags, context), - nextLink -> getRevisionsNextSinglePage(nextLink, acceptDatetime, context)); - } - - /** - * Requests the headers and status of the given resource. - * - * @param key A filter used to match keys. Syntax reference: https://aka.ms/azconfig/docs/restapirevisions. - * @param label A filter used to match labels. Syntax reference: https://aka.ms/azconfig/docs/restapirevisions. - * @param after Instructs the server to return elements that appear after the element referred to by the specified - * token. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @param select Used to select what fields are present in the returned resource(s). - * @param tags A filter used to query by tags. Syntax reference: https://aka.ms/azconfig/docs/restapirevisions. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> checkRevisionsWithResponseAsync(String key, String label, - String after, String acceptDatetime, List select, List tags) { - return FluxUtil.withContext( - context -> checkRevisionsWithResponseAsync(key, label, after, acceptDatetime, select, tags, context)); - } - - /** - * Requests the headers and status of the given resource. - * - * @param key A filter used to match keys. Syntax reference: https://aka.ms/azconfig/docs/restapirevisions. - * @param label A filter used to match labels. Syntax reference: https://aka.ms/azconfig/docs/restapirevisions. - * @param after Instructs the server to return elements that appear after the element referred to by the specified - * token. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @param select Used to select what fields are present in the returned resource(s). - * @param tags A filter used to query by tags. Syntax reference: https://aka.ms/azconfig/docs/restapirevisions. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> checkRevisionsWithResponseAsync(String key, String label, - String after, String acceptDatetime, List select, List tags, Context context) { - String selectConverted = (select == null) - ? null - : select.stream() - .map(paramItemValue -> Objects.toString(paramItemValue, "")) - .collect(Collectors.joining(",")); - List tagsConverted = (tags == null) - ? new ArrayList<>() - : tags.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); - return service.checkRevisions(this.getEndpoint(), key, label, this.getSyncToken(), this.getApiVersion(), after, - acceptDatetime, selectConverted, tagsConverted, context); - } - - /** - * Requests the headers and status of the given resource. - * - * @param key A filter used to match keys. Syntax reference: https://aka.ms/azconfig/docs/restapirevisions. - * @param label A filter used to match labels. Syntax reference: https://aka.ms/azconfig/docs/restapirevisions. - * @param after Instructs the server to return elements that appear after the element referred to by the specified - * token. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @param select Used to select what fields are present in the returned resource(s). - * @param tags A filter used to query by tags. Syntax reference: https://aka.ms/azconfig/docs/restapirevisions. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono checkRevisionsAsync(String key, String label, String after, String acceptDatetime, - List select, List tags) { - return checkRevisionsWithResponseAsync(key, label, after, acceptDatetime, select, tags) - .flatMap(ignored -> Mono.empty()); - } - - /** - * Requests the headers and status of the given resource. - * - * @param key A filter used to match keys. Syntax reference: https://aka.ms/azconfig/docs/restapirevisions. - * @param label A filter used to match labels. Syntax reference: https://aka.ms/azconfig/docs/restapirevisions. - * @param after Instructs the server to return elements that appear after the element referred to by the specified - * token. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @param select Used to select what fields are present in the returned resource(s). - * @param tags A filter used to query by tags. Syntax reference: https://aka.ms/azconfig/docs/restapirevisions. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono checkRevisionsAsync(String key, String label, String after, String acceptDatetime, - List select, List tags, Context context) { - return checkRevisionsWithResponseAsync(key, label, after, acceptDatetime, select, tags, context) - .flatMap(ignored -> Mono.empty()); - } - - /** - * Requests the headers and status of the given resource. - * - * @param key A filter used to match keys. Syntax reference: https://aka.ms/azconfig/docs/restapirevisions. - * @param label A filter used to match labels. Syntax reference: https://aka.ms/azconfig/docs/restapirevisions. - * @param after Instructs the server to return elements that appear after the element referred to by the specified - * token. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @param select Used to select what fields are present in the returned resource(s). - * @param tags A filter used to query by tags. Syntax reference: https://aka.ms/azconfig/docs/restapirevisions. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> checkRevisionsNoCustomHeadersWithResponseAsync(String key, String label, String after, - String acceptDatetime, List select, List tags) { - return FluxUtil.withContext(context -> checkRevisionsNoCustomHeadersWithResponseAsync(key, label, after, - acceptDatetime, select, tags, context)); - } - - /** - * Requests the headers and status of the given resource. - * - * @param key A filter used to match keys. Syntax reference: https://aka.ms/azconfig/docs/restapirevisions. - * @param label A filter used to match labels. Syntax reference: https://aka.ms/azconfig/docs/restapirevisions. - * @param after Instructs the server to return elements that appear after the element referred to by the specified - * token. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @param select Used to select what fields are present in the returned resource(s). - * @param tags A filter used to query by tags. Syntax reference: https://aka.ms/azconfig/docs/restapirevisions. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> checkRevisionsNoCustomHeadersWithResponseAsync(String key, String label, String after, - String acceptDatetime, List select, List tags, Context context) { - String selectConverted = (select == null) - ? null - : select.stream() - .map(paramItemValue -> Objects.toString(paramItemValue, "")) - .collect(Collectors.joining(",")); - List tagsConverted = (tags == null) - ? new ArrayList<>() - : tags.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); - return service.checkRevisionsNoCustomHeaders(this.getEndpoint(), key, label, this.getSyncToken(), - this.getApiVersion(), after, acceptDatetime, selectConverted, tagsConverted, context); - } - - /** - * Requests the headers and status of the given resource. - * - * @param key A filter used to match keys. Syntax reference: https://aka.ms/azconfig/docs/restapirevisions. - * @param label A filter used to match labels. Syntax reference: https://aka.ms/azconfig/docs/restapirevisions. - * @param after Instructs the server to return elements that appear after the element referred to by the specified - * token. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @param select Used to select what fields are present in the returned resource(s). - * @param tags A filter used to query by tags. Syntax reference: https://aka.ms/azconfig/docs/restapirevisions. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link ResponseBase}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ResponseBase checkRevisionsWithResponse(String key, String label, String after, - String acceptDatetime, List select, List tags, Context context) { - String selectConverted = (select == null) - ? null - : select.stream() - .map(paramItemValue -> Objects.toString(paramItemValue, "")) - .collect(Collectors.joining(",")); - List tagsConverted = (tags == null) - ? new ArrayList<>() - : tags.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); - return service.checkRevisionsSync(this.getEndpoint(), key, label, this.getSyncToken(), this.getApiVersion(), - after, acceptDatetime, selectConverted, tagsConverted, context); - } - - /** - * Requests the headers and status of the given resource. - * - * @param key A filter used to match keys. Syntax reference: https://aka.ms/azconfig/docs/restapirevisions. - * @param label A filter used to match labels. Syntax reference: https://aka.ms/azconfig/docs/restapirevisions. - * @param after Instructs the server to return elements that appear after the element referred to by the specified - * token. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @param select Used to select what fields are present in the returned resource(s). - * @param tags A filter used to query by tags. Syntax reference: https://aka.ms/azconfig/docs/restapirevisions. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void checkRevisions(String key, String label, String after, String acceptDatetime, - List select, List tags) { - checkRevisionsWithResponse(key, label, after, acceptDatetime, select, tags, Context.NONE); - } - - /** - * Requests the headers and status of the given resource. - * - * @param key A filter used to match keys. Syntax reference: https://aka.ms/azconfig/docs/restapirevisions. - * @param label A filter used to match labels. Syntax reference: https://aka.ms/azconfig/docs/restapirevisions. - * @param after Instructs the server to return elements that appear after the element referred to by the specified - * token. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @param select Used to select what fields are present in the returned resource(s). - * @param tags A filter used to query by tags. Syntax reference: https://aka.ms/azconfig/docs/restapirevisions. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response checkRevisionsNoCustomHeadersWithResponse(String key, String label, String after, - String acceptDatetime, List select, List tags, Context context) { - String selectConverted = (select == null) - ? null - : select.stream() - .map(paramItemValue -> Objects.toString(paramItemValue, "")) - .collect(Collectors.joining(",")); - List tagsConverted = (tags == null) - ? new ArrayList<>() - : tags.stream().map(item -> Objects.toString(item, "")).collect(Collectors.toList()); - return service.checkRevisionsNoCustomHeadersSync(this.getEndpoint(), key, label, this.getSyncToken(), - this.getApiVersion(), after, acceptDatetime, selectConverted, tagsConverted, context); - } - - /** - * Gets the state of a long running operation. - * - * @param snapshot Snapshot identifier for the long running operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the state of a long running operation along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getOperationDetailsWithResponseAsync(String snapshot) { - return FluxUtil.withContext(context -> getOperationDetailsWithResponseAsync(snapshot, context)); - } - - /** - * Gets the state of a long running operation. - * - * @param snapshot Snapshot identifier for the long running operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the state of a long running operation along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getOperationDetailsWithResponseAsync(String snapshot, Context context) { - final String accept = "application/json"; - return service.getOperationDetails(this.getEndpoint(), this.getApiVersion(), snapshot, accept, context); - } - - /** - * Gets the state of a long running operation. - * - * @param snapshot Snapshot identifier for the long running operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the state of a long running operation on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getOperationDetailsAsync(String snapshot) { - return getOperationDetailsWithResponseAsync(snapshot).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets the state of a long running operation. - * - * @param snapshot Snapshot identifier for the long running operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the state of a long running operation on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getOperationDetailsAsync(String snapshot, Context context) { - return getOperationDetailsWithResponseAsync(snapshot, context).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets the state of a long running operation. - * - * @param snapshot Snapshot identifier for the long running operation. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the state of a long running operation along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getOperationDetailsWithResponse(String snapshot, Context context) { - final String accept = "application/json"; - return service.getOperationDetailsSync(this.getEndpoint(), this.getApiVersion(), snapshot, accept, context); - } - - /** - * Gets the state of a long running operation. - * - * @param snapshot Snapshot identifier for the long running operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the state of a long running operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public OperationDetails getOperationDetails(String snapshot) { - return getOperationDetailsWithResponse(snapshot, Context.NONE).getValue(); - } - - /** - * Gets a list of keys. - * - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of keys along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getKeysNextSinglePageAsync(String nextLink, String acceptDatetime) { - final String accept = "application/vnd.microsoft.appconfig.keyset+json, application/problem+json"; - return FluxUtil - .withContext(context -> service.getKeysNext(nextLink, this.getEndpoint(), this.getSyncToken(), - acceptDatetime, accept, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getItems(), res.getValue().getNextLink(), res.getDeserializedHeaders())); - } - - /** - * Gets a list of keys. - * - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of keys along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getKeysNextSinglePageAsync(String nextLink, String acceptDatetime, - Context context) { - final String accept = "application/vnd.microsoft.appconfig.keyset+json, application/problem+json"; - return service.getKeysNext(nextLink, this.getEndpoint(), this.getSyncToken(), acceptDatetime, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getItems(), res.getValue().getNextLink(), res.getDeserializedHeaders())); - } - - /** - * Gets a list of keys. - * - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of keys along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getKeysNextNoCustomHeadersSinglePageAsync(String nextLink, String acceptDatetime) { - final String accept = "application/vnd.microsoft.appconfig.keyset+json, application/problem+json"; - return FluxUtil - .withContext(context -> service.getKeysNextNoCustomHeaders(nextLink, this.getEndpoint(), - this.getSyncToken(), acceptDatetime, accept, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getItems(), res.getValue().getNextLink(), null)); - } - - /** - * Gets a list of keys. - * - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of keys along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getKeysNextNoCustomHeadersSinglePageAsync(String nextLink, String acceptDatetime, - Context context) { - final String accept = "application/vnd.microsoft.appconfig.keyset+json, application/problem+json"; - return service - .getKeysNextNoCustomHeaders(nextLink, this.getEndpoint(), this.getSyncToken(), acceptDatetime, accept, - context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getItems(), res.getValue().getNextLink(), null)); - } - - /** - * Gets a list of keys. - * - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of keys along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PagedResponse getKeysNextSinglePage(String nextLink, String acceptDatetime) { - final String accept = "application/vnd.microsoft.appconfig.keyset+json, application/problem+json"; - ResponseBase res = service.getKeysNextSync(nextLink, this.getEndpoint(), - this.getSyncToken(), acceptDatetime, accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getItems(), res.getValue().getNextLink(), res.getDeserializedHeaders()); - } - - /** - * Gets a list of keys. - * - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of keys along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PagedResponse getKeysNextSinglePage(String nextLink, String acceptDatetime, Context context) { - final String accept = "application/vnd.microsoft.appconfig.keyset+json, application/problem+json"; - ResponseBase res = service.getKeysNextSync(nextLink, this.getEndpoint(), - this.getSyncToken(), acceptDatetime, accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getItems(), res.getValue().getNextLink(), res.getDeserializedHeaders()); - } - - /** - * Gets a list of keys. - * - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of keys along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PagedResponse getKeysNextNoCustomHeadersSinglePage(String nextLink, String acceptDatetime) { - final String accept = "application/vnd.microsoft.appconfig.keyset+json, application/problem+json"; - Response res = service.getKeysNextNoCustomHeadersSync(nextLink, this.getEndpoint(), - this.getSyncToken(), acceptDatetime, accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getItems(), res.getValue().getNextLink(), null); - } - - /** - * Gets a list of keys. - * - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of keys along with {@link PagedResponse}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public PagedResponse getKeysNextNoCustomHeadersSinglePage(String nextLink, String acceptDatetime, - Context context) { - final String accept = "application/vnd.microsoft.appconfig.keyset+json, application/problem+json"; - Response res = service.getKeysNextNoCustomHeadersSync(nextLink, this.getEndpoint(), - this.getSyncToken(), acceptDatetime, accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getItems(), res.getValue().getNextLink(), null); - } - - /** - * Gets a list of key-values. - * - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided. - * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value - * provided. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of key-values along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getKeyValuesNextSinglePageAsync(String nextLink, String acceptDatetime, - String ifMatch, String ifNoneMatch) { - final String accept = "application/vnd.microsoft.appconfig.kvset+json, application/problem+json"; - return FluxUtil - .withContext(context -> service.getKeyValuesNext(nextLink, this.getEndpoint(), this.getSyncToken(), - acceptDatetime, ifMatch, ifNoneMatch, accept, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getItems(), res.getValue().getNextLink(), res.getDeserializedHeaders())); - } - - /** - * Gets a list of key-values. - * - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided. - * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value - * provided. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of key-values along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getKeyValuesNextSinglePageAsync(String nextLink, String acceptDatetime, - String ifMatch, String ifNoneMatch, Context context) { - final String accept = "application/vnd.microsoft.appconfig.kvset+json, application/problem+json"; - return service - .getKeyValuesNext(nextLink, this.getEndpoint(), this.getSyncToken(), acceptDatetime, ifMatch, ifNoneMatch, - accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getItems(), res.getValue().getNextLink(), res.getDeserializedHeaders())); - } - - /** - * Gets a list of key-values. - * - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided. - * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value - * provided. - * @throws IllegalArgumentException thrown if parameters fail the validation. + * Creates a key-value snapshot. + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Sync-TokenStringNoUsed to guarantee real-time consistency between + * requests.
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     name: String (Required)
+     *     status: String(provisioning/ready/archived/failed) (Optional)
+     *     filters (Required): [
+     *          (Required){
+     *             key: String (Required)
+     *             label: String (Optional)
+     *             tags (Optional): [
+     *                 String (Optional)
+     *             ]
+     *         }
+     *     ]
+     *     composition_type: String(key/key_label) (Optional)
+     *     created: OffsetDateTime (Optional)
+     *     expires: OffsetDateTime (Optional)
+     *     retention_period: Long (Optional)
+     *     size: Long (Optional)
+     *     items_count: Long (Optional)
+     *     tags (Optional): {
+     *         String: String (Required)
+     *     }
+     *     etag: String (Optional)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     name: String (Required)
+     *     status: String(provisioning/ready/archived/failed) (Optional)
+     *     filters (Required): [
+     *          (Required){
+     *             key: String (Required)
+     *             label: String (Optional)
+     *             tags (Optional): [
+     *                 String (Optional)
+     *             ]
+     *         }
+     *     ]
+     *     composition_type: String(key/key_label) (Optional)
+     *     created: OffsetDateTime (Optional)
+     *     expires: OffsetDateTime (Optional)
+     *     retention_period: Long (Optional)
+     *     size: Long (Optional)
+     *     items_count: Long (Optional)
+     *     tags (Optional): {
+     *         String: String (Required)
+     *     }
+     *     etag: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param contentType Content-Type header. Allowed values: "application/vnd.microsoft.appconfig.snapshot+json", + * "application/json". + * @param name The name of the key-value snapshot to create. + * @param entity The key-value snapshot to create. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of key-values along with {@link PagedResponse} on successful completion of {@link Mono}. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link PollerFlux} for polling of a snapshot is a named, immutable subset of an App Configuration + * store's key-values. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getKeyValuesNextNoCustomHeadersSinglePageAsync(String nextLink, - String acceptDatetime, String ifMatch, String ifNoneMatch) { - final String accept = "application/vnd.microsoft.appconfig.kvset+json, application/problem+json"; - return FluxUtil - .withContext(context -> service.getKeyValuesNextNoCustomHeaders(nextLink, this.getEndpoint(), - this.getSyncToken(), acceptDatetime, ifMatch, ifNoneMatch, accept, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getItems(), res.getValue().getNextLink(), null)); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux beginCreateSnapshotAsync(String contentType, String name, + BinaryData entity, RequestOptions requestOptions) { + return PollerFlux.create(Duration.ofSeconds(1), + () -> this.createSnapshotWithResponseAsync(contentType, name, entity, requestOptions), + new DefaultPollingStrategy<>(new PollingStrategyOptions(this.getHttpPipeline()) + .setEndpoint("{endpoint}".replace("{endpoint}", this.getEndpoint())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.getServiceVersion().getVersion())), + TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(BinaryData.class)); } /** - * Gets a list of key-values. - * - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided. - * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value - * provided. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. + * Creates a key-value snapshot. + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Sync-TokenStringNoUsed to guarantee real-time consistency between + * requests.
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     name: String (Required)
+     *     status: String(provisioning/ready/archived/failed) (Optional)
+     *     filters (Required): [
+     *          (Required){
+     *             key: String (Required)
+     *             label: String (Optional)
+     *             tags (Optional): [
+     *                 String (Optional)
+     *             ]
+     *         }
+     *     ]
+     *     composition_type: String(key/key_label) (Optional)
+     *     created: OffsetDateTime (Optional)
+     *     expires: OffsetDateTime (Optional)
+     *     retention_period: Long (Optional)
+     *     size: Long (Optional)
+     *     items_count: Long (Optional)
+     *     tags (Optional): {
+     *         String: String (Required)
+     *     }
+     *     etag: String (Optional)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     name: String (Required)
+     *     status: String(provisioning/ready/archived/failed) (Optional)
+     *     filters (Required): [
+     *          (Required){
+     *             key: String (Required)
+     *             label: String (Optional)
+     *             tags (Optional): [
+     *                 String (Optional)
+     *             ]
+     *         }
+     *     ]
+     *     composition_type: String(key/key_label) (Optional)
+     *     created: OffsetDateTime (Optional)
+     *     expires: OffsetDateTime (Optional)
+     *     retention_period: Long (Optional)
+     *     size: Long (Optional)
+     *     items_count: Long (Optional)
+     *     tags (Optional): {
+     *         String: String (Required)
+     *     }
+     *     etag: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param contentType Content-Type header. Allowed values: "application/vnd.microsoft.appconfig.snapshot+json", + * "application/json". + * @param name The name of the key-value snapshot to create. + * @param entity The key-value snapshot to create. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of key-values along with {@link PagedResponse} on successful completion of {@link Mono}. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link SyncPoller} for polling of a snapshot is a named, immutable subset of an App Configuration + * store's key-values. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getKeyValuesNextNoCustomHeadersSinglePageAsync(String nextLink, - String acceptDatetime, String ifMatch, String ifNoneMatch, Context context) { - final String accept = "application/vnd.microsoft.appconfig.kvset+json, application/problem+json"; - return service - .getKeyValuesNextNoCustomHeaders(nextLink, this.getEndpoint(), this.getSyncToken(), acceptDatetime, ifMatch, - ifNoneMatch, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getItems(), res.getValue().getNextLink(), null)); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller beginCreateSnapshot(String contentType, String name, BinaryData entity, + RequestOptions requestOptions) { + return SyncPoller.createPoller(Duration.ofSeconds(1), + () -> this.createSnapshotWithResponse(contentType, name, entity, requestOptions), + new SyncDefaultPollingStrategy<>(new PollingStrategyOptions(this.getHttpPipeline()) + .setEndpoint("{endpoint}".replace("{endpoint}", this.getEndpoint())) + .setContext(requestOptions != null && requestOptions.getContext() != null + ? requestOptions.getContext() + : Context.NONE) + .setServiceVersion(this.getServiceVersion().getVersion())), + TypeReference.createInstance(BinaryData.class), TypeReference.createInstance(BinaryData.class)); } /** - * Gets a list of key-values. - * - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided. - * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value - * provided. - * @throws IllegalArgumentException thrown if parameters fail the validation. + * Updates the state of a key-value snapshot. + *

Header Parameters

+ * + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Sync-TokenStringNoUsed to guarantee real-time consistency between + * requests.
If-MatchStringNoUsed to perform an operation only if the targeted resource's + * etag matches the + * value provided.
If-None-MatchStringNoUsed to perform an operation only if the targeted + * resource's etag does not + * match the value provided.
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     status: String(provisioning/ready/archived/failed) (Optional)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     name: String (Required)
+     *     status: String(provisioning/ready/archived/failed) (Optional)
+     *     filters (Required): [
+     *          (Required){
+     *             key: String (Required)
+     *             label: String (Optional)
+     *             tags (Optional): [
+     *                 String (Optional)
+     *             ]
+     *         }
+     *     ]
+     *     composition_type: String(key/key_label) (Optional)
+     *     created: OffsetDateTime (Optional)
+     *     expires: OffsetDateTime (Optional)
+     *     retention_period: Long (Optional)
+     *     size: Long (Optional)
+     *     items_count: Long (Optional)
+     *     tags (Optional): {
+     *         String: String (Required)
+     *     }
+     *     etag: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param contentType Content-Type header. Allowed values: "application/merge-patch+json", "application/json". + * @param name The name of the key-value snapshot to update. + * @param entity The parameters used to update the snapshot. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of key-values along with {@link PagedResponse}. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a snapshot is a named, immutable subset of an App Configuration store's key-values along with + * {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PagedResponse getKeyValuesNextSinglePage(String nextLink, String acceptDatetime, String ifMatch, - String ifNoneMatch) { - final String accept = "application/vnd.microsoft.appconfig.kvset+json, application/problem+json"; - ResponseBase res = service.getKeyValuesNextSync(nextLink, - this.getEndpoint(), this.getSyncToken(), acceptDatetime, ifMatch, ifNoneMatch, accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getItems(), res.getValue().getNextLink(), res.getDeserializedHeaders()); + public Mono> updateSnapshotWithResponseAsync(String contentType, String name, + BinaryData entity, RequestOptions requestOptions) { + final String accept = "application/vnd.microsoft.appconfig.snapshot+json, application/problem+json"; + return FluxUtil.withContext(context -> service.updateSnapshot(this.getEndpoint(), + this.getServiceVersion().getVersion(), contentType, name, accept, entity, requestOptions, context)); } /** - * Gets a list of key-values. - * - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided. - * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value - * provided. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. + * Updates the state of a key-value snapshot. + *

Header Parameters

+ * + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Sync-TokenStringNoUsed to guarantee real-time consistency between + * requests.
If-MatchStringNoUsed to perform an operation only if the targeted resource's + * etag matches the + * value provided.
If-None-MatchStringNoUsed to perform an operation only if the targeted + * resource's etag does not + * match the value provided.
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Request Body Schema

+ * + *
+     * {@code
+     * {
+     *     status: String(provisioning/ready/archived/failed) (Optional)
+     * }
+     * }
+     * 
+ * + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     name: String (Required)
+     *     status: String(provisioning/ready/archived/failed) (Optional)
+     *     filters (Required): [
+     *          (Required){
+     *             key: String (Required)
+     *             label: String (Optional)
+     *             tags (Optional): [
+     *                 String (Optional)
+     *             ]
+     *         }
+     *     ]
+     *     composition_type: String(key/key_label) (Optional)
+     *     created: OffsetDateTime (Optional)
+     *     expires: OffsetDateTime (Optional)
+     *     retention_period: Long (Optional)
+     *     size: Long (Optional)
+     *     items_count: Long (Optional)
+     *     tags (Optional): {
+     *         String: String (Required)
+     *     }
+     *     etag: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param contentType Content-Type header. Allowed values: "application/merge-patch+json", "application/json". + * @param name The name of the key-value snapshot to update. + * @param entity The parameters used to update the snapshot. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of key-values along with {@link PagedResponse}. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a snapshot is a named, immutable subset of an App Configuration store's key-values along with + * {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PagedResponse getKeyValuesNextSinglePage(String nextLink, String acceptDatetime, String ifMatch, - String ifNoneMatch, Context context) { - final String accept = "application/vnd.microsoft.appconfig.kvset+json, application/problem+json"; - ResponseBase res = service.getKeyValuesNextSync(nextLink, - this.getEndpoint(), this.getSyncToken(), acceptDatetime, ifMatch, ifNoneMatch, accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getItems(), res.getValue().getNextLink(), res.getDeserializedHeaders()); + public Response updateSnapshotWithResponse(String contentType, String name, BinaryData entity, + RequestOptions requestOptions) { + final String accept = "application/vnd.microsoft.appconfig.snapshot+json, application/problem+json"; + return service.updateSnapshotSync(this.getEndpoint(), this.getServiceVersion().getVersion(), contentType, name, + accept, entity, requestOptions, Context.NONE); } /** - * Gets a list of key-values. - * - * Get the next page of items. + * Requests the headers and status of the given resource. + *

Header Parameters

+ * + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Sync-TokenStringNoUsed to guarantee real-time consistency between + * requests.
If-MatchStringNoUsed to perform an operation only if the targeted resource's + * etag matches the + * value provided.
If-None-MatchStringNoUsed to perform an operation only if the targeted + * resource's etag does not + * match the value provided.
+ * You can add these to a request with {@link RequestOptions#addHeader} * - * @param nextLink The URL to get the next list of items. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided. - * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value - * provided. - * @throws IllegalArgumentException thrown if parameters fail the validation. + * @param name The name of the key-value snapshot to check. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of key-values along with {@link PagedResponse}. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PagedResponse getKeyValuesNextNoCustomHeadersSinglePage(String nextLink, String acceptDatetime, - String ifMatch, String ifNoneMatch) { - final String accept = "application/vnd.microsoft.appconfig.kvset+json, application/problem+json"; - Response res = service.getKeyValuesNextNoCustomHeadersSync(nextLink, this.getEndpoint(), - this.getSyncToken(), acceptDatetime, ifMatch, ifNoneMatch, accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getItems(), res.getValue().getNextLink(), null); + public Mono> checkSnapshotWithResponseAsync(String name, RequestOptions requestOptions) { + return FluxUtil.withContext(context -> service.checkSnapshot(this.getEndpoint(), + this.getServiceVersion().getVersion(), name, requestOptions, context)); } /** - * Gets a list of key-values. - * - * Get the next page of items. + * Requests the headers and status of the given resource. + *

Header Parameters

+ * + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Sync-TokenStringNoUsed to guarantee real-time consistency between + * requests.
If-MatchStringNoUsed to perform an operation only if the targeted resource's + * etag matches the + * value provided.
If-None-MatchStringNoUsed to perform an operation only if the targeted + * resource's etag does not + * match the value provided.
+ * You can add these to a request with {@link RequestOptions#addHeader} * - * @param nextLink The URL to get the next list of items. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @param ifMatch Used to perform an operation only if the targeted resource's etag matches the value provided. - * @param ifNoneMatch Used to perform an operation only if the targeted resource's etag does not match the value - * provided. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. + * @param name The name of the key-value snapshot to check. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of key-values along with {@link PagedResponse}. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PagedResponse getKeyValuesNextNoCustomHeadersSinglePage(String nextLink, String acceptDatetime, - String ifMatch, String ifNoneMatch, Context context) { - final String accept = "application/vnd.microsoft.appconfig.kvset+json, application/problem+json"; - Response res = service.getKeyValuesNextNoCustomHeadersSync(nextLink, this.getEndpoint(), - this.getSyncToken(), acceptDatetime, ifMatch, ifNoneMatch, accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getItems(), res.getValue().getNextLink(), null); + public Response checkSnapshotWithResponse(String name, RequestOptions requestOptions) { + return service.checkSnapshotSync(this.getEndpoint(), this.getServiceVersion().getVersion(), name, + requestOptions, Context.NONE); } /** - * Gets a list of key-value snapshots. - * - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of key-value snapshots along with {@link PagedResponse} on successful completion of {@link Mono}. + * Gets a list of labels. + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
nameStringNoA filter for the name of the returned labels.
AfterStringNoInstructs the server to return elements that appear after the + * element referred + * to by the specified token.
$SelectList<String>NoUsed to select what fields are present in the + * returned resource(s). In the form of "," separated string.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Sync-TokenStringNoUsed to guarantee real-time consistency between + * requests.
Accept-DatetimeStringNoRequests the server to respond with the state of the + * resource at the specified + * time.
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     name: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a list of labels along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getSnapshotsNextSinglePageAsync(String nextLink) { - final String accept = "application/vnd.microsoft.appconfig.snapshotset+json, application/problem+json"; + public Mono> getLabelsSinglePageAsync(RequestOptions requestOptions) { + final String accept = "application/vnd.microsoft.appconfig.labelset+json, application/problem+json"; return FluxUtil - .withContext( - context -> service.getSnapshotsNext(nextLink, this.getEndpoint(), this.getSyncToken(), accept, context)) + .withContext(context -> service.getLabels(this.getEndpoint(), this.getServiceVersion().getVersion(), accept, + requestOptions, context)) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getItems(), res.getValue().getNextLink(), res.getDeserializedHeaders())); + getValues(res.getValue(), "items"), getNextLink(res.getValue(), "@nextLink"), null)); } /** - * Gets a list of key-value snapshots. - * - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of key-value snapshots along with {@link PagedResponse} on successful completion of {@link Mono}. + * Gets a list of labels. + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
nameStringNoA filter for the name of the returned labels.
AfterStringNoInstructs the server to return elements that appear after the + * element referred + * to by the specified token.
$SelectList<String>NoUsed to select what fields are present in the + * returned resource(s). In the form of "," separated string.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Sync-TokenStringNoUsed to guarantee real-time consistency between + * requests.
Accept-DatetimeStringNoRequests the server to respond with the state of the + * resource at the specified + * time.
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     name: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a list of labels as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getSnapshotsNextSinglePageAsync(String nextLink, - Context context) { - final String accept = "application/vnd.microsoft.appconfig.snapshotset+json, application/problem+json"; - return service.getSnapshotsNext(nextLink, this.getEndpoint(), this.getSyncToken(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getItems(), res.getValue().getNextLink(), res.getDeserializedHeaders())); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux getLabelsAsync(RequestOptions requestOptions) { + RequestOptions requestOptionsForNextPage = new RequestOptions(); + requestOptionsForNextPage.setContext( + requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); + return new PagedFlux<>(() -> getLabelsSinglePageAsync(requestOptions), + nextLink -> getLabelsNextSinglePageAsync(nextLink, requestOptionsForNextPage)); } /** - * Gets a list of key-value snapshots. - * - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of key-value snapshots along with {@link PagedResponse} on successful completion of {@link Mono}. + * Gets a list of labels. + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
nameStringNoA filter for the name of the returned labels.
AfterStringNoInstructs the server to return elements that appear after the + * element referred + * to by the specified token.
$SelectList<String>NoUsed to select what fields are present in the + * returned resource(s). In the form of "," separated string.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Sync-TokenStringNoUsed to guarantee real-time consistency between + * requests.
Accept-DatetimeStringNoRequests the server to respond with the state of the + * resource at the specified + * time.
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     name: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a list of labels along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getSnapshotsNextNoCustomHeadersSinglePageAsync(String nextLink) { - final String accept = "application/vnd.microsoft.appconfig.snapshotset+json, application/problem+json"; - return FluxUtil - .withContext(context -> service.getSnapshotsNextNoCustomHeaders(nextLink, this.getEndpoint(), - this.getSyncToken(), accept, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getItems(), res.getValue().getNextLink(), null)); + public PagedResponse getLabelsSinglePage(RequestOptions requestOptions) { + final String accept = "application/vnd.microsoft.appconfig.labelset+json, application/problem+json"; + Response res = service.getLabelsSync(this.getEndpoint(), this.getServiceVersion().getVersion(), + accept, requestOptions, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "items"), getNextLink(res.getValue(), "@nextLink"), null); } /** - * Gets a list of key-value snapshots. - * - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of key-value snapshots along with {@link PagedResponse} on successful completion of {@link Mono}. + * Gets a list of labels. + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
nameStringNoA filter for the name of the returned labels.
AfterStringNoInstructs the server to return elements that appear after the + * element referred + * to by the specified token.
$SelectList<String>NoUsed to select what fields are present in the + * returned resource(s). In the form of "," separated string.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Sync-TokenStringNoUsed to guarantee real-time consistency between + * requests.
Accept-DatetimeStringNoRequests the server to respond with the state of the + * resource at the specified + * time.
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     name: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a list of labels as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getSnapshotsNextNoCustomHeadersSinglePageAsync(String nextLink, - Context context) { - final String accept = "application/vnd.microsoft.appconfig.snapshotset+json, application/problem+json"; - return service - .getSnapshotsNextNoCustomHeaders(nextLink, this.getEndpoint(), this.getSyncToken(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getItems(), res.getValue().getNextLink(), null)); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable getLabels(RequestOptions requestOptions) { + RequestOptions requestOptionsForNextPage = new RequestOptions(); + requestOptionsForNextPage.setContext( + requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); + return new PagedIterable<>(() -> getLabelsSinglePage(requestOptions), + nextLink -> getLabelsNextSinglePage(nextLink, requestOptionsForNextPage)); } /** - * Gets a list of key-value snapshots. - * - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of key-value snapshots along with {@link PagedResponse}. + * Requests the headers and status of the given resource. + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
nameStringNoA filter for the name of the returned labels.
AfterStringNoInstructs the server to return elements that appear after the + * element referred + * to by the specified token.
$SelectList<String>NoUsed to select what fields are present in the + * returned resource(s). In the form of "," separated string.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Sync-TokenStringNoUsed to guarantee real-time consistency between + * requests.
Accept-DatetimeStringNoRequests the server to respond with the state of the + * resource at the specified + * time.
+ * You can add these to a request with {@link RequestOptions#addHeader} + * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PagedResponse getSnapshotsNextSinglePage(String nextLink) { - final String accept = "application/vnd.microsoft.appconfig.snapshotset+json, application/problem+json"; - ResponseBase res - = service.getSnapshotsNextSync(nextLink, this.getEndpoint(), this.getSyncToken(), accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getItems(), res.getValue().getNextLink(), res.getDeserializedHeaders()); + public Mono> checkLabelsWithResponseAsync(RequestOptions requestOptions) { + return FluxUtil.withContext(context -> service.checkLabels(this.getEndpoint(), + this.getServiceVersion().getVersion(), requestOptions, context)); } /** - * Gets a list of key-value snapshots. - * - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of key-value snapshots along with {@link PagedResponse}. + * Requests the headers and status of the given resource. + *

Query Parameters

+ * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
nameStringNoA filter for the name of the returned labels.
AfterStringNoInstructs the server to return elements that appear after the + * element referred + * to by the specified token.
$SelectList<String>NoUsed to select what fields are present in the + * returned resource(s). In the form of "," separated string.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Sync-TokenStringNoUsed to guarantee real-time consistency between + * requests.
Accept-DatetimeStringNoRequests the server to respond with the state of the + * resource at the specified + * time.
+ * You can add these to a request with {@link RequestOptions#addHeader} + * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PagedResponse getSnapshotsNextSinglePage(String nextLink, Context context) { - final String accept = "application/vnd.microsoft.appconfig.snapshotset+json, application/problem+json"; - ResponseBase res - = service.getSnapshotsNextSync(nextLink, this.getEndpoint(), this.getSyncToken(), accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getItems(), res.getValue().getNextLink(), res.getDeserializedHeaders()); + public Response checkLabelsWithResponse(RequestOptions requestOptions) { + return service.checkLabelsSync(this.getEndpoint(), this.getServiceVersion().getVersion(), requestOptions, + Context.NONE); } /** - * Gets a list of key-value snapshots. - * - * Get the next page of items. + * Locks a key-value. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
labelStringNoThe label, if any, of the key-value to lock.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Sync-TokenStringNoUsed to guarantee real-time consistency between + * requests.
If-MatchStringNoUsed to perform an operation only if the targeted resource's + * etag matches the + * value provided.
If-None-MatchStringNoUsed to perform an operation only if the targeted + * resource's etag does not + * match the value provided.
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     key: String (Required)
+     *     label: String (Optional)
+     *     content_type: String (Optional)
+     *     value: String (Optional)
+     *     last_modified: OffsetDateTime (Optional)
+     *     tags (Optional): {
+     *         String: String (Required)
+     *     }
+     *     locked: Boolean (Optional)
+     *     etag: String (Optional)
+     * }
+     * }
+     * 
* - * @param nextLink The URL to get the next list of items. - * @throws IllegalArgumentException thrown if parameters fail the validation. + * @param key The key of the key-value to lock. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of key-value snapshots along with {@link PagedResponse}. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a key-value pair representing application settings along with {@link Response} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PagedResponse getSnapshotsNextNoCustomHeadersSinglePage(String nextLink) { - final String accept = "application/vnd.microsoft.appconfig.snapshotset+json, application/problem+json"; - Response res = service.getSnapshotsNextNoCustomHeadersSync(nextLink, this.getEndpoint(), - this.getSyncToken(), accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getItems(), res.getValue().getNextLink(), null); + public Mono> putLockWithResponseAsync(String key, RequestOptions requestOptions) { + final String accept = "application/vnd.microsoft.appconfig.kv+json, application/problem+json"; + return FluxUtil.withContext(context -> service.putLock(this.getEndpoint(), + this.getServiceVersion().getVersion(), key, accept, requestOptions, context)); } /** - * Gets a list of key-value snapshots. - * - * Get the next page of items. + * Locks a key-value. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
labelStringNoThe label, if any, of the key-value to lock.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Sync-TokenStringNoUsed to guarantee real-time consistency between + * requests.
If-MatchStringNoUsed to perform an operation only if the targeted resource's + * etag matches the + * value provided.
If-None-MatchStringNoUsed to perform an operation only if the targeted + * resource's etag does not + * match the value provided.
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     key: String (Required)
+     *     label: String (Optional)
+     *     content_type: String (Optional)
+     *     value: String (Optional)
+     *     last_modified: OffsetDateTime (Optional)
+     *     tags (Optional): {
+     *         String: String (Required)
+     *     }
+     *     locked: Boolean (Optional)
+     *     etag: String (Optional)
+     * }
+     * }
+     * 
* - * @param nextLink The URL to get the next list of items. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. + * @param key The key of the key-value to lock. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of key-value snapshots along with {@link PagedResponse}. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a key-value pair representing application settings along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PagedResponse getSnapshotsNextNoCustomHeadersSinglePage(String nextLink, - Context context) { - final String accept = "application/vnd.microsoft.appconfig.snapshotset+json, application/problem+json"; - Response res = service.getSnapshotsNextNoCustomHeadersSync(nextLink, this.getEndpoint(), - this.getSyncToken(), accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getItems(), res.getValue().getNextLink(), null); + public Response putLockWithResponse(String key, RequestOptions requestOptions) { + final String accept = "application/vnd.microsoft.appconfig.kv+json, application/problem+json"; + return service.putLockSync(this.getEndpoint(), this.getServiceVersion().getVersion(), key, accept, + requestOptions, Context.NONE); } /** - * Gets a list of labels. - * - * Get the next page of items. + * Unlocks a key-value. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
labelStringNoThe label, if any, of the key-value to unlock.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Sync-TokenStringNoUsed to guarantee real-time consistency between + * requests.
If-MatchStringNoUsed to perform an operation only if the targeted resource's + * etag matches the + * value provided.
If-None-MatchStringNoUsed to perform an operation only if the targeted + * resource's etag does not + * match the value provided.
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     key: String (Required)
+     *     label: String (Optional)
+     *     content_type: String (Optional)
+     *     value: String (Optional)
+     *     last_modified: OffsetDateTime (Optional)
+     *     tags (Optional): {
+     *         String: String (Required)
+     *     }
+     *     locked: Boolean (Optional)
+     *     etag: String (Optional)
+     * }
+     * }
+     * 
* - * @param nextLink The URL to get the next list of items. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @throws IllegalArgumentException thrown if parameters fail the validation. + * @param key The key of the key-value to unlock. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of labels along with {@link PagedResponse} on successful completion of {@link Mono}. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a key-value pair representing application settings along with {@link Response} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getLabelsNextSinglePageAsync(String nextLink, String acceptDatetime) { - final String accept = "application/vnd.microsoft.appconfig.labelset+json, application/problem+json"; - return FluxUtil - .withContext(context -> service.getLabelsNext(nextLink, this.getEndpoint(), this.getSyncToken(), - acceptDatetime, accept, context)) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getItems(), res.getValue().getNextLink(), res.getDeserializedHeaders())); + public Mono> deleteLockWithResponseAsync(String key, RequestOptions requestOptions) { + final String accept = "application/vnd.microsoft.appconfig.kv+json, application/problem+json"; + return FluxUtil.withContext(context -> service.deleteLock(this.getEndpoint(), + this.getServiceVersion().getVersion(), key, accept, requestOptions, context)); } /** - * Gets a list of labels. - * - * Get the next page of items. + * Unlocks a key-value. + *

Query Parameters

+ * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
labelStringNoThe label, if any, of the key-value to unlock.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Sync-TokenStringNoUsed to guarantee real-time consistency between + * requests.
If-MatchStringNoUsed to perform an operation only if the targeted resource's + * etag matches the + * value provided.
If-None-MatchStringNoUsed to perform an operation only if the targeted + * resource's etag does not + * match the value provided.
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     key: String (Required)
+     *     label: String (Optional)
+     *     content_type: String (Optional)
+     *     value: String (Optional)
+     *     last_modified: OffsetDateTime (Optional)
+     *     tags (Optional): {
+     *         String: String (Required)
+     *     }
+     *     locked: Boolean (Optional)
+     *     etag: String (Optional)
+     * }
+     * }
+     * 
* - * @param nextLink The URL to get the next list of items. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. + * @param key The key of the key-value to unlock. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of labels along with {@link PagedResponse} on successful completion of {@link Mono}. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a key-value pair representing application settings along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getLabelsNextSinglePageAsync(String nextLink, String acceptDatetime, - Context context) { - final String accept = "application/vnd.microsoft.appconfig.labelset+json, application/problem+json"; - return service.getLabelsNext(nextLink, this.getEndpoint(), this.getSyncToken(), acceptDatetime, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getItems(), res.getValue().getNextLink(), res.getDeserializedHeaders())); + public Response deleteLockWithResponse(String key, RequestOptions requestOptions) { + final String accept = "application/vnd.microsoft.appconfig.kv+json, application/problem+json"; + return service.deleteLockSync(this.getEndpoint(), this.getServiceVersion().getVersion(), key, accept, + requestOptions, Context.NONE); } /** - * Gets a list of labels. - * - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of labels along with {@link PagedResponse} on successful completion of {@link Mono}. + * Gets a list of key-value revisions. + *

Query Parameters

+ * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
keyStringNoA filter used to match keys. Syntax reference: + * https://aka.ms/azconfig/docs/restapirevisions
labelStringNoA filter used to match labels. Syntax reference: + * https://aka.ms/azconfig/docs/restapirevisions
AfterStringNoInstructs the server to return elements that appear after the + * element referred + * to by the specified token.
$SelectList<String>NoUsed to select what fields are present in the + * returned resource(s). In the form of "," separated string.
tagsList<String>NoA filter used to query by tags. Syntax reference: + * https://aka.ms/azconfig/docs/restapirevisions. Call {@link RequestOptions#addQueryParam} to add string to + * array.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Sync-TokenStringNoUsed to guarantee real-time consistency between + * requests.
Accept-DatetimeStringNoRequests the server to respond with the state of the + * resource at the specified + * time.
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     key: String (Required)
+     *     label: String (Optional)
+     *     content_type: String (Optional)
+     *     value: String (Optional)
+     *     last_modified: OffsetDateTime (Optional)
+     *     tags (Optional): {
+     *         String: String (Required)
+     *     }
+     *     locked: Boolean (Optional)
+     *     etag: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a list of key-value revisions along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getLabelsNextNoCustomHeadersSinglePageAsync(String nextLink, - String acceptDatetime) { - final String accept = "application/vnd.microsoft.appconfig.labelset+json, application/problem+json"; + public Mono> getRevisionsSinglePageAsync(RequestOptions requestOptions) { + final String accept = "application/vnd.microsoft.appconfig.kvset+json, application/problem+json"; return FluxUtil - .withContext(context -> service.getLabelsNextNoCustomHeaders(nextLink, this.getEndpoint(), - this.getSyncToken(), acceptDatetime, accept, context)) + .withContext(context -> service.getRevisions(this.getEndpoint(), this.getServiceVersion().getVersion(), + accept, requestOptions, context)) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getItems(), res.getValue().getNextLink(), null)); + getValues(res.getValue(), "items"), getNextLink(res.getValue(), "@nextLink"), null)); } /** - * Gets a list of labels. - * - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of labels along with {@link PagedResponse} on successful completion of {@link Mono}. + * Gets a list of key-value revisions. + *

Query Parameters

+ * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
keyStringNoA filter used to match keys. Syntax reference: + * https://aka.ms/azconfig/docs/restapirevisions
labelStringNoA filter used to match labels. Syntax reference: + * https://aka.ms/azconfig/docs/restapirevisions
AfterStringNoInstructs the server to return elements that appear after the + * element referred + * to by the specified token.
$SelectList<String>NoUsed to select what fields are present in the + * returned resource(s). In the form of "," separated string.
tagsList<String>NoA filter used to query by tags. Syntax reference: + * https://aka.ms/azconfig/docs/restapirevisions. Call {@link RequestOptions#addQueryParam} to add string to + * array.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Sync-TokenStringNoUsed to guarantee real-time consistency between + * requests.
Accept-DatetimeStringNoRequests the server to respond with the state of the + * resource at the specified + * time.
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     key: String (Required)
+     *     label: String (Optional)
+     *     content_type: String (Optional)
+     *     value: String (Optional)
+     *     last_modified: OffsetDateTime (Optional)
+     *     tags (Optional): {
+     *         String: String (Required)
+     *     }
+     *     locked: Boolean (Optional)
+     *     etag: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a list of key-value revisions as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getLabelsNextNoCustomHeadersSinglePageAsync(String nextLink, - String acceptDatetime, Context context) { - final String accept = "application/vnd.microsoft.appconfig.labelset+json, application/problem+json"; - return service - .getLabelsNextNoCustomHeaders(nextLink, this.getEndpoint(), this.getSyncToken(), acceptDatetime, accept, - context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getItems(), res.getValue().getNextLink(), null)); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux getRevisionsAsync(RequestOptions requestOptions) { + RequestOptions requestOptionsForNextPage = new RequestOptions(); + requestOptionsForNextPage.setContext( + requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); + return new PagedFlux<>(() -> getRevisionsSinglePageAsync(requestOptions), + nextLink -> getRevisionsNextSinglePageAsync(nextLink, requestOptionsForNextPage)); } /** - * Gets a list of labels. - * - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of labels along with {@link PagedResponse}. + * Gets a list of key-value revisions. + *

Query Parameters

+ * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
keyStringNoA filter used to match keys. Syntax reference: + * https://aka.ms/azconfig/docs/restapirevisions
labelStringNoA filter used to match labels. Syntax reference: + * https://aka.ms/azconfig/docs/restapirevisions
AfterStringNoInstructs the server to return elements that appear after the + * element referred + * to by the specified token.
$SelectList<String>NoUsed to select what fields are present in the + * returned resource(s). In the form of "," separated string.
tagsList<String>NoA filter used to query by tags. Syntax reference: + * https://aka.ms/azconfig/docs/restapirevisions. Call {@link RequestOptions#addQueryParam} to add string to + * array.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Sync-TokenStringNoUsed to guarantee real-time consistency between + * requests.
Accept-DatetimeStringNoRequests the server to respond with the state of the + * resource at the specified + * time.
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     key: String (Required)
+     *     label: String (Optional)
+     *     content_type: String (Optional)
+     *     value: String (Optional)
+     *     last_modified: OffsetDateTime (Optional)
+     *     tags (Optional): {
+     *         String: String (Required)
+     *     }
+     *     locked: Boolean (Optional)
+     *     etag: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a list of key-value revisions along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PagedResponse getLabelsNextSinglePage(String nextLink, String acceptDatetime) { - final String accept = "application/vnd.microsoft.appconfig.labelset+json, application/problem+json"; - ResponseBase res = service.getLabelsNextSync(nextLink, - this.getEndpoint(), this.getSyncToken(), acceptDatetime, accept, Context.NONE); + public PagedResponse getRevisionsSinglePage(RequestOptions requestOptions) { + final String accept = "application/vnd.microsoft.appconfig.kvset+json, application/problem+json"; + Response res = service.getRevisionsSync(this.getEndpoint(), this.getServiceVersion().getVersion(), + accept, requestOptions, Context.NONE); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getItems(), res.getValue().getNextLink(), res.getDeserializedHeaders()); + getValues(res.getValue(), "items"), getNextLink(res.getValue(), "@nextLink"), null); } /** - * Gets a list of labels. - * - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of labels along with {@link PagedResponse}. + * Gets a list of key-value revisions. + *

Query Parameters

+ * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
keyStringNoA filter used to match keys. Syntax reference: + * https://aka.ms/azconfig/docs/restapirevisions
labelStringNoA filter used to match labels. Syntax reference: + * https://aka.ms/azconfig/docs/restapirevisions
AfterStringNoInstructs the server to return elements that appear after the + * element referred + * to by the specified token.
$SelectList<String>NoUsed to select what fields are present in the + * returned resource(s). In the form of "," separated string.
tagsList<String>NoA filter used to query by tags. Syntax reference: + * https://aka.ms/azconfig/docs/restapirevisions. Call {@link RequestOptions#addQueryParam} to add string to + * array.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Sync-TokenStringNoUsed to guarantee real-time consistency between + * requests.
Accept-DatetimeStringNoRequests the server to respond with the state of the + * resource at the specified + * time.
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     key: String (Required)
+     *     label: String (Optional)
+     *     content_type: String (Optional)
+     *     value: String (Optional)
+     *     last_modified: OffsetDateTime (Optional)
+     *     tags (Optional): {
+     *         String: String (Required)
+     *     }
+     *     locked: Boolean (Optional)
+     *     etag: String (Optional)
+     * }
+     * }
+     * 
+ * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a list of key-value revisions as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable getRevisions(RequestOptions requestOptions) { + RequestOptions requestOptionsForNextPage = new RequestOptions(); + requestOptionsForNextPage.setContext( + requestOptions != null && requestOptions.getContext() != null ? requestOptions.getContext() : Context.NONE); + return new PagedIterable<>(() -> getRevisionsSinglePage(requestOptions), + nextLink -> getRevisionsNextSinglePage(nextLink, requestOptionsForNextPage)); + } + + /** + * Requests the headers and status of the given resource. + *

Query Parameters

+ * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
keyStringNoA filter used to match keys. Syntax reference: + * https://aka.ms/azconfig/docs/restapirevisions
labelStringNoA filter used to match labels. Syntax reference: + * https://aka.ms/azconfig/docs/restapirevisions
AfterStringNoInstructs the server to return elements that appear after the + * element referred + * to by the specified token.
$SelectList<String>NoUsed to select what fields are present in the + * returned resource(s). In the form of "," separated string.
tagsList<String>NoA filter used to query by tags. Syntax reference: + * https://aka.ms/azconfig/docs/restapirevisions. Call {@link RequestOptions#addQueryParam} to add string to + * array.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Sync-TokenStringNoUsed to guarantee real-time consistency between + * requests.
Accept-DatetimeStringNoRequests the server to respond with the state of the + * resource at the specified + * time.
+ * You can add these to a request with {@link RequestOptions#addHeader} + * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PagedResponse getLabelsNextSinglePage(String nextLink, String acceptDatetime, - Context context) { - final String accept = "application/vnd.microsoft.appconfig.labelset+json, application/problem+json"; - ResponseBase res = service.getLabelsNextSync(nextLink, - this.getEndpoint(), this.getSyncToken(), acceptDatetime, accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getItems(), res.getValue().getNextLink(), res.getDeserializedHeaders()); + public Mono> checkRevisionsWithResponseAsync(RequestOptions requestOptions) { + return FluxUtil.withContext(context -> service.checkRevisions(this.getEndpoint(), + this.getServiceVersion().getVersion(), requestOptions, context)); } /** - * Gets a list of labels. + * Requests the headers and status of the given resource. + *

Query Parameters

+ * + * + * + * + * + * + * + * + *
Query Parameters
NameTypeRequiredDescription
keyStringNoA filter used to match keys. Syntax reference: + * https://aka.ms/azconfig/docs/restapirevisions
labelStringNoA filter used to match labels. Syntax reference: + * https://aka.ms/azconfig/docs/restapirevisions
AfterStringNoInstructs the server to return elements that appear after the + * element referred + * to by the specified token.
$SelectList<String>NoUsed to select what fields are present in the + * returned resource(s). In the form of "," separated string.
tagsList<String>NoA filter used to query by tags. Syntax reference: + * https://aka.ms/azconfig/docs/restapirevisions. Call {@link RequestOptions#addQueryParam} to add string to + * array.
+ * You can add these to a request with {@link RequestOptions#addQueryParam} + *

Header Parameters

+ * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Sync-TokenStringNoUsed to guarantee real-time consistency between + * requests.
Accept-DatetimeStringNoRequests the server to respond with the state of the + * resource at the specified + * time.
+ * You can add these to a request with {@link RequestOptions#addHeader} + * + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response checkRevisionsWithResponse(RequestOptions requestOptions) { + return service.checkRevisionsSync(this.getEndpoint(), this.getServiceVersion().getVersion(), requestOptions, + Context.NONE); + } + + /** + * Gets a list of keys. * * Get the next page of items. + *

Header Parameters

+ * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Sync-TokenStringNoUsed to guarantee real-time consistency between + * requests.
Accept-DatetimeStringNoRequests the server to respond with the state of the + * resource at the specified + * time.
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     name: String (Required)
+     * }
+     * }
+     * 
* * @param nextLink The URL to get the next list of items. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @throws IllegalArgumentException thrown if parameters fail the validation. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of labels along with {@link PagedResponse}. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a list of keys along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PagedResponse getLabelsNextNoCustomHeadersSinglePage(String nextLink, String acceptDatetime) { - final String accept = "application/vnd.microsoft.appconfig.labelset+json, application/problem+json"; - Response res = service.getLabelsNextNoCustomHeadersSync(nextLink, this.getEndpoint(), - this.getSyncToken(), acceptDatetime, accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getItems(), res.getValue().getNextLink(), null); + public Mono> getKeysNextSinglePageAsync(String nextLink, RequestOptions requestOptions) { + final String accept = "application/vnd.microsoft.appconfig.keyset+json, application/problem+json"; + return FluxUtil + .withContext(context -> service.getKeysNext(nextLink, this.getEndpoint(), accept, requestOptions, context)) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "items"), getNextLink(res.getValue(), "@nextLink"), null)); } /** - * Gets a list of labels. + * Gets a list of keys. * * Get the next page of items. + *

Header Parameters

+ * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Sync-TokenStringNoUsed to guarantee real-time consistency between + * requests.
Accept-DatetimeStringNoRequests the server to respond with the state of the + * resource at the specified + * time.
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     name: String (Required)
+     * }
+     * }
+     * 
* * @param nextLink The URL to get the next list of items. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of labels along with {@link PagedResponse}. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a list of keys along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PagedResponse getLabelsNextNoCustomHeadersSinglePage(String nextLink, String acceptDatetime, - Context context) { - final String accept = "application/vnd.microsoft.appconfig.labelset+json, application/problem+json"; - Response res = service.getLabelsNextNoCustomHeadersSync(nextLink, this.getEndpoint(), - this.getSyncToken(), acceptDatetime, accept, context); + public PagedResponse getKeysNextSinglePage(String nextLink, RequestOptions requestOptions) { + final String accept = "application/vnd.microsoft.appconfig.keyset+json, application/problem+json"; + Response res + = service.getKeysNextSync(nextLink, this.getEndpoint(), accept, requestOptions, Context.NONE); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getItems(), res.getValue().getNextLink(), null); + getValues(res.getValue(), "items"), getNextLink(res.getValue(), "@nextLink"), null); } /** - * Gets a list of key-value revisions. + * Gets a list of key-values. * * Get the next page of items. + *

Header Parameters

+ * + * + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Sync-TokenStringNoUsed to guarantee real-time consistency between + * requests.
Accept-DatetimeStringNoRequests the server to respond with the state of the + * resource at the specified + * time.
If-MatchStringNoUsed to perform an operation only if the targeted resource's + * etag matches the + * value provided.
If-None-MatchStringNoUsed to perform an operation only if the targeted + * resource's etag does not + * match the value provided.
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     key: String (Required)
+     *     label: String (Optional)
+     *     content_type: String (Optional)
+     *     value: String (Optional)
+     *     last_modified: OffsetDateTime (Optional)
+     *     tags (Optional): {
+     *         String: String (Required)
+     *     }
+     *     locked: Boolean (Optional)
+     *     etag: String (Optional)
+     * }
+     * }
+     * 
* * @param nextLink The URL to get the next list of items. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @throws IllegalArgumentException thrown if parameters fail the validation. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of key-value revisions along with {@link PagedResponse} on successful completion of {@link Mono}. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a list of key-values along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getRevisionsNextSinglePageAsync(String nextLink, String acceptDatetime) { + public Mono> listConfigurationSettingsNextSinglePageAsync(String nextLink, + RequestOptions requestOptions) { final String accept = "application/vnd.microsoft.appconfig.kvset+json, application/problem+json"; return FluxUtil - .withContext(context -> service.getRevisionsNext(nextLink, this.getEndpoint(), this.getSyncToken(), - acceptDatetime, accept, context)) + .withContext(context -> service.listConfigurationSettingsNext(nextLink, this.getEndpoint(), accept, + requestOptions, context)) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getItems(), res.getValue().getNextLink(), res.getDeserializedHeaders())); + getValues(res.getValue(), "items"), getNextLink(res.getValue(), "@nextLink"), null)); } /** - * Gets a list of key-value revisions. + * Gets a list of key-values. * * Get the next page of items. + *

Header Parameters

+ * + * + * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Sync-TokenStringNoUsed to guarantee real-time consistency between + * requests.
Accept-DatetimeStringNoRequests the server to respond with the state of the + * resource at the specified + * time.
If-MatchStringNoUsed to perform an operation only if the targeted resource's + * etag matches the + * value provided.
If-None-MatchStringNoUsed to perform an operation only if the targeted + * resource's etag does not + * match the value provided.
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     key: String (Required)
+     *     label: String (Optional)
+     *     content_type: String (Optional)
+     *     value: String (Optional)
+     *     last_modified: OffsetDateTime (Optional)
+     *     tags (Optional): {
+     *         String: String (Required)
+     *     }
+     *     locked: Boolean (Optional)
+     *     etag: String (Optional)
+     * }
+     * }
+     * 
* * @param nextLink The URL to get the next list of items. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of key-value revisions along with {@link PagedResponse} on successful completion of {@link Mono}. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a list of key-values along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getRevisionsNextSinglePageAsync(String nextLink, String acceptDatetime, - Context context) { + public PagedResponse listConfigurationSettingsNextSinglePage(String nextLink, + RequestOptions requestOptions) { final String accept = "application/vnd.microsoft.appconfig.kvset+json, application/problem+json"; - return service - .getRevisionsNext(nextLink, this.getEndpoint(), this.getSyncToken(), acceptDatetime, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getItems(), res.getValue().getNextLink(), res.getDeserializedHeaders())); + Response res = service.listConfigurationSettingsNextSync(nextLink, this.getEndpoint(), accept, + requestOptions, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "items"), getNextLink(res.getValue(), "@nextLink"), null); } /** - * Gets a list of key-value revisions. + * Gets a list of key-value snapshots. * * Get the next page of items. + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Sync-TokenStringNoUsed to guarantee real-time consistency between + * requests.
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     name: String (Required)
+     *     status: String(provisioning/ready/archived/failed) (Optional)
+     *     filters (Required): [
+     *          (Required){
+     *             key: String (Required)
+     *             label: String (Optional)
+     *             tags (Optional): [
+     *                 String (Optional)
+     *             ]
+     *         }
+     *     ]
+     *     composition_type: String(key/key_label) (Optional)
+     *     created: OffsetDateTime (Optional)
+     *     expires: OffsetDateTime (Optional)
+     *     retention_period: Long (Optional)
+     *     size: Long (Optional)
+     *     items_count: Long (Optional)
+     *     tags (Optional): {
+     *         String: String (Required)
+     *     }
+     *     etag: String (Optional)
+     * }
+     * }
+     * 
* * @param nextLink The URL to get the next list of items. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @throws IllegalArgumentException thrown if parameters fail the validation. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of key-value revisions along with {@link PagedResponse} on successful completion of {@link Mono}. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a list of key-value snapshots along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getRevisionsNextNoCustomHeadersSinglePageAsync(String nextLink, - String acceptDatetime) { - final String accept = "application/vnd.microsoft.appconfig.kvset+json, application/problem+json"; + public Mono> getSnapshotsNextSinglePageAsync(String nextLink, + RequestOptions requestOptions) { + final String accept = "application/vnd.microsoft.appconfig.snapshotset+json, application/problem+json"; return FluxUtil - .withContext(context -> service.getRevisionsNextNoCustomHeaders(nextLink, this.getEndpoint(), - this.getSyncToken(), acceptDatetime, accept, context)) + .withContext( + context -> service.getSnapshotsNext(nextLink, this.getEndpoint(), accept, requestOptions, context)) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getItems(), res.getValue().getNextLink(), null)); + getValues(res.getValue(), "items"), getNextLink(res.getValue(), "@nextLink"), null)); } /** - * Gets a list of key-value revisions. + * Gets a list of key-value snapshots. * * Get the next page of items. + *

Header Parameters

+ * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Sync-TokenStringNoUsed to guarantee real-time consistency between + * requests.
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     name: String (Required)
+     *     status: String(provisioning/ready/archived/failed) (Optional)
+     *     filters (Required): [
+     *          (Required){
+     *             key: String (Required)
+     *             label: String (Optional)
+     *             tags (Optional): [
+     *                 String (Optional)
+     *             ]
+     *         }
+     *     ]
+     *     composition_type: String(key/key_label) (Optional)
+     *     created: OffsetDateTime (Optional)
+     *     expires: OffsetDateTime (Optional)
+     *     retention_period: Long (Optional)
+     *     size: Long (Optional)
+     *     items_count: Long (Optional)
+     *     tags (Optional): {
+     *         String: String (Required)
+     *     }
+     *     etag: String (Optional)
+     * }
+     * }
+     * 
* * @param nextLink The URL to get the next list of items. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of key-value revisions along with {@link PagedResponse} on successful completion of {@link Mono}. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a list of key-value snapshots along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getRevisionsNextNoCustomHeadersSinglePageAsync(String nextLink, - String acceptDatetime, Context context) { - final String accept = "application/vnd.microsoft.appconfig.kvset+json, application/problem+json"; - return service - .getRevisionsNextNoCustomHeaders(nextLink, this.getEndpoint(), this.getSyncToken(), acceptDatetime, accept, - context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getItems(), res.getValue().getNextLink(), null)); + public PagedResponse getSnapshotsNextSinglePage(String nextLink, RequestOptions requestOptions) { + final String accept = "application/vnd.microsoft.appconfig.snapshotset+json, application/problem+json"; + Response res + = service.getSnapshotsNextSync(nextLink, this.getEndpoint(), accept, requestOptions, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "items"), getNextLink(res.getValue(), "@nextLink"), null); } /** - * Gets a list of key-value revisions. + * Gets a list of labels. * * Get the next page of items. + *

Header Parameters

+ * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Sync-TokenStringNoUsed to guarantee real-time consistency between + * requests.
Accept-DatetimeStringNoRequests the server to respond with the state of the + * resource at the specified + * time.
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     name: String (Optional)
+     * }
+     * }
+     * 
* * @param nextLink The URL to get the next list of items. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @throws IllegalArgumentException thrown if parameters fail the validation. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of key-value revisions along with {@link PagedResponse}. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a list of labels along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PagedResponse getRevisionsNextSinglePage(String nextLink, String acceptDatetime) { - final String accept = "application/vnd.microsoft.appconfig.kvset+json, application/problem+json"; - ResponseBase res = service.getRevisionsNextSync(nextLink, - this.getEndpoint(), this.getSyncToken(), acceptDatetime, accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getItems(), res.getValue().getNextLink(), res.getDeserializedHeaders()); + public Mono> getLabelsNextSinglePageAsync(String nextLink, + RequestOptions requestOptions) { + final String accept = "application/vnd.microsoft.appconfig.labelset+json, application/problem+json"; + return FluxUtil + .withContext( + context -> service.getLabelsNext(nextLink, this.getEndpoint(), accept, requestOptions, context)) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "items"), getNextLink(res.getValue(), "@nextLink"), null)); } /** - * Gets a list of key-value revisions. + * Gets a list of labels. * * Get the next page of items. + *

Header Parameters

+ * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Sync-TokenStringNoUsed to guarantee real-time consistency between + * requests.
Accept-DatetimeStringNoRequests the server to respond with the state of the + * resource at the specified + * time.
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     name: String (Optional)
+     * }
+     * }
+     * 
* * @param nextLink The URL to get the next list of items. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of key-value revisions along with {@link PagedResponse}. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a list of labels along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PagedResponse getRevisionsNextSinglePage(String nextLink, String acceptDatetime, Context context) { - final String accept = "application/vnd.microsoft.appconfig.kvset+json, application/problem+json"; - ResponseBase res = service.getRevisionsNextSync(nextLink, - this.getEndpoint(), this.getSyncToken(), acceptDatetime, accept, context); + public PagedResponse getLabelsNextSinglePage(String nextLink, RequestOptions requestOptions) { + final String accept = "application/vnd.microsoft.appconfig.labelset+json, application/problem+json"; + Response res + = service.getLabelsNextSync(nextLink, this.getEndpoint(), accept, requestOptions, Context.NONE); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getItems(), res.getValue().getNextLink(), res.getDeserializedHeaders()); + getValues(res.getValue(), "items"), getNextLink(res.getValue(), "@nextLink"), null); } /** * Gets a list of key-value revisions. * * Get the next page of items. + *

Header Parameters

+ * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Sync-TokenStringNoUsed to guarantee real-time consistency between + * requests.
Accept-DatetimeStringNoRequests the server to respond with the state of the + * resource at the specified + * time.
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     key: String (Required)
+     *     label: String (Optional)
+     *     content_type: String (Optional)
+     *     value: String (Optional)
+     *     last_modified: OffsetDateTime (Optional)
+     *     tags (Optional): {
+     *         String: String (Required)
+     *     }
+     *     locked: Boolean (Optional)
+     *     etag: String (Optional)
+     * }
+     * }
+     * 
* * @param nextLink The URL to get the next list of items. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @throws IllegalArgumentException thrown if parameters fail the validation. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of key-value revisions along with {@link PagedResponse}. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return a list of key-value revisions along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PagedResponse getRevisionsNextNoCustomHeadersSinglePage(String nextLink, String acceptDatetime) { + public Mono> getRevisionsNextSinglePageAsync(String nextLink, + RequestOptions requestOptions) { final String accept = "application/vnd.microsoft.appconfig.kvset+json, application/problem+json"; - Response res = service.getRevisionsNextNoCustomHeadersSync(nextLink, this.getEndpoint(), - this.getSyncToken(), acceptDatetime, accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getItems(), res.getValue().getNextLink(), null); + return FluxUtil + .withContext( + context -> service.getRevisionsNext(nextLink, this.getEndpoint(), accept, requestOptions, context)) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + getValues(res.getValue(), "items"), getNextLink(res.getValue(), "@nextLink"), null)); } /** * Gets a list of key-value revisions. * * Get the next page of items. + *

Header Parameters

+ * + * + * + * + * + *
Header Parameters
NameTypeRequiredDescription
Sync-TokenStringNoUsed to guarantee real-time consistency between + * requests.
Accept-DatetimeStringNoRequests the server to respond with the state of the + * resource at the specified + * time.
+ * You can add these to a request with {@link RequestOptions#addHeader} + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     key: String (Required)
+     *     label: String (Optional)
+     *     content_type: String (Optional)
+     *     value: String (Optional)
+     *     last_modified: OffsetDateTime (Optional)
+     *     tags (Optional): {
+     *         String: String (Required)
+     *     }
+     *     locked: Boolean (Optional)
+     *     etag: String (Optional)
+     * }
+     * }
+     * 
* * @param nextLink The URL to get the next list of items. - * @param acceptDatetime Requests the server to respond with the state of the resource at the specified time. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. * @throws HttpResponseException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. * @return a list of key-value revisions along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PagedResponse getRevisionsNextNoCustomHeadersSinglePage(String nextLink, String acceptDatetime, - Context context) { + public PagedResponse getRevisionsNextSinglePage(String nextLink, RequestOptions requestOptions) { final String accept = "application/vnd.microsoft.appconfig.kvset+json, application/problem+json"; - Response res = service.getRevisionsNextNoCustomHeadersSync(nextLink, this.getEndpoint(), - this.getSyncToken(), acceptDatetime, accept, context); + Response res + = service.getRevisionsNextSync(nextLink, this.getEndpoint(), accept, requestOptions, Context.NONE); return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().getItems(), res.getValue().getNextLink(), null); + getValues(res.getValue(), "items"), getNextLink(res.getValue(), "@nextLink"), null); + } + + private List getValues(BinaryData binaryData, String path) { + try { + Map obj = binaryData.toObject(Map.class); + List values = (List) obj.get(path); + return values.stream().map(BinaryData::fromObject).collect(Collectors.toList()); + } catch (RuntimeException e) { + return null; + } + } + + private String getNextLink(BinaryData binaryData, String path) { + try { + Map obj = binaryData.toObject(Map.class); + return (String) obj.get(path); + } catch (RuntimeException e) { + return null; + } } } diff --git a/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/ConfigurationSettingDeserializationHelper.java b/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/ConfigurationSettingDeserializationHelper.java index a64ca2f7542c..bb4803f498e2 100644 --- a/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/ConfigurationSettingDeserializationHelper.java +++ b/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/ConfigurationSettingDeserializationHelper.java @@ -105,8 +105,9 @@ public static ConfigurationSetting toConfigurationSetting(KeyValue keyValue) { } catch (Exception exception) { throw LOGGER.logExceptionAsError( new RuntimeException("The setting is neither a 'FeatureFlagConfigurationSetting' nor " - + "'SecretReferenceConfigurationSetting', return the setting as 'ConfigurationSetting'. " - + "Error: ", exception)); + + "'SecretReferenceConfigurationSetting', return the setting as 'ConfigurationSetting'. " + "Key: '" + + setting.getKey() + "', contentType: '" + contentType + "', value: '" + value + "'. Error: " + + exception.getClass().getName() + ": " + exception.getMessage(), exception)); } } diff --git a/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/ConfigurationSettingSerializationHelper.java b/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/ConfigurationSettingSerializationHelper.java deleted file mode 100644 index 289948939e6f..000000000000 --- a/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/ConfigurationSettingSerializationHelper.java +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.data.appconfiguration.implementation; - -import com.azure.data.appconfiguration.models.FeatureFlagConfigurationSetting; -import com.azure.data.appconfiguration.models.SecretReferenceConfigurationSetting; -import com.azure.json.JsonProviders; -import com.azure.json.JsonWriter; - -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.nio.charset.StandardCharsets; - -import static com.azure.data.appconfiguration.implementation.Utility.CLIENT_FILTERS; -import static com.azure.data.appconfiguration.implementation.Utility.CONDITIONS; -import static com.azure.data.appconfiguration.implementation.Utility.DESCRIPTION; -import static com.azure.data.appconfiguration.implementation.Utility.DISPLAY_NAME; -import static com.azure.data.appconfiguration.implementation.Utility.ENABLED; -import static com.azure.data.appconfiguration.implementation.Utility.ID; -import static com.azure.data.appconfiguration.implementation.Utility.NAME; -import static com.azure.data.appconfiguration.implementation.Utility.PARAMETERS; -import static com.azure.data.appconfiguration.implementation.Utility.URI; - -/** - * Configuration setting serialization. - */ -public final class ConfigurationSettingSerializationHelper { - /** - * Serialize the strongly-type property, {@code secretId} of {@link SecretReferenceConfigurationSetting} into a JSON - * format string, which is the {@code value} of {@link SecretReferenceConfigurationSetting}. - * - * @param setting the {@link SecretReferenceConfigurationSetting}. - * @return a JSON format string that represents the {@code value} of {@link SecretReferenceConfigurationSetting}. - * @throws IOException if {@link JsonWriter} can not be created. - */ - public static String writeSecretReferenceConfigurationSetting(SecretReferenceConfigurationSetting setting) - throws IOException { - // The setting's value is expected to be a JSON string for the SecretReferenceConfigurationSetting, - // so it is better to use another JSON generator to constructor the value as JSON string, flush into the - // StringWriter. - try (ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); - JsonWriter jsonWriter = JsonProviders.createWriter(outputStream)) { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField(URI, setting.getSecretId()); - jsonWriter.writeEndObject(); - jsonWriter.flush(); - - return outputStream.toString(StandardCharsets.UTF_8.name()); - } - } - - /** - * Serialize the strong-type properties, such as {@code featureId} of {@link FeatureFlagConfigurationSetting} into a - * JSON format string, which is the {@code value} of {@link FeatureFlagConfigurationSetting}. - * - * @param setting the {@link FeatureFlagConfigurationSetting}. - * @return a JSON format string that represents the {@code value} of {@link FeatureFlagConfigurationSetting}. - * @throws IOException if {@link JsonWriter} can not be created. - */ - public static String writeFeatureFlagConfigurationSetting(FeatureFlagConfigurationSetting setting) - throws IOException { - // The setting's value is expected to be a JSON string for the FeatureFlagConfigurationSetting, - // so it is better to use another JSON generator to constructor the value as JSON string, flush into the - // StringWriter. - try (ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); - JsonWriter jsonWriter = JsonProviders.createWriter(outputStream)) { - jsonWriter.writeStartObject(); - - jsonWriter.writeStringField(ID, setting.getFeatureId()); - jsonWriter.writeStringField(DESCRIPTION, setting.getDescription()); - jsonWriter.writeStringField(DISPLAY_NAME, setting.getDisplayName()); - jsonWriter.writeBooleanField(ENABLED, setting.isEnabled()); - - jsonWriter.writeStartObject(CONDITIONS); - jsonWriter.writeArrayField(CLIENT_FILTERS, setting.getClientFilters(), (writer, filter) -> { - writer.writeStartObject(); - writer.writeStringField(NAME, filter.getName()); - writer.writeMapField(PARAMETERS, filter.getParameters(), JsonWriter::writeUntyped); - writer.writeEndObject(); // each filter object - }); - - jsonWriter.writeEndObject(); - - jsonWriter.writeEndObject(); - jsonWriter.flush(); - - return outputStream.toString(StandardCharsets.UTF_8.name()); - } - } -} diff --git a/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/CreateSnapshotUtilClient.java b/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/CreateSnapshotUtilClient.java index 73ab71191ada..7abeccc85598 100644 --- a/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/CreateSnapshotUtilClient.java +++ b/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/CreateSnapshotUtilClient.java @@ -3,8 +3,9 @@ package com.azure.data.appconfiguration.implementation; +import com.azure.core.http.HttpHeaderName; +import com.azure.core.http.rest.RequestOptions; import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.ResponseBase; import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.logging.ClientLogger; @@ -14,9 +15,6 @@ import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.PollingContext; import com.azure.core.util.polling.SyncPoller; -import com.azure.data.appconfiguration.implementation.models.CreateSnapshotHeaders; -import com.azure.data.appconfiguration.implementation.models.OperationDetails; -import com.azure.data.appconfiguration.implementation.models.State; import com.azure.data.appconfiguration.models.ConfigurationSnapshot; import reactor.core.publisher.Mono; @@ -26,17 +24,24 @@ import java.util.function.Function; import static com.azure.core.util.FluxUtil.monoError; -import static com.azure.data.appconfiguration.implementation.models.State.NOT_STARTED; -import static com.azure.data.appconfiguration.implementation.models.State.RUNNING; -import static com.azure.data.appconfiguration.implementation.models.State.SUCCEEDED; /** * A helper util client for creating a snapshot. + * + *

Mirrors the original polling shape on top of the new protocol-style + * {@link AzureAppConfigurationImpl#createSnapshotWithResponse} / {@code Async} + + * {@link AzureAppConfigurationImpl#getOperationDetailsWithResponse} / {@code Async} (BinaryData) methods.

*/ public class CreateSnapshotUtilClient { private static final ClientLogger LOGGER = new ClientLogger(CreateSnapshotUtilClient.class); private static final Duration DEFAULT_POLL_INTERVAL = Duration.ofSeconds(30); + private static final String CREATE_SNAPSHOT_CONTENT_TYPE = "application/vnd.microsoft.appconfig.snapshot+json"; + private static final HttpHeaderName OPERATION_LOCATION = HttpHeaderName.fromString("Operation-Location"); + private static final String NOT_STARTED = "NotStarted"; + private static final String RUNNING = "Running"; + private static final String SUCCEEDED = "Succeeded"; + private final AzureAppConfigurationImpl service; public CreateSnapshotUtilClient(AzureAppConfigurationImpl service) { @@ -46,17 +51,15 @@ public CreateSnapshotUtilClient(AzureAppConfigurationImpl service) { public PollerFlux beginCreateSnapshot(String name, ConfigurationSnapshot snapshot) { try { - return new PollerFlux<>(DEFAULT_POLL_INTERVAL, activationOperation( - service.createSnapshotWithResponseAsync(name, snapshot, Context.NONE).map(response -> { - final Map pollResponse = new HashMap<>(); - pollResponse.put("id", response.getDeserializedHeaders().getOperationLocation()); - return BinaryData.fromObject(pollResponse).toObject(PollOperationDetails.class); - })), pollingOperation(operationId -> service.getOperationDetailsWithResponseAsync(name, Context.NONE)), - (pollingContext, activationResponse) -> Mono - .error(new RuntimeException("Cancellation is not supported.")), - fetchingOperation( - operationId -> service.getSnapshotWithResponseAsync(name, null, null, null, Context.NONE) - .flatMap(res -> Mono.justOrEmpty(res.getValue())))); + final BinaryData body = BinaryData.fromObject(snapshot); + return new PollerFlux<>(DEFAULT_POLL_INTERVAL, + activationOperationAsync(service + .createSnapshotWithResponseAsync(CREATE_SNAPSHOT_CONTENT_TYPE, name, body, new RequestOptions()) + .map(response -> toPollOperationDetails(response.getHeaders().getValue(OPERATION_LOCATION)))), + pollingOperationAsync(opId -> service.getOperationDetailsWithResponseAsync(name, new RequestOptions())), + (ctx, activationResponse) -> Mono.error(new RuntimeException("Cancellation is not supported.")), + fetchingOperationAsync(opId -> service.getSnapshotWithResponseAsync(name, new RequestOptions()) + .flatMap(res -> Mono.justOrEmpty(deserializeSnapshot(res.getValue()))))); } catch (Exception e) { return PollerFlux.error(e); } @@ -65,26 +68,25 @@ public PollerFlux beginCreateSnapsh public SyncPoller beginCreateSnapshot(String name, ConfigurationSnapshot snapshot, Context context) { try { - final Context finalContext = getNotNullContext(context); + final Context finalContext = context == null ? Context.NONE : context; return SyncPoller.createPoller(DEFAULT_POLL_INTERVAL, - cxt -> new PollResponse<>(LongRunningOperationStatus.NOT_STARTED, - activationOperationSync(name, snapshot, finalContext).apply(cxt)), - pollingOperationSync(operationId -> service.getOperationDetailsWithResponse(name, finalContext)), - (pollingContext, activationResponse) -> { + ctx -> new PollResponse<>(LongRunningOperationStatus.NOT_STARTED, + activationOperationSync(name, snapshot, finalContext).apply(ctx)), + pollingOperationSync(opId -> service.getOperationDetailsWithResponse(name, withContext(finalContext))), + (ctx, activationResponse) -> { throw LOGGER.logExceptionAsError(new RuntimeException("Cancellation is not supported.")); - }, fetchingOperationSync( - operationId -> service.getSnapshotWithResponse(name, null, null, null, finalContext).getValue())); + }, fetchingOperationSync(opId -> deserializeSnapshot( + service.getSnapshotWithResponse(name, withContext(finalContext)).getValue()))); } catch (Exception e) { throw LOGGER.logExceptionAsError(new RuntimeException(e)); } } - // Activation operation private Function, Mono> - activationOperation(Mono operationResult) { - return pollingContext -> { + activationOperationAsync(Mono activationResult) { + return ctx -> { try { - return operationResult; + return activationResult; } catch (RuntimeException ex) { return monoError(LOGGER, ex); } @@ -93,29 +95,25 @@ public SyncPoller beginCreateSnapsh private Function, PollOperationDetails> activationOperationSync(String name, ConfigurationSnapshot snapshot, Context context) { - return pollingContext -> { + return ctx -> { try { - final Context finalContext = getNotNullContext(context); - final ResponseBase snapshotWithResponse - = service.createSnapshotWithResponse(name, snapshot, finalContext); - final Map pollResponse = new HashMap<>(); - pollResponse.put("id", snapshotWithResponse.getDeserializedHeaders().getOperationLocation()); - return BinaryData.fromObject(pollResponse).toObject(PollOperationDetails.class); + final BinaryData body = BinaryData.fromObject(snapshot); + Response response = service.createSnapshotWithResponse(CREATE_SNAPSHOT_CONTENT_TYPE, name, + body, withContext(context)); + return toPollOperationDetails(response.getHeaders().getValue(OPERATION_LOCATION)); } catch (RuntimeException ex) { throw LOGGER.logExceptionAsError(ex); } }; } - // Polling operation private Function, Mono>> - pollingOperation(Function>> pollingFunction) { - return pollingContext -> { + pollingOperationAsync(Function>> pollingFunction) { + return ctx -> { try { - final PollResponse pollResponse = pollingContext.getLatestResponse(); - final String operationId = pollResponse.getValue().getOperationId(); - return pollingFunction.apply(operationId) - .flatMap(modelResponse -> Mono.just(processResponse(modelResponse, pollResponse))); + final PollResponse last = ctx.getLatestResponse(); + String opId = last.getValue() == null ? null : last.getValue().getOperationId(); + return pollingFunction.apply(opId).map(response -> processOperationDetails(response, last)); } catch (RuntimeException ex) { return monoError(LOGGER, ex); } @@ -123,24 +121,26 @@ private Function, PollOperationDetails> act } private Function, PollResponse> - pollingOperationSync(Function> pollingFunction) { - return pollingContext -> { + pollingOperationSync(Function> pollingFunction) { + return ctx -> { try { - final PollResponse pollResponse = pollingContext.getLatestResponse(); - return processResponse(pollingFunction.apply(pollResponse.getValue().getOperationId()), pollResponse); + final PollResponse last = ctx.getLatestResponse(); + String opId = last.getValue() == null ? null : last.getValue().getOperationId(); + return processOperationDetails(pollingFunction.apply(opId), last); } catch (RuntimeException ex) { throw LOGGER.logExceptionAsError(ex); } }; } - // Fetching operation private Function, Mono> - fetchingOperation(Function> fetchingFunction) { - return pollingContext -> { + fetchingOperationAsync(Function> fetchingFunction) { + return ctx -> { try { - String operationId = pollingContext.getLatestResponse().getValue().getOperationId(); - return fetchingFunction.apply(operationId); + String opId = ctx.getLatestResponse().getValue() == null + ? null + : ctx.getLatestResponse().getValue().getOperationId(); + return fetchingFunction.apply(opId); } catch (RuntimeException ex) { return monoError(LOGGER, ex); } @@ -149,39 +149,59 @@ private Function, PollOperationDetails> act private Function, ConfigurationSnapshot> fetchingOperationSync(Function fetchingFunction) { - return pollingContext -> { + return ctx -> { try { - String operationId = pollingContext.getLatestResponse().getValue().getOperationId(); - return fetchingFunction.apply(operationId); + String opId = ctx.getLatestResponse().getValue() == null + ? null + : ctx.getLatestResponse().getValue().getOperationId(); + return fetchingFunction.apply(opId); } catch (RuntimeException ex) { throw LOGGER.logExceptionAsError(ex); } }; } - private PollResponse processResponse(Response response, - PollResponse operationResultPollResponse) { - LongRunningOperationStatus status; - State state = response.getValue().getStatus(); - if (NOT_STARTED.equals(state) || RUNNING.equals(state)) { - status = LongRunningOperationStatus.IN_PROGRESS; - } else if (SUCCEEDED.equals(state)) { - status = LongRunningOperationStatus.SUCCESSFULLY_COMPLETED; - } else { - status = LongRunningOperationStatus.fromString(response.getValue().toString(), true); + private static PollResponse processOperationDetails(Response response, + PollResponse previous) { + LongRunningOperationStatus status = LongRunningOperationStatus.IN_PROGRESS; + if (response != null && response.getValue() != null) { + try { + @SuppressWarnings("unchecked") + Map body = response.getValue().toObject(Map.class); + Object statusObj = body == null ? null : body.get("status"); + if (statusObj != null) { + String s = statusObj.toString(); + if (NOT_STARTED.equalsIgnoreCase(s) || RUNNING.equalsIgnoreCase(s)) { + status = LongRunningOperationStatus.IN_PROGRESS; + } else if (SUCCEEDED.equalsIgnoreCase(s)) { + status = LongRunningOperationStatus.SUCCESSFULLY_COMPLETED; + } else { + status = LongRunningOperationStatus.fromString(s, true); + } + } + } catch (RuntimeException ignored) { + // Fall back to IN_PROGRESS; the next poll will retry. + } } - return new PollResponse<>(status, operationResultPollResponse.getValue()); + return new PollResponse<>(status, previous.getValue()); + } + + private static PollOperationDetails toPollOperationDetails(String operationLocation) { + // PollOperationDetails has no public no-arg constructor; round-trip a Map through BinaryData to populate it. + Map map = new HashMap<>(); + map.put("id", operationLocation); + return BinaryData.fromObject(map).toObject(PollOperationDetails.class); + } + + private static ConfigurationSnapshot deserializeSnapshot(BinaryData body) { + return body == null ? null : body.toObject(ConfigurationSnapshot.class); } - /** - * Get the non-null {@link Context}. The default value is {@link Context#NONE}. - * - * @param context It offers a means of passing arbitrary data (key-value pairs) to pipeline policies. - * Most applications do not need to pass arbitrary data to the pipeline and can pass Context.NONE or null. - * - * @return The Context. - */ - private static Context getNotNullContext(Context context) { - return context == null ? Context.NONE : context; + private static RequestOptions withContext(Context context) { + RequestOptions options = new RequestOptions(); + if (context != null && context != Context.NONE) { + options.setContext(context); + } + return options; } } diff --git a/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/ImplBridge.java b/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/ImplBridge.java new file mode 100644 index 000000000000..75be86736209 --- /dev/null +++ b/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/ImplBridge.java @@ -0,0 +1,530 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.data.appconfiguration.implementation; + +import java.util.List; +import java.util.function.Supplier; +import java.util.stream.Collectors; + +import com.azure.core.exception.HttpResponseException; +import com.azure.core.http.HttpHeaderName; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Context; +import com.azure.data.appconfiguration.implementation.models.KeyValue; +import com.azure.data.appconfiguration.models.ConfigurationSnapshot; +import com.azure.data.appconfiguration.models.ConfigurationSnapshotStatus; +import com.azure.data.appconfiguration.models.SettingFields; +import com.azure.data.appconfiguration.models.SettingLabel; +import com.azure.data.appconfiguration.models.SettingLabelFields; +import com.azure.data.appconfiguration.models.SnapshotFields; + +import reactor.core.publisher.Mono; + +/** + * Internal bridge that exposes the old typed convenience method shapes (Response<KeyValue>, + * PagedResponse<KeyValue>, etc.) on top of the new TypeSpec-generated protocol methods + * (RequestOptions + BinaryData) on {@link AzureAppConfigurationImpl}. + * + *

This exists so the hand-written {@code ConfigurationClient}/{@code ConfigurationAsyncClient} call sites + * keep working without being rewritten end-to-end after migrating from autorest to typespec-java.

+ */ +public final class ImplBridge { + + private static final HttpHeaderName ACCEPT_DATETIME = HttpHeaderName.fromString("Accept-Datetime"); + private static final HttpHeaderName SYNC_TOKEN = HttpHeaderName.fromString("Sync-Token"); + + private ImplBridge() { + } + + // ----------------------------------------------------------------------------------------------------- + // Exception remapping + // ----------------------------------------------------------------------------------------------------- + // The TypeSpec-generated protocol layer throws ResourceNotFoundException / ResourceModifiedException + // (subclasses of HttpResponseException). The hand-written public API historically threw plain + // HttpResponseException, so remap to preserve that public contract. + + private static T remap(Supplier action) { + try { + return action.get(); + } catch (HttpResponseException ex) { + throw remap(ex); + } + } + + private static HttpResponseException remap(HttpResponseException ex) { + if (ex.getClass() == HttpResponseException.class) { + return ex; + } + HttpResponseException remapped = new HttpResponseException(ex.getMessage(), ex.getResponse(), ex.getValue()); + remapped.setStackTrace(ex.getStackTrace()); + return remapped; + } + + // ----------------------------------------------------------------------------------------------------- + // RequestOptions builders + // ----------------------------------------------------------------------------------------------------- + + private static RequestOptions singleKvOptions(String label, String acceptDateTime, String syncToken, String ifMatch, + String ifNoneMatch, List fields, List tags, Context context) { + RequestOptions options = new RequestOptions(); + if (context != null && context != Context.NONE) { + options.setContext(context); + } + if (label != null) { + options.addQueryParam("label", label); + } + if (fields != null && !fields.isEmpty()) { + options.addQueryParam("$Select", joinFields(fields)); + } + if (tags != null) { + for (String tag : tags) { + options.addQueryParam("tags", tag); + } + } + if (acceptDateTime != null) { + options.setHeader(ACCEPT_DATETIME, acceptDateTime); + } + if (syncToken != null) { + options.setHeader(SYNC_TOKEN, syncToken); + } + if (ifMatch != null) { + options.setHeader(HttpHeaderName.IF_MATCH, ifMatch); + } + if (ifNoneMatch != null) { + options.setHeader(HttpHeaderName.IF_NONE_MATCH, ifNoneMatch); + } + return options; + } + + private static String joinFields(List fields) { + return fields.stream().map(SettingFields::toString).collect(Collectors.joining(",")); + } + + private static String joinSnapshotFields(List fields) { + return fields.stream().map(SnapshotFields::toString).collect(Collectors.joining(",")); + } + + private static String joinLabelFields(List fields) { + return fields.stream().map(SettingLabelFields::toString).collect(Collectors.joining(",")); + } + + private static String joinStatus(List statuses) { + return statuses.stream().map(ConfigurationSnapshotStatus::toString).collect(Collectors.joining(",")); + } + + // ----------------------------------------------------------------------------------------------------- + // putKeyValue (now setConfigurationSettingWithResponse) + // ----------------------------------------------------------------------------------------------------- + + public static Response putKeyValueWithResponse(AzureAppConfigurationImpl service, String key, + String label, String ifMatch, String ifNoneMatch, KeyValue entity, Context context) { + RequestOptions options = singleKvOptions(label, null, null, ifMatch, ifNoneMatch, null, null, context); + options.setBody(BinaryData.fromObject(entity)); + return remap(() -> toKeyValueResponse(service.setConfigurationSettingWithResponse(key, options))); + } + + public static Mono> putKeyValueWithResponseAsync(AzureAppConfigurationImpl service, String key, + String label, String ifMatch, String ifNoneMatch, KeyValue entity, Context context) { + RequestOptions options = singleKvOptions(label, null, null, ifMatch, ifNoneMatch, null, null, context); + options.setBody(BinaryData.fromObject(entity)); + return service.setConfigurationSettingWithResponseAsync(key, options) + .onErrorMap(HttpResponseException.class, ImplBridge::remap) + .map(ImplBridge::toKeyValueResponse); + } + + // ----------------------------------------------------------------------------------------------------- + // getKeyValue (now getKeyValueWithResponse, protocol) + // ----------------------------------------------------------------------------------------------------- + + public static Response getKeyValueWithResponse(AzureAppConfigurationImpl service, String key, + String label, String acceptDateTime, String syncToken, String ifMatch, String ifNoneMatch, + List fields, Context context) { + RequestOptions options + = singleKvOptions(label, acceptDateTime, syncToken, ifMatch, ifNoneMatch, fields, null, context); + return remap(() -> toKeyValueResponse(service.getKeyValueWithResponse(key, options))); + } + + public static Mono> getKeyValueWithResponseAsync(AzureAppConfigurationImpl service, String key, + String label, String acceptDateTime, String syncToken, String ifMatch, String ifNoneMatch, + List fields, Context context) { + RequestOptions options + = singleKvOptions(label, acceptDateTime, syncToken, ifMatch, ifNoneMatch, fields, null, context); + return service.getKeyValueWithResponseAsync(key, options) + .onErrorMap(HttpResponseException.class, ImplBridge::remap) + .map(ImplBridge::toKeyValueResponse); + } + + // ----------------------------------------------------------------------------------------------------- + // deleteKeyValue (now deleteConfigurationSettingWithResponse) + // ----------------------------------------------------------------------------------------------------- + + public static Response deleteKeyValueWithResponse(AzureAppConfigurationImpl service, String key, + String label, String ifMatch, Context context) { + RequestOptions options = singleKvOptions(label, null, null, ifMatch, null, null, null, context); + return remap(() -> toKeyValueResponseAllowEmpty(service.deleteConfigurationSettingWithResponse(key, options))); + } + + public static Mono> deleteKeyValueWithResponseAsync(AzureAppConfigurationImpl service, + String key, String label, String ifMatch, Context context) { + RequestOptions options = singleKvOptions(label, null, null, ifMatch, null, null, null, context); + return service.deleteConfigurationSettingWithResponseAsync(key, options) + .onErrorMap(HttpResponseException.class, ImplBridge::remap) + .map(ImplBridge::toKeyValueResponseAllowEmpty); + } + + // ----------------------------------------------------------------------------------------------------- + // putLock / deleteLock (read-only) + // ----------------------------------------------------------------------------------------------------- + + public static Response putLockWithResponse(AzureAppConfigurationImpl service, String key, String label, + String ifMatch, String ifNoneMatch, Context context) { + RequestOptions options = singleKvOptions(label, null, null, ifMatch, ifNoneMatch, null, null, context); + return remap(() -> toKeyValueResponse(service.putLockWithResponse(key, options))); + } + + public static Mono> putLockWithResponseAsync(AzureAppConfigurationImpl service, String key, + String label, String ifMatch, String ifNoneMatch, Context context) { + RequestOptions options = singleKvOptions(label, null, null, ifMatch, ifNoneMatch, null, null, context); + return service.putLockWithResponseAsync(key, options) + .onErrorMap(HttpResponseException.class, ImplBridge::remap) + .map(ImplBridge::toKeyValueResponse); + } + + public static Response deleteLockWithResponse(AzureAppConfigurationImpl service, String key, String label, + String ifMatch, String ifNoneMatch, Context context) { + RequestOptions options = singleKvOptions(label, null, null, ifMatch, ifNoneMatch, null, null, context); + return remap(() -> toKeyValueResponse(service.deleteLockWithResponse(key, options))); + } + + public static Mono> deleteLockWithResponseAsync(AzureAppConfigurationImpl service, String key, + String label, String ifMatch, String ifNoneMatch, Context context) { + RequestOptions options = singleKvOptions(label, null, null, ifMatch, ifNoneMatch, null, null, context); + return service.deleteLockWithResponseAsync(key, options) + .onErrorMap(HttpResponseException.class, ImplBridge::remap) + .map(ImplBridge::toKeyValueResponse); + } + + // ----------------------------------------------------------------------------------------------------- + // listConfigurationSettings (was getKeyValues*) + // ----------------------------------------------------------------------------------------------------- + + public static PagedResponse getKeyValuesSinglePage(AzureAppConfigurationImpl service, String keyFilter, + String labelFilter, String syncToken, String acceptDateTime, List fields, String snapshotName, + String ifMatch, String ifNoneMatch, List tagsFilter, Context context) { + RequestOptions options = listKeyValuesOptions(keyFilter, labelFilter, syncToken, acceptDateTime, fields, + snapshotName, ifMatch, ifNoneMatch, tagsFilter, context); + return remap(() -> toKeyValuePage(service.listConfigurationSettingsSinglePage(options))); + } + + public static Mono> getKeyValuesSinglePageAsync(AzureAppConfigurationImpl service, + String keyFilter, String labelFilter, String syncToken, String acceptDateTime, List fields, + String snapshotName, String ifMatch, String ifNoneMatch, List tagsFilter, Context context) { + RequestOptions options = listKeyValuesOptions(keyFilter, labelFilter, syncToken, acceptDateTime, fields, + snapshotName, ifMatch, ifNoneMatch, tagsFilter, context); + return service.listConfigurationSettingsSinglePageAsync(options) + .onErrorMap(HttpResponseException.class, ImplBridge::remap) + .map(ImplBridge::toKeyValuePage); + } + + public static PagedResponse getKeyValuesNextSinglePage(AzureAppConfigurationImpl service, String nextLink, + String acceptDateTime, String ifMatch, String ifNoneMatch, Context context) { + RequestOptions options = nextPageOptions(acceptDateTime, ifMatch, ifNoneMatch, context); + return remap(() -> toKeyValuePage(service.listConfigurationSettingsNextSinglePage(nextLink, options))); + } + + public static Mono> getKeyValuesNextSinglePageAsync(AzureAppConfigurationImpl service, + String nextLink, String acceptDateTime, String ifMatch, String ifNoneMatch, Context context) { + RequestOptions options = nextPageOptions(acceptDateTime, ifMatch, ifNoneMatch, context); + return service.listConfigurationSettingsNextSinglePageAsync(nextLink, options) + .onErrorMap(HttpResponseException.class, ImplBridge::remap) + .map(ImplBridge::toKeyValuePage); + } + + private static RequestOptions listKeyValuesOptions(String keyFilter, String labelFilter, String syncToken, + String acceptDateTime, List fields, String snapshotName, String ifMatch, String ifNoneMatch, + List tagsFilter, Context context) { + RequestOptions options = new RequestOptions(); + if (context != null && context != Context.NONE) { + options.setContext(context); + } + if (keyFilter != null) { + options.addQueryParam("key", keyFilter); + } + if (labelFilter != null) { + options.addQueryParam("label", labelFilter); + } + if (fields != null && !fields.isEmpty()) { + options.addQueryParam("$Select", joinFields(fields)); + } + if (snapshotName != null) { + options.addQueryParam("snapshot", snapshotName); + } + if (tagsFilter != null) { + for (String tag : tagsFilter) { + options.addQueryParam("tags", tag); + } + } + if (syncToken != null) { + options.setHeader(SYNC_TOKEN, syncToken); + } + if (acceptDateTime != null) { + options.setHeader(ACCEPT_DATETIME, acceptDateTime); + } + if (ifMatch != null) { + options.setHeader(HttpHeaderName.IF_MATCH, ifMatch); + } + if (ifNoneMatch != null) { + options.setHeader(HttpHeaderName.IF_NONE_MATCH, ifNoneMatch); + } + return options; + } + + private static RequestOptions nextPageOptions(String acceptDateTime, String ifMatch, String ifNoneMatch, + Context context) { + RequestOptions options = new RequestOptions(); + if (context != null && context != Context.NONE) { + options.setContext(context); + } + if (acceptDateTime != null) { + options.setHeader(ACCEPT_DATETIME, acceptDateTime); + } + if (ifMatch != null) { + options.setHeader(HttpHeaderName.IF_MATCH, ifMatch); + } + if (ifNoneMatch != null) { + options.setHeader(HttpHeaderName.IF_NONE_MATCH, ifNoneMatch); + } + return options; + } + + // ----------------------------------------------------------------------------------------------------- + // listRevisions + // ----------------------------------------------------------------------------------------------------- + + public static PagedResponse getRevisionsSinglePage(AzureAppConfigurationImpl service, String keyFilter, + String labelFilter, String syncToken, String acceptDateTime, List fields, + List tagsFilter, Context context) { + RequestOptions options = listKeyValuesOptions(keyFilter, labelFilter, syncToken, acceptDateTime, fields, null, + null, null, tagsFilter, context); + return remap(() -> toKeyValuePage(service.getRevisionsSinglePage(options))); + } + + public static Mono> getRevisionsSinglePageAsync(AzureAppConfigurationImpl service, + String keyFilter, String labelFilter, String syncToken, String acceptDateTime, List fields, + List tagsFilter, Context context) { + RequestOptions options = listKeyValuesOptions(keyFilter, labelFilter, syncToken, acceptDateTime, fields, null, + null, null, tagsFilter, context); + return service.getRevisionsSinglePageAsync(options) + .onErrorMap(HttpResponseException.class, ImplBridge::remap) + .map(ImplBridge::toKeyValuePage); + } + + public static PagedResponse getRevisionsNextSinglePage(AzureAppConfigurationImpl service, String nextLink, + String acceptDateTime, Context context) { + RequestOptions options = nextPageOptions(acceptDateTime, null, null, context); + return remap(() -> toKeyValuePage(service.getRevisionsNextSinglePage(nextLink, options))); + } + + public static Mono> getRevisionsNextSinglePageAsync(AzureAppConfigurationImpl service, + String nextLink, String acceptDateTime, Context context) { + RequestOptions options = nextPageOptions(acceptDateTime, null, null, context); + return service.getRevisionsNextSinglePageAsync(nextLink, options) + .onErrorMap(HttpResponseException.class, ImplBridge::remap) + .map(ImplBridge::toKeyValuePage); + } + + // ----------------------------------------------------------------------------------------------------- + // getSnapshot / listSnapshots + // ----------------------------------------------------------------------------------------------------- + + public static Response getSnapshotWithResponse(AzureAppConfigurationImpl service, + String name, String ifMatch, String ifNoneMatch, List fields, Context context) { + RequestOptions options = new RequestOptions(); + if (context != null && context != Context.NONE) { + options.setContext(context); + } + if (fields != null && !fields.isEmpty()) { + options.addQueryParam("$Select", joinSnapshotFields(fields)); + } + if (ifMatch != null) { + options.setHeader(HttpHeaderName.IF_MATCH, ifMatch); + } + if (ifNoneMatch != null) { + options.setHeader(HttpHeaderName.IF_NONE_MATCH, ifNoneMatch); + } + return remap(() -> { + Response response = service.getSnapshotWithResponse(name, options); + return new SimpleResponse<>(response, + response.getValue() == null ? null : response.getValue().toObject(ConfigurationSnapshot.class)); + }); + } + + public static Mono> getSnapshotWithResponseAsync(AzureAppConfigurationImpl service, + String name, String ifMatch, String ifNoneMatch, List fields, Context context) { + RequestOptions options = new RequestOptions(); + if (context != null && context != Context.NONE) { + options.setContext(context); + } + if (fields != null && !fields.isEmpty()) { + options.addQueryParam("$Select", joinSnapshotFields(fields)); + } + if (ifMatch != null) { + options.setHeader(HttpHeaderName.IF_MATCH, ifMatch); + } + if (ifNoneMatch != null) { + options.setHeader(HttpHeaderName.IF_NONE_MATCH, ifNoneMatch); + } + return service.getSnapshotWithResponseAsync(name, options) + .onErrorMap(HttpResponseException.class, ImplBridge::remap) + .map(response -> new SimpleResponse<>(response, + response.getValue() == null ? null : response.getValue().toObject(ConfigurationSnapshot.class))); + } + + public static PagedResponse getSnapshotsSinglePage(AzureAppConfigurationImpl service, + String nameFilter, String syncToken, List fields, List statuses, + Context context) { + RequestOptions options = snapshotListOptions(nameFilter, syncToken, fields, statuses, context); + return remap(() -> toSnapshotPage(service.getSnapshotsSinglePage(options))); + } + + public static Mono> getSnapshotsSinglePageAsync( + AzureAppConfigurationImpl service, String nameFilter, String syncToken, List fields, + List statuses, Context context) { + RequestOptions options = snapshotListOptions(nameFilter, syncToken, fields, statuses, context); + return service.getSnapshotsSinglePageAsync(options) + .onErrorMap(HttpResponseException.class, ImplBridge::remap) + .map(ImplBridge::toSnapshotPage); + } + + public static PagedResponse getSnapshotsNextSinglePage(AzureAppConfigurationImpl service, + String nextLink, Context context) { + RequestOptions options = nextPageOptions(null, null, null, context); + return remap(() -> toSnapshotPage(service.getSnapshotsNextSinglePage(nextLink, options))); + } + + public static Mono> + getSnapshotsNextSinglePageAsync(AzureAppConfigurationImpl service, String nextLink, Context context) { + RequestOptions options = nextPageOptions(null, null, null, context); + return service.getSnapshotsNextSinglePageAsync(nextLink, options) + .onErrorMap(HttpResponseException.class, ImplBridge::remap) + .map(ImplBridge::toSnapshotPage); + } + + private static RequestOptions snapshotListOptions(String nameFilter, String syncToken, List fields, + List statuses, Context context) { + RequestOptions options = new RequestOptions(); + if (context != null && context != Context.NONE) { + options.setContext(context); + } + if (nameFilter != null) { + options.addQueryParam("name", nameFilter); + } + if (fields != null && !fields.isEmpty()) { + options.addQueryParam("$Select", joinSnapshotFields(fields)); + } + if (statuses != null && !statuses.isEmpty()) { + options.addQueryParam("status", joinStatus(statuses)); + } + if (syncToken != null) { + options.setHeader(SYNC_TOKEN, syncToken); + } + return options; + } + + // ----------------------------------------------------------------------------------------------------- + // listLabels + // ----------------------------------------------------------------------------------------------------- + + public static PagedIterable getLabels(AzureAppConfigurationImpl service, String nameFilter, + String syncToken, String acceptDatetime, List fields, Context context) { + RequestOptions options = labelListOptions(nameFilter, syncToken, acceptDatetime, fields, context); + return new PagedIterable<>(() -> remap(() -> toLabelPage(service.getLabelsSinglePage(options))), + nextLink -> remap(() -> toLabelPage( + service.getLabelsNextSinglePage(nextLink, nextPageOptions(null, null, null, context))))); + } + + public static PagedFlux getLabelsAsync(AzureAppConfigurationImpl service, String nameFilter, + String syncToken, String acceptDatetime, List fields) { + RequestOptions options = labelListOptions(nameFilter, syncToken, acceptDatetime, fields, Context.NONE); + return new PagedFlux<>( + () -> service.getLabelsSinglePageAsync(options) + .onErrorMap(HttpResponseException.class, ImplBridge::remap) + .map(ImplBridge::toLabelPage), + nextLink -> service.getLabelsNextSinglePageAsync(nextLink, new RequestOptions()) + .onErrorMap(HttpResponseException.class, ImplBridge::remap) + .map(ImplBridge::toLabelPage)); + } + + private static PagedResponse toLabelPage(PagedResponse page) { + return mapPage(page, bd -> bd.toObject(SettingLabel.class)); + } + + private static RequestOptions labelListOptions(String nameFilter, String syncToken, String acceptDatetime, + List fields, Context context) { + RequestOptions options = new RequestOptions(); + if (context != null && context != Context.NONE) { + options.setContext(context); + } + if (nameFilter != null) { + options.addQueryParam("name", nameFilter); + } + if (fields != null && !fields.isEmpty()) { + options.addQueryParam("$Select", joinLabelFields(fields)); + } + if (syncToken != null) { + options.setHeader(SYNC_TOKEN, syncToken); + } + if (acceptDatetime != null) { + options.setHeader(ACCEPT_DATETIME, acceptDatetime); + } + return options; + } + + // ----------------------------------------------------------------------------------------------------- + // Response/page mappers + // ----------------------------------------------------------------------------------------------------- + + private static Response toKeyValueResponse(Response response) { + BinaryData body = response.getValue(); + KeyValue kv = body == null ? null : body.toObject(KeyValue.class); + return new SimpleResponse<>(response, kv); + } + + // DELETE may return a 204 with no body — treat as success with null KeyValue. + private static Response toKeyValueResponseAllowEmpty(Response response) { + BinaryData body = response.getValue(); + KeyValue kv; + if (body == null) { + kv = null; + } else { + byte[] bytes = body.toBytes(); + kv = (bytes == null || bytes.length == 0) ? null : body.toObject(KeyValue.class); + } + return new SimpleResponse<>(response, kv); + } + + private static PagedResponse toKeyValuePage(PagedResponse page) { + return mapPage(page, bd -> bd.toObject(KeyValue.class)); + } + + private static PagedResponse toSnapshotPage(PagedResponse page) { + return mapPage(page, bd -> bd.toObject(ConfigurationSnapshot.class)); + } + + private static PagedResponse mapPage(PagedResponse page, + java.util.function.Function mapper) { + List items = page.getValue() == null + ? java.util.Collections.emptyList() + : page.getValue().stream().map(mapper).collect(Collectors.toList()); + return new PagedResponseBase<>(page.getRequest(), page.getStatusCode(), page.getHeaders(), items, + page.getContinuationToken(), null); + } +} diff --git a/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/OperationLocationPollingStrategy.java b/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/OperationLocationPollingStrategy.java new file mode 100644 index 000000000000..8bf330e47825 --- /dev/null +++ b/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/OperationLocationPollingStrategy.java @@ -0,0 +1,140 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.data.appconfiguration.implementation; + +import com.azure.core.exception.AzureException; +import com.azure.core.http.HttpHeader; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.LongRunningOperationStatus; +import com.azure.core.util.polling.OperationResourcePollingStrategy; +import com.azure.core.util.polling.PollResponse; +import com.azure.core.util.polling.PollingContext; +import com.azure.core.util.polling.PollingStrategyOptions; +import com.azure.core.util.serializer.JsonSerializerProviders; +import com.azure.core.util.serializer.ObjectSerializer; +import com.azure.core.util.serializer.TypeReference; +import java.time.Duration; +import java.time.OffsetDateTime; +import reactor.core.publisher.Mono; + +// DO NOT modify this helper class + +/** + * Implements an operation location polling strategy, from Operation-Location. + * + * @param the type of the response type from a polling call, or BinaryData if raw response body should be kept + * @param the type of the final result object to deserialize into, or BinaryData if raw response body should be + * kept + */ +public final class OperationLocationPollingStrategy extends OperationResourcePollingStrategy { + + private static final ClientLogger LOGGER = new ClientLogger(OperationLocationPollingStrategy.class); + + private final ObjectSerializer serializer; + private final String endpoint; + private final String propertyName; + + /** + * Creates an instance of the operation resource polling strategy. + * + * @param pollingStrategyOptions options to configure this polling strategy. + * @throws NullPointerException if {@code pollingStrategyOptions} is null. + */ + public OperationLocationPollingStrategy(PollingStrategyOptions pollingStrategyOptions) { + this(pollingStrategyOptions, null); + } + + /** + * Creates an instance of the operation resource polling strategy. + * + * @param pollingStrategyOptions options to configure this polling strategy. + * @param propertyName the name of the property to extract final result. + * @throws NullPointerException if {@code pollingStrategyOptions} is null. + */ + public OperationLocationPollingStrategy(PollingStrategyOptions pollingStrategyOptions, String propertyName) { + super(PollingUtils.OPERATION_LOCATION_HEADER, pollingStrategyOptions); + this.propertyName = propertyName; + this.endpoint = pollingStrategyOptions.getEndpoint(); + this.serializer = pollingStrategyOptions.getSerializer() != null + ? pollingStrategyOptions.getSerializer() + : JsonSerializerProviders.createInstance(true); + } + + /** + * {@inheritDoc} + */ + @Override + public Mono> onInitialResponse(Response response, PollingContext pollingContext, + TypeReference pollResponseType) { + // Response is Response + + HttpHeader operationLocationHeader = response.getHeaders().get(PollingUtils.OPERATION_LOCATION_HEADER); + if (operationLocationHeader != null) { + pollingContext.setData(PollingUtils.OPERATION_LOCATION_HEADER.getCaseSensitiveName(), + PollingUtils.getAbsolutePath(operationLocationHeader.getValue(), endpoint, LOGGER)); + } + final String httpMethod = response.getRequest().getHttpMethod().name(); + pollingContext.setData(PollingUtils.HTTP_METHOD, httpMethod); + pollingContext.setData(PollingUtils.REQUEST_URL, response.getRequest().getUrl().toString()); + + if (response.getStatusCode() == 200 + || response.getStatusCode() == 201 + || response.getStatusCode() == 202 + || response.getStatusCode() == 204) { + final Duration retryAfter + = PollingUtils.getRetryAfterFromHeaders(response.getHeaders(), OffsetDateTime::now); + final Mono> pollResponseMono + = PollingUtils.deserializeResponse((BinaryData) response.getValue(), serializer, pollResponseType) + .onErrorResume(exception -> { + LOGGER.info("Failed to parse initial response."); + return Mono.empty(); + }) + .map(value -> new PollResponse<>(LongRunningOperationStatus.IN_PROGRESS, value, retryAfter)); + return pollResponseMono.switchIfEmpty( + Mono.fromSupplier(() -> new PollResponse<>(LongRunningOperationStatus.IN_PROGRESS, null, retryAfter))); + } else { + return Mono + .error( + new AzureException(String.format( + "Operation failed or cancelled with status code %d," + + ", '%s' header: %s, and response body: %s", + response.getStatusCode(), PollingUtils.OPERATION_LOCATION_HEADER, operationLocationHeader, + response.getValue()))); + } + } + + /** + * {@inheritDoc} + */ + @Override + public Mono getResult(PollingContext pollingContext, TypeReference resultType) { + if (pollingContext.getLatestResponse().getStatus() == LongRunningOperationStatus.FAILED) { + return Mono.error(new AzureException("Long running operation failed.")); + } else if (pollingContext.getLatestResponse().getStatus() == LongRunningOperationStatus.USER_CANCELLED) { + return Mono.error(new AzureException("Long running operation cancelled.")); + } + if (propertyName != null) { + // take the last poll response body from PollingContext, + // and de-serialize the property as final result + BinaryData latestResponseBody + = BinaryData.fromString(pollingContext.getData(PollingUtils.POLL_RESPONSE_BODY)); + return PollingUtils + .deserializeResponse(latestResponseBody, serializer, PollingUtils.POST_POLL_RESULT_TYPE_REFERENCE) + .flatMap(value -> { + if (value.get(propertyName) != null) { + return BinaryData.fromObjectAsync(value.get(propertyName)) + .flatMap(result -> PollingUtils.deserializeResponse(result, serializer, resultType)); + } else { + return Mono.error(new AzureException("Cannot get final result")); + } + }) + .switchIfEmpty(Mono.error(new AzureException("Cannot get final result"))); + } else { + return super.getResult(pollingContext, resultType); + } + } +} diff --git a/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/PollingUtils.java b/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/PollingUtils.java new file mode 100644 index 000000000000..94bb97c2e1a7 --- /dev/null +++ b/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/PollingUtils.java @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.data.appconfiguration.implementation; + +import com.azure.core.http.HttpHeaderName; +import com.azure.core.http.HttpHeaders; +import com.azure.core.util.BinaryData; +import com.azure.core.util.CoreUtils; +import com.azure.core.util.DateTimeRfc1123; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.serializer.ObjectSerializer; +import com.azure.core.util.serializer.TypeReference; +import java.net.URI; +import java.net.URISyntaxException; +import java.time.DateTimeException; +import java.time.Duration; +import java.time.OffsetDateTime; +import java.time.temporal.ChronoUnit; +import java.util.Map; +import java.util.function.Function; +import java.util.function.Supplier; +import reactor.core.publisher.Mono; + +// DO NOT modify this helper class + +final class PollingUtils { + + public static final TypeReference> POST_POLL_RESULT_TYPE_REFERENCE + = new TypeReference>() { + }; + + public static final HttpHeaderName OPERATION_LOCATION_HEADER = HttpHeaderName.fromString("Operation-Location"); + + public static final String HTTP_METHOD = "httpMethod"; + public static final String REQUEST_URL = "requestURL"; + public static final String POLL_RESPONSE_BODY = "pollResponseBody"; + + private static final String FORWARD_SLASH = "/"; + + public static String getAbsolutePath(String path, String endpoint, ClientLogger logger) { + try { + URI uri = new URI(path); + if (!uri.isAbsolute()) { + if (CoreUtils.isNullOrEmpty(endpoint)) { + throw logger.logExceptionAsError(new IllegalArgumentException( + "Relative path requires endpoint to be non-null and non-empty to create an absolute path.")); + } + + if (endpoint.endsWith(FORWARD_SLASH) && path.startsWith(FORWARD_SLASH)) { + return endpoint + path.substring(1); + } else if (!endpoint.endsWith(FORWARD_SLASH) && !path.startsWith(FORWARD_SLASH)) { + return endpoint + FORWARD_SLASH + path; + } else { + return endpoint + path; + } + } + } catch (URISyntaxException ex) { + throw logger.logExceptionAsWarning(new IllegalArgumentException("'path' must be a valid URI.", ex)); + } + return path; + } + + public static T deserializeResponseSync(BinaryData binaryData, ObjectSerializer serializer, + TypeReference typeReference) { + T value; + if (binaryData == null) { + value = null; + } else if (typeReference.getJavaClass().isAssignableFrom(BinaryData.class)) { + // T is BinaryData + value = typeReference.getJavaClass().cast(binaryData.toReplayableBinaryData()); + } else { + value = binaryData.toObject(typeReference, serializer); + } + return value; + } + + @SuppressWarnings("unchecked") + public static Mono deserializeResponse(BinaryData binaryData, ObjectSerializer serializer, + TypeReference typeReference) { + Mono value; + if (binaryData == null) { + value = Mono.empty(); + } else if (typeReference.getJavaClass().isAssignableFrom(BinaryData.class)) { + // T is BinaryData + value = (Mono) binaryData.toReplayableBinaryDataAsync(); + } else { + value = binaryData.toObjectAsync(typeReference, serializer); + } + return value; + } + + private static final HttpHeaderName RETRY_AFTER_MS_HEADER = HttpHeaderName.fromString("retry-after-ms"); + private static final HttpHeaderName X_MS_RETRY_AFTER_MS_HEADER = HttpHeaderName.fromString("x-ms-retry-after-ms"); + + public static Duration getRetryAfterFromHeaders(HttpHeaders headers, Supplier nowSupplier) { + // Found 'x-ms-retry-after-ms' header, use a Duration of milliseconds based on the value. + Duration retryDelay = tryGetRetryDelay(headers, X_MS_RETRY_AFTER_MS_HEADER, s -> tryGetDelayMillis(s)); + if (retryDelay != null) { + return retryDelay; + } + + // Found 'retry-after-ms' header, use a Duration of milliseconds based on the value. + retryDelay = tryGetRetryDelay(headers, RETRY_AFTER_MS_HEADER, s -> tryGetDelayMillis(s)); + if (retryDelay != null) { + return retryDelay; + } + + // Found 'Retry-After' header. First, attempt to resolve it as a Duration of seconds. If that fails, then + // attempt to resolve it as an HTTP date (RFC1123). + retryDelay = tryGetRetryDelay(headers, HttpHeaderName.RETRY_AFTER, + headerValue -> tryParseLongOrDateTime(headerValue, nowSupplier)); + + // Either the retry delay will have been found or it'll be null, null indicates no retry after. + return retryDelay; + } + + private static Duration tryGetRetryDelay(HttpHeaders headers, HttpHeaderName headerName, + Function delayParser) { + String headerValue = headers.getValue(headerName); + + return CoreUtils.isNullOrEmpty(headerValue) ? null : delayParser.apply(headerValue); + } + + private static Duration tryParseLongOrDateTime(String value, Supplier nowSupplier) { + long delaySeconds; + try { + OffsetDateTime retryAfter = new DateTimeRfc1123(value).getDateTime(); + + delaySeconds = nowSupplier.get().until(retryAfter, ChronoUnit.SECONDS); + } catch (DateTimeException ex) { + delaySeconds = tryParseLong(value); + } + + return (delaySeconds >= 0) ? Duration.ofSeconds(delaySeconds) : null; + } + + private static long tryParseLong(String value) { + try { + return Long.parseLong(value); + } catch (NumberFormatException ex) { + return -1; + } + } + + private static Duration tryGetDelayMillis(String value) { + long delayMillis = tryParseLong(value); + return (delayMillis >= 0) ? Duration.ofMillis(delayMillis) : null; + } +} diff --git a/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/SyncOperationLocationPollingStrategy.java b/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/SyncOperationLocationPollingStrategy.java new file mode 100644 index 000000000000..c9e7c0dd48b2 --- /dev/null +++ b/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/SyncOperationLocationPollingStrategy.java @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.data.appconfiguration.implementation; + +import com.azure.core.exception.AzureException; +import com.azure.core.http.HttpHeader; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.LongRunningOperationStatus; +import com.azure.core.util.polling.PollResponse; +import com.azure.core.util.polling.PollingContext; +import com.azure.core.util.polling.PollingStrategyOptions; +import com.azure.core.util.polling.SyncOperationResourcePollingStrategy; +import com.azure.core.util.serializer.JsonSerializerProviders; +import com.azure.core.util.serializer.ObjectSerializer; +import com.azure.core.util.serializer.TypeReference; +import java.io.UncheckedIOException; +import java.time.Duration; +import java.time.OffsetDateTime; +import java.util.Map; + +// DO NOT modify this helper class + +/** + * Implements a synchronous operation location polling strategy, from Operation-Location. + * + * @param the type of the response type from a polling call, or BinaryData if raw response body should be kept + * @param the type of the final result object to deserialize into, or BinaryData if raw response body should be + * kept + */ +public final class SyncOperationLocationPollingStrategy extends SyncOperationResourcePollingStrategy { + + private static final ClientLogger LOGGER = new ClientLogger(SyncOperationLocationPollingStrategy.class); + + private final ObjectSerializer serializer; + private final String endpoint; + private final String propertyName; + + /** + * Creates an instance of the operation resource polling strategy. + * + * @param pollingStrategyOptions options to configure this polling strategy. + * @throws NullPointerException if {@code pollingStrategyOptions} is null. + */ + public SyncOperationLocationPollingStrategy(PollingStrategyOptions pollingStrategyOptions) { + this(pollingStrategyOptions, null); + } + + /** + * Creates an instance of the operation resource polling strategy. + * + * @param pollingStrategyOptions options to configure this polling strategy. + * @param propertyName the name of the property to extract final result. + * @throws NullPointerException if {@code pollingStrategyOptions} is null. + */ + public SyncOperationLocationPollingStrategy(PollingStrategyOptions pollingStrategyOptions, String propertyName) { + super(PollingUtils.OPERATION_LOCATION_HEADER, pollingStrategyOptions); + this.propertyName = propertyName; + this.endpoint = pollingStrategyOptions.getEndpoint(); + this.serializer = pollingStrategyOptions.getSerializer() != null + ? pollingStrategyOptions.getSerializer() + : JsonSerializerProviders.createInstance(true); + } + + /** + * {@inheritDoc} + */ + @Override + public PollResponse onInitialResponse(Response response, PollingContext pollingContext, + TypeReference pollResponseType) { + // Response is Response + + HttpHeader operationLocationHeader = response.getHeaders().get(PollingUtils.OPERATION_LOCATION_HEADER); + if (operationLocationHeader != null) { + pollingContext.setData(PollingUtils.OPERATION_LOCATION_HEADER.getCaseSensitiveName(), + PollingUtils.getAbsolutePath(operationLocationHeader.getValue(), endpoint, LOGGER)); + } + final String httpMethod = response.getRequest().getHttpMethod().name(); + pollingContext.setData(PollingUtils.HTTP_METHOD, httpMethod); + pollingContext.setData(PollingUtils.REQUEST_URL, response.getRequest().getUrl().toString()); + + if (response.getStatusCode() == 200 + || response.getStatusCode() == 201 + || response.getStatusCode() == 202 + || response.getStatusCode() == 204) { + final Duration retryAfter + = PollingUtils.getRetryAfterFromHeaders(response.getHeaders(), OffsetDateTime::now); + T initialResponseType = null; + try { + initialResponseType = PollingUtils.deserializeResponseSync((BinaryData) response.getValue(), serializer, + pollResponseType); + } catch (UncheckedIOException e) { + LOGGER.info("Failed to parse initial response."); + } + return new PollResponse<>(LongRunningOperationStatus.IN_PROGRESS, initialResponseType, retryAfter); + } + + throw LOGGER.logExceptionAsError(new AzureException( + String.format("Operation failed or cancelled with status code %d, '%s' header: %s, and response body: %s", + response.getStatusCode(), PollingUtils.OPERATION_LOCATION_HEADER, operationLocationHeader, + response.getValue()))); + } + + /** + * {@inheritDoc} + */ + public U getResult(PollingContext pollingContext, TypeReference resultType) { + if (pollingContext.getLatestResponse().getStatus() == LongRunningOperationStatus.FAILED) { + throw LOGGER.logExceptionAsError(new AzureException("Long running operation failed.")); + } else if (pollingContext.getLatestResponse().getStatus() == LongRunningOperationStatus.USER_CANCELLED) { + throw LOGGER.logExceptionAsError(new AzureException("Long running operation cancelled.")); + } + if (propertyName != null) { + // take the last poll response body from PollingContext, + // and de-serialize the property as final result + BinaryData latestResponseBody + = BinaryData.fromString(pollingContext.getData(PollingUtils.POLL_RESPONSE_BODY)); + Map pollResult = PollingUtils.deserializeResponseSync(latestResponseBody, serializer, + PollingUtils.POST_POLL_RESULT_TYPE_REFERENCE); + if (pollResult != null && pollResult.get(propertyName) != null) { + return PollingUtils.deserializeResponseSync(BinaryData.fromObject(pollResult.get(propertyName)), + serializer, resultType); + } else { + throw LOGGER.logExceptionAsError(new AzureException("Cannot get final result")); + } + } else { + return super.getResult(pollingContext, resultType); + } + } +} diff --git a/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/Utility.java b/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/Utility.java index be61e00500f1..c7977e32c4b5 100644 --- a/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/Utility.java +++ b/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/Utility.java @@ -17,16 +17,15 @@ import com.azure.core.http.MatchConditions; import com.azure.core.http.rest.PagedResponse; import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.RequestOptions; import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.ResponseBase; import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.CoreUtils; import com.azure.core.util.logging.ClientLogger; import com.azure.data.appconfiguration.implementation.models.CheckKeyValuesHeaders; import com.azure.data.appconfiguration.implementation.models.KeyValue; -import com.azure.data.appconfiguration.implementation.models.SnapshotUpdateParameters; -import com.azure.data.appconfiguration.implementation.models.UpdateSnapshotHeaders; import com.azure.data.appconfiguration.models.ConfigurationSetting; import com.azure.data.appconfiguration.models.ConfigurationSnapshot; import com.azure.data.appconfiguration.models.ConfigurationSnapshotStatus; @@ -115,24 +114,37 @@ public static Mono validateSettingAsync(ConfigurationSetti return Mono.just(setting); } + private static final String SNAPSHOT_UPDATE_CONTENT_TYPE = "application/merge-patch+json"; + public static Response updateSnapshotSync(String snapshotName, MatchConditions matchConditions, ConfigurationSnapshotStatus status, AzureAppConfigurationImpl serviceClient, Context context) { - final String ifMatch = matchConditions == null ? null : matchConditions.getIfMatch(); - - final ResponseBase response - = serviceClient.updateSnapshotWithResponse(snapshotName, new SnapshotUpdateParameters().setStatus(status), - ifMatch, null, context); - return new SimpleResponse<>(response, response.getValue()); + final RequestOptions options = buildUpdateSnapshotOptions(matchConditions, context); + final BinaryData body = BinaryData.fromString("{\"status\":\"" + status + "\"}"); + final Response response + = serviceClient.updateSnapshotWithResponse(SNAPSHOT_UPDATE_CONTENT_TYPE, snapshotName, body, options); + return new SimpleResponse<>(response, + response.getValue() == null ? null : response.getValue().toObject(ConfigurationSnapshot.class)); } public static Mono> updateSnapshotAsync(String snapshotName, MatchConditions matchConditions, ConfigurationSnapshotStatus status, AzureAppConfigurationImpl serviceClient) { - final String ifMatch = matchConditions == null ? null : matchConditions.getIfMatch(); - return serviceClient - .updateSnapshotWithResponseAsync(snapshotName, new SnapshotUpdateParameters().setStatus(status), ifMatch, - null) - .map(response -> new SimpleResponse<>(response, response.getValue())); + final RequestOptions options = buildUpdateSnapshotOptions(matchConditions, null); + final BinaryData body = BinaryData.fromString("{\"status\":\"" + status + "\"}"); + return serviceClient.updateSnapshotWithResponseAsync(SNAPSHOT_UPDATE_CONTENT_TYPE, snapshotName, body, options) + .map(response -> new SimpleResponse<>(response, + response.getValue() == null ? null : response.getValue().toObject(ConfigurationSnapshot.class))); + } + + private static RequestOptions buildUpdateSnapshotOptions(MatchConditions matchConditions, Context context) { + RequestOptions options = new RequestOptions(); + if (context != null && context != Context.NONE) { + options.setContext(context); + } + if (matchConditions != null && matchConditions.getIfMatch() != null) { + options.setHeader(HttpHeaderName.IF_MATCH, matchConditions.getIfMatch()); + } + return options; } // Parse the next link from the link header, if it exists. And return the continuation token url without the "<" and ">" diff --git a/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/models/CheckKeyValueHeaders.java b/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/models/CheckKeyValueHeaders.java deleted file mode 100644 index d6ce66578341..000000000000 --- a/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/models/CheckKeyValueHeaders.java +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.data.appconfiguration.implementation.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.Generated; -import com.azure.core.http.HttpHeaderName; -import com.azure.core.http.HttpHeaders; - -/** - * The CheckKeyValueHeaders model. - */ -@Fluent -public final class CheckKeyValueHeaders { - /* - * The ETag property. - */ - @Generated - private String eTag; - - /* - * The Sync-Token property. - */ - @Generated - private String syncToken; - - private static final HttpHeaderName SYNC_TOKEN = HttpHeaderName.fromString("Sync-Token"); - - // HttpHeaders containing the raw property values. - /** - * Creates an instance of CheckKeyValueHeaders class. - * - * @param rawHeaders The raw HttpHeaders that will be used to create the property values. - */ - public CheckKeyValueHeaders(HttpHeaders rawHeaders) { - this.eTag = rawHeaders.getValue(HttpHeaderName.ETAG); - this.syncToken = rawHeaders.getValue(SYNC_TOKEN); - } - - /** - * Get the eTag property: The ETag property. - * - * @return the eTag value. - */ - @Generated - public String getETag() { - return this.eTag; - } - - /** - * Set the eTag property: The ETag property. - * - * @param eTag the eTag value to set. - * @return the CheckKeyValueHeaders object itself. - */ - @Generated - public CheckKeyValueHeaders setETag(String eTag) { - this.eTag = eTag; - return this; - } - - /** - * Get the syncToken property: The Sync-Token property. - * - * @return the syncToken value. - */ - @Generated - public String getSyncToken() { - return this.syncToken; - } - - /** - * Set the syncToken property: The Sync-Token property. - * - * @param syncToken the syncToken value to set. - * @return the CheckKeyValueHeaders object itself. - */ - @Generated - public CheckKeyValueHeaders setSyncToken(String syncToken) { - this.syncToken = syncToken; - return this; - } -} diff --git a/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/models/CheckKeyValuesHeaders.java b/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/models/CheckKeyValuesHeaders.java deleted file mode 100644 index 8ab026d0d944..000000000000 --- a/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/models/CheckKeyValuesHeaders.java +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.data.appconfiguration.implementation.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.Generated; -import com.azure.core.http.HttpHeaderName; -import com.azure.core.http.HttpHeaders; - -/** - * The CheckKeyValuesHeaders model. - */ -@Fluent -public final class CheckKeyValuesHeaders { - /* - * The ETag property. - */ - @Generated - private String eTag; - - /* - * The Sync-Token property. - */ - @Generated - private String syncToken; - - private static final HttpHeaderName SYNC_TOKEN = HttpHeaderName.fromString("Sync-Token"); - - // HttpHeaders containing the raw property values. - /** - * Creates an instance of CheckKeyValuesHeaders class. - * - * @param rawHeaders The raw HttpHeaders that will be used to create the property values. - */ - public CheckKeyValuesHeaders(HttpHeaders rawHeaders) { - this.eTag = rawHeaders.getValue(HttpHeaderName.ETAG); - this.syncToken = rawHeaders.getValue(SYNC_TOKEN); - } - - /** - * Get the eTag property: The ETag property. - * - * @return the eTag value. - */ - @Generated - public String getETag() { - return this.eTag; - } - - /** - * Set the eTag property: The ETag property. - * - * @param eTag the eTag value to set. - * @return the CheckKeyValuesHeaders object itself. - */ - @Generated - public CheckKeyValuesHeaders setETag(String eTag) { - this.eTag = eTag; - return this; - } - - /** - * Get the syncToken property: The Sync-Token property. - * - * @return the syncToken value. - */ - @Generated - public String getSyncToken() { - return this.syncToken; - } - - /** - * Set the syncToken property: The Sync-Token property. - * - * @param syncToken the syncToken value to set. - * @return the CheckKeyValuesHeaders object itself. - */ - @Generated - public CheckKeyValuesHeaders setSyncToken(String syncToken) { - this.syncToken = syncToken; - return this; - } -} diff --git a/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/models/CheckKeysHeaders.java b/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/models/CheckKeysHeaders.java deleted file mode 100644 index 0015ecb97236..000000000000 --- a/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/models/CheckKeysHeaders.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.data.appconfiguration.implementation.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.Generated; -import com.azure.core.http.HttpHeaderName; -import com.azure.core.http.HttpHeaders; - -/** - * The CheckKeysHeaders model. - */ -@Fluent -public final class CheckKeysHeaders { - /* - * The Sync-Token property. - */ - @Generated - private String syncToken; - - private static final HttpHeaderName SYNC_TOKEN = HttpHeaderName.fromString("Sync-Token"); - - // HttpHeaders containing the raw property values. - /** - * Creates an instance of CheckKeysHeaders class. - * - * @param rawHeaders The raw HttpHeaders that will be used to create the property values. - */ - public CheckKeysHeaders(HttpHeaders rawHeaders) { - this.syncToken = rawHeaders.getValue(SYNC_TOKEN); - } - - /** - * Get the syncToken property: The Sync-Token property. - * - * @return the syncToken value. - */ - @Generated - public String getSyncToken() { - return this.syncToken; - } - - /** - * Set the syncToken property: The Sync-Token property. - * - * @param syncToken the syncToken value to set. - * @return the CheckKeysHeaders object itself. - */ - @Generated - public CheckKeysHeaders setSyncToken(String syncToken) { - this.syncToken = syncToken; - return this; - } -} diff --git a/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/models/CheckLabelsHeaders.java b/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/models/CheckLabelsHeaders.java deleted file mode 100644 index 29c61b75fd1d..000000000000 --- a/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/models/CheckLabelsHeaders.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.data.appconfiguration.implementation.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.Generated; -import com.azure.core.http.HttpHeaderName; -import com.azure.core.http.HttpHeaders; - -/** - * The CheckLabelsHeaders model. - */ -@Fluent -public final class CheckLabelsHeaders { - /* - * The Sync-Token property. - */ - @Generated - private String syncToken; - - private static final HttpHeaderName SYNC_TOKEN = HttpHeaderName.fromString("Sync-Token"); - - // HttpHeaders containing the raw property values. - /** - * Creates an instance of CheckLabelsHeaders class. - * - * @param rawHeaders The raw HttpHeaders that will be used to create the property values. - */ - public CheckLabelsHeaders(HttpHeaders rawHeaders) { - this.syncToken = rawHeaders.getValue(SYNC_TOKEN); - } - - /** - * Get the syncToken property: The Sync-Token property. - * - * @return the syncToken value. - */ - @Generated - public String getSyncToken() { - return this.syncToken; - } - - /** - * Set the syncToken property: The Sync-Token property. - * - * @param syncToken the syncToken value to set. - * @return the CheckLabelsHeaders object itself. - */ - @Generated - public CheckLabelsHeaders setSyncToken(String syncToken) { - this.syncToken = syncToken; - return this; - } -} diff --git a/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/models/CheckRevisionsHeaders.java b/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/models/CheckRevisionsHeaders.java deleted file mode 100644 index 26e45d736ff2..000000000000 --- a/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/models/CheckRevisionsHeaders.java +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.data.appconfiguration.implementation.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.Generated; -import com.azure.core.http.HttpHeaderName; -import com.azure.core.http.HttpHeaders; - -/** - * The CheckRevisionsHeaders model. - */ -@Fluent -public final class CheckRevisionsHeaders { - /* - * The ETag property. - */ - @Generated - private String eTag; - - /* - * The Sync-Token property. - */ - @Generated - private String syncToken; - - private static final HttpHeaderName SYNC_TOKEN = HttpHeaderName.fromString("Sync-Token"); - - // HttpHeaders containing the raw property values. - /** - * Creates an instance of CheckRevisionsHeaders class. - * - * @param rawHeaders The raw HttpHeaders that will be used to create the property values. - */ - public CheckRevisionsHeaders(HttpHeaders rawHeaders) { - this.eTag = rawHeaders.getValue(HttpHeaderName.ETAG); - this.syncToken = rawHeaders.getValue(SYNC_TOKEN); - } - - /** - * Get the eTag property: The ETag property. - * - * @return the eTag value. - */ - @Generated - public String getETag() { - return this.eTag; - } - - /** - * Set the eTag property: The ETag property. - * - * @param eTag the eTag value to set. - * @return the CheckRevisionsHeaders object itself. - */ - @Generated - public CheckRevisionsHeaders setETag(String eTag) { - this.eTag = eTag; - return this; - } - - /** - * Get the syncToken property: The Sync-Token property. - * - * @return the syncToken value. - */ - @Generated - public String getSyncToken() { - return this.syncToken; - } - - /** - * Set the syncToken property: The Sync-Token property. - * - * @param syncToken the syncToken value to set. - * @return the CheckRevisionsHeaders object itself. - */ - @Generated - public CheckRevisionsHeaders setSyncToken(String syncToken) { - this.syncToken = syncToken; - return this; - } -} diff --git a/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/models/CheckSnapshotHeaders.java b/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/models/CheckSnapshotHeaders.java deleted file mode 100644 index 762653aebb6f..000000000000 --- a/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/models/CheckSnapshotHeaders.java +++ /dev/null @@ -1,114 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.data.appconfiguration.implementation.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.Generated; -import com.azure.core.http.HttpHeaderName; -import com.azure.core.http.HttpHeaders; - -/** - * The CheckSnapshotHeaders model. - */ -@Fluent -public final class CheckSnapshotHeaders { - /* - * The ETag property. - */ - @Generated - private String eTag; - - /* - * The Sync-Token property. - */ - @Generated - private String syncToken; - - /* - * The Link property. - */ - @Generated - private String link; - - private static final HttpHeaderName SYNC_TOKEN = HttpHeaderName.fromString("Sync-Token"); - - // HttpHeaders containing the raw property values. - /** - * Creates an instance of CheckSnapshotHeaders class. - * - * @param rawHeaders The raw HttpHeaders that will be used to create the property values. - */ - public CheckSnapshotHeaders(HttpHeaders rawHeaders) { - this.eTag = rawHeaders.getValue(HttpHeaderName.ETAG); - this.syncToken = rawHeaders.getValue(SYNC_TOKEN); - this.link = rawHeaders.getValue(HttpHeaderName.LINK); - } - - /** - * Get the eTag property: The ETag property. - * - * @return the eTag value. - */ - @Generated - public String getETag() { - return this.eTag; - } - - /** - * Set the eTag property: The ETag property. - * - * @param eTag the eTag value to set. - * @return the CheckSnapshotHeaders object itself. - */ - @Generated - public CheckSnapshotHeaders setETag(String eTag) { - this.eTag = eTag; - return this; - } - - /** - * Get the syncToken property: The Sync-Token property. - * - * @return the syncToken value. - */ - @Generated - public String getSyncToken() { - return this.syncToken; - } - - /** - * Set the syncToken property: The Sync-Token property. - * - * @param syncToken the syncToken value to set. - * @return the CheckSnapshotHeaders object itself. - */ - @Generated - public CheckSnapshotHeaders setSyncToken(String syncToken) { - this.syncToken = syncToken; - return this; - } - - /** - * Get the link property: The Link property. - * - * @return the link value. - */ - @Generated - public String getLink() { - return this.link; - } - - /** - * Set the link property: The Link property. - * - * @param link the link value to set. - * @return the CheckSnapshotHeaders object itself. - */ - @Generated - public CheckSnapshotHeaders setLink(String link) { - this.link = link; - return this; - } -} diff --git a/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/models/CheckSnapshotsHeaders.java b/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/models/CheckSnapshotsHeaders.java deleted file mode 100644 index 4c46ae8ed5d3..000000000000 --- a/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/models/CheckSnapshotsHeaders.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.data.appconfiguration.implementation.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.Generated; -import com.azure.core.http.HttpHeaderName; -import com.azure.core.http.HttpHeaders; - -/** - * The CheckSnapshotsHeaders model. - */ -@Fluent -public final class CheckSnapshotsHeaders { - /* - * The Sync-Token property. - */ - @Generated - private String syncToken; - - private static final HttpHeaderName SYNC_TOKEN = HttpHeaderName.fromString("Sync-Token"); - - // HttpHeaders containing the raw property values. - /** - * Creates an instance of CheckSnapshotsHeaders class. - * - * @param rawHeaders The raw HttpHeaders that will be used to create the property values. - */ - public CheckSnapshotsHeaders(HttpHeaders rawHeaders) { - this.syncToken = rawHeaders.getValue(SYNC_TOKEN); - } - - /** - * Get the syncToken property: The Sync-Token property. - * - * @return the syncToken value. - */ - @Generated - public String getSyncToken() { - return this.syncToken; - } - - /** - * Set the syncToken property: The Sync-Token property. - * - * @param syncToken the syncToken value to set. - * @return the CheckSnapshotsHeaders object itself. - */ - @Generated - public CheckSnapshotsHeaders setSyncToken(String syncToken) { - this.syncToken = syncToken; - return this; - } -} diff --git a/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/models/CompositionType.java b/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/models/CompositionType.java new file mode 100644 index 000000000000..8ed550f7dbc9 --- /dev/null +++ b/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/models/CompositionType.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.data.appconfiguration.implementation.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Composition types. + */ +public final class CompositionType extends ExpandableStringEnum { + /** + * The 'key' composition type. + */ + @Generated + public static final CompositionType KEY = fromString("key"); + + /** + * The 'key_label' composition type. + */ + @Generated + public static final CompositionType KEY_LABEL = fromString("key_label"); + + /** + * Creates a new instance of CompositionType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public CompositionType() { + } + + /** + * Creates or finds a CompositionType from its string representation. + * + * @param name a name to look for. + * @return the corresponding CompositionType. + */ + @Generated + public static CompositionType fromString(String name) { + return fromString(name, CompositionType.class); + } + + /** + * Gets known CompositionType values. + * + * @return known CompositionType values. + */ + @Generated + public static Collection values() { + return values(CompositionType.class); + } +} diff --git a/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/models/CreateSnapshotHeaders.java b/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/models/CreateSnapshotHeaders.java deleted file mode 100644 index 153694001298..000000000000 --- a/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/models/CreateSnapshotHeaders.java +++ /dev/null @@ -1,143 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.data.appconfiguration.implementation.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.Generated; -import com.azure.core.http.HttpHeaderName; -import com.azure.core.http.HttpHeaders; - -/** - * The CreateSnapshotHeaders model. - */ -@Fluent -public final class CreateSnapshotHeaders { - /* - * The ETag property. - */ - @Generated - private String eTag; - - /* - * The Sync-Token property. - */ - @Generated - private String syncToken; - - /* - * The Operation-Location property. - */ - @Generated - private String operationLocation; - - /* - * The Link property. - */ - @Generated - private String link; - - private static final HttpHeaderName SYNC_TOKEN = HttpHeaderName.fromString("Sync-Token"); - - // HttpHeaders containing the raw property values. - /** - * Creates an instance of CreateSnapshotHeaders class. - * - * @param rawHeaders The raw HttpHeaders that will be used to create the property values. - */ - public CreateSnapshotHeaders(HttpHeaders rawHeaders) { - this.eTag = rawHeaders.getValue(HttpHeaderName.ETAG); - this.syncToken = rawHeaders.getValue(SYNC_TOKEN); - this.operationLocation = rawHeaders.getValue(HttpHeaderName.OPERATION_LOCATION); - this.link = rawHeaders.getValue(HttpHeaderName.LINK); - } - - /** - * Get the eTag property: The ETag property. - * - * @return the eTag value. - */ - @Generated - public String getETag() { - return this.eTag; - } - - /** - * Set the eTag property: The ETag property. - * - * @param eTag the eTag value to set. - * @return the CreateSnapshotHeaders object itself. - */ - @Generated - public CreateSnapshotHeaders setETag(String eTag) { - this.eTag = eTag; - return this; - } - - /** - * Get the syncToken property: The Sync-Token property. - * - * @return the syncToken value. - */ - @Generated - public String getSyncToken() { - return this.syncToken; - } - - /** - * Set the syncToken property: The Sync-Token property. - * - * @param syncToken the syncToken value to set. - * @return the CreateSnapshotHeaders object itself. - */ - @Generated - public CreateSnapshotHeaders setSyncToken(String syncToken) { - this.syncToken = syncToken; - return this; - } - - /** - * Get the operationLocation property: The Operation-Location property. - * - * @return the operationLocation value. - */ - @Generated - public String getOperationLocation() { - return this.operationLocation; - } - - /** - * Set the operationLocation property: The Operation-Location property. - * - * @param operationLocation the operationLocation value to set. - * @return the CreateSnapshotHeaders object itself. - */ - @Generated - public CreateSnapshotHeaders setOperationLocation(String operationLocation) { - this.operationLocation = operationLocation; - return this; - } - - /** - * Get the link property: The Link property. - * - * @return the link value. - */ - @Generated - public String getLink() { - return this.link; - } - - /** - * Set the link property: The Link property. - * - * @param link the link value to set. - * @return the CreateSnapshotHeaders object itself. - */ - @Generated - public CreateSnapshotHeaders setLink(String link) { - this.link = link; - return this; - } -} diff --git a/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/models/DeleteKeyValueHeaders.java b/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/models/DeleteKeyValueHeaders.java deleted file mode 100644 index 2ee78637e4b1..000000000000 --- a/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/models/DeleteKeyValueHeaders.java +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.data.appconfiguration.implementation.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.Generated; -import com.azure.core.http.HttpHeaderName; -import com.azure.core.http.HttpHeaders; - -/** - * The DeleteKeyValueHeaders model. - */ -@Fluent -public final class DeleteKeyValueHeaders { - /* - * The ETag property. - */ - @Generated - private String eTag; - - /* - * The Sync-Token property. - */ - @Generated - private String syncToken; - - private static final HttpHeaderName SYNC_TOKEN = HttpHeaderName.fromString("Sync-Token"); - - // HttpHeaders containing the raw property values. - /** - * Creates an instance of DeleteKeyValueHeaders class. - * - * @param rawHeaders The raw HttpHeaders that will be used to create the property values. - */ - public DeleteKeyValueHeaders(HttpHeaders rawHeaders) { - this.eTag = rawHeaders.getValue(HttpHeaderName.ETAG); - this.syncToken = rawHeaders.getValue(SYNC_TOKEN); - } - - /** - * Get the eTag property: The ETag property. - * - * @return the eTag value. - */ - @Generated - public String getETag() { - return this.eTag; - } - - /** - * Set the eTag property: The ETag property. - * - * @param eTag the eTag value to set. - * @return the DeleteKeyValueHeaders object itself. - */ - @Generated - public DeleteKeyValueHeaders setETag(String eTag) { - this.eTag = eTag; - return this; - } - - /** - * Get the syncToken property: The Sync-Token property. - * - * @return the syncToken value. - */ - @Generated - public String getSyncToken() { - return this.syncToken; - } - - /** - * Set the syncToken property: The Sync-Token property. - * - * @param syncToken the syncToken value to set. - * @return the DeleteKeyValueHeaders object itself. - */ - @Generated - public DeleteKeyValueHeaders setSyncToken(String syncToken) { - this.syncToken = syncToken; - return this; - } -} diff --git a/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/models/DeleteLockHeaders.java b/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/models/DeleteLockHeaders.java deleted file mode 100644 index 61ee719a1a6a..000000000000 --- a/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/models/DeleteLockHeaders.java +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.data.appconfiguration.implementation.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.Generated; -import com.azure.core.http.HttpHeaderName; -import com.azure.core.http.HttpHeaders; - -/** - * The DeleteLockHeaders model. - */ -@Fluent -public final class DeleteLockHeaders { - /* - * The ETag property. - */ - @Generated - private String eTag; - - /* - * The Sync-Token property. - */ - @Generated - private String syncToken; - - private static final HttpHeaderName SYNC_TOKEN = HttpHeaderName.fromString("Sync-Token"); - - // HttpHeaders containing the raw property values. - /** - * Creates an instance of DeleteLockHeaders class. - * - * @param rawHeaders The raw HttpHeaders that will be used to create the property values. - */ - public DeleteLockHeaders(HttpHeaders rawHeaders) { - this.eTag = rawHeaders.getValue(HttpHeaderName.ETAG); - this.syncToken = rawHeaders.getValue(SYNC_TOKEN); - } - - /** - * Get the eTag property: The ETag property. - * - * @return the eTag value. - */ - @Generated - public String getETag() { - return this.eTag; - } - - /** - * Set the eTag property: The ETag property. - * - * @param eTag the eTag value to set. - * @return the DeleteLockHeaders object itself. - */ - @Generated - public DeleteLockHeaders setETag(String eTag) { - this.eTag = eTag; - return this; - } - - /** - * Get the syncToken property: The Sync-Token property. - * - * @return the syncToken value. - */ - @Generated - public String getSyncToken() { - return this.syncToken; - } - - /** - * Set the syncToken property: The Sync-Token property. - * - * @param syncToken the syncToken value to set. - * @return the DeleteLockHeaders object itself. - */ - @Generated - public DeleteLockHeaders setSyncToken(String syncToken) { - this.syncToken = syncToken; - return this; - } -} diff --git a/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/models/Error.java b/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/models/Error.java deleted file mode 100644 index 7d63d541ad65..000000000000 --- a/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/models/Error.java +++ /dev/null @@ -1,216 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.data.appconfiguration.implementation.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.Generated; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * Azure App Configuration error object. - */ -@Fluent -public final class Error implements JsonSerializable { - /* - * The type of the error. - */ - @Generated - private String type; - - /* - * A brief summary of the error. - */ - @Generated - private String title; - - /* - * The name of the parameter that resulted in the error. - */ - @Generated - private String name; - - /* - * A detailed description of the error. - */ - @Generated - private String detail; - - /* - * The HTTP status code that the error maps to. - */ - @Generated - private Integer status; - - /** - * Creates an instance of Error class. - */ - @Generated - public Error() { - } - - /** - * Get the type property: The type of the error. - * - * @return the type value. - */ - @Generated - public String getType() { - return this.type; - } - - /** - * Set the type property: The type of the error. - * - * @param type the type value to set. - * @return the Error object itself. - */ - @Generated - public Error setType(String type) { - this.type = type; - return this; - } - - /** - * Get the title property: A brief summary of the error. - * - * @return the title value. - */ - @Generated - public String getTitle() { - return this.title; - } - - /** - * Set the title property: A brief summary of the error. - * - * @param title the title value to set. - * @return the Error object itself. - */ - @Generated - public Error setTitle(String title) { - this.title = title; - return this; - } - - /** - * Get the name property: The name of the parameter that resulted in the error. - * - * @return the name value. - */ - @Generated - public String getName() { - return this.name; - } - - /** - * Set the name property: The name of the parameter that resulted in the error. - * - * @param name the name value to set. - * @return the Error object itself. - */ - @Generated - public Error setName(String name) { - this.name = name; - return this; - } - - /** - * Get the detail property: A detailed description of the error. - * - * @return the detail value. - */ - @Generated - public String getDetail() { - return this.detail; - } - - /** - * Set the detail property: A detailed description of the error. - * - * @param detail the detail value to set. - * @return the Error object itself. - */ - @Generated - public Error setDetail(String detail) { - this.detail = detail; - return this; - } - - /** - * Get the status property: The HTTP status code that the error maps to. - * - * @return the status value. - */ - @Generated - public Integer getStatus() { - return this.status; - } - - /** - * Set the status property: The HTTP status code that the error maps to. - * - * @param status the status value to set. - * @return the Error object itself. - */ - @Generated - public Error setStatus(Integer status) { - this.status = status; - return this; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("type", this.type); - jsonWriter.writeStringField("title", this.title); - jsonWriter.writeStringField("name", this.name); - jsonWriter.writeStringField("detail", this.detail); - jsonWriter.writeNumberField("status", this.status); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of Error from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of Error if the JsonReader was pointing to an instance of it, or null if it was pointing to - * JSON null. - * @throws IOException If an error occurs while reading the Error. - */ - @Generated - public static Error fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - Error deserializedError = new Error(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("type".equals(fieldName)) { - deserializedError.type = reader.getString(); - } else if ("title".equals(fieldName)) { - deserializedError.title = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedError.name = reader.getString(); - } else if ("detail".equals(fieldName)) { - deserializedError.detail = reader.getString(); - } else if ("status".equals(fieldName)) { - deserializedError.status = reader.getNullable(JsonReader::getInt); - } else { - reader.skipChildren(); - } - } - - return deserializedError; - }); - } -} diff --git a/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/models/ErrorDetail.java b/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/models/ErrorDetail.java deleted file mode 100644 index 57a88809af54..000000000000 --- a/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/models/ErrorDetail.java +++ /dev/null @@ -1,193 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.data.appconfiguration.implementation.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.Generated; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; - -/** - * The details of an error. - */ -@Fluent -public final class ErrorDetail implements JsonSerializable { - /* - * One of a server-defined set of error codes. - */ - @Generated - private final String code; - - /* - * A human-readable representation of the error. - */ - @Generated - private final String message; - - /* - * An array of details about specific errors that led to this reported error. - */ - @Generated - private List details; - - /* - * An object containing more specific information than the current object about the error. - */ - @Generated - private InnerError innererror; - - /** - * Creates an instance of ErrorDetail class. - * - * @param code the code value to set. - * @param message the message value to set. - */ - @Generated - public ErrorDetail(String code, String message) { - this.code = code; - this.message = message; - } - - /** - * Get the code property: One of a server-defined set of error codes. - * - * @return the code value. - */ - @Generated - public String getCode() { - return this.code; - } - - /** - * Get the message property: A human-readable representation of the error. - * - * @return the message value. - */ - @Generated - public String getMessage() { - return this.message; - } - - /** - * Get the details property: An array of details about specific errors that led to this reported error. - * - * @return the details value. - */ - @Generated - public List getDetails() { - return this.details; - } - - /** - * Set the details property: An array of details about specific errors that led to this reported error. - * - * @param details the details value to set. - * @return the ErrorDetail object itself. - */ - @Generated - public ErrorDetail setDetails(List details) { - this.details = details; - return this; - } - - /** - * Get the innererror property: An object containing more specific information than the current object about the - * error. - * - * @return the innererror value. - */ - @Generated - public InnerError getInnererror() { - return this.innererror; - } - - /** - * Set the innererror property: An object containing more specific information than the current object about the - * error. - * - * @param innererror the innererror value to set. - * @return the ErrorDetail object itself. - */ - @Generated - public ErrorDetail setInnererror(InnerError innererror) { - this.innererror = innererror; - return this; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("code", this.code); - jsonWriter.writeStringField("message", this.message); - jsonWriter.writeArrayField("details", this.details, (writer, element) -> writer.writeJson(element)); - jsonWriter.writeJsonField("innererror", this.innererror); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ErrorDetail from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ErrorDetail if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the ErrorDetail. - */ - @Generated - public static ErrorDetail fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - boolean codeFound = false; - String code = null; - boolean messageFound = false; - String message = null; - List details = null; - InnerError innererror = null; - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("code".equals(fieldName)) { - code = reader.getString(); - codeFound = true; - } else if ("message".equals(fieldName)) { - message = reader.getString(); - messageFound = true; - } else if ("details".equals(fieldName)) { - details = reader.readArray(reader1 -> ErrorDetail.fromJson(reader1)); - } else if ("innererror".equals(fieldName)) { - innererror = InnerError.fromJson(reader); - } else { - reader.skipChildren(); - } - } - if (codeFound && messageFound) { - ErrorDetail deserializedErrorDetail = new ErrorDetail(code, message); - deserializedErrorDetail.details = details; - deserializedErrorDetail.innererror = innererror; - - return deserializedErrorDetail; - } - List missingProperties = new ArrayList<>(); - if (!codeFound) { - missingProperties.add("code"); - } - if (!messageFound) { - missingProperties.add("message"); - } - - throw new IllegalStateException( - "Missing required property/properties: " + String.join(", ", missingProperties)); - }); - } -} diff --git a/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/models/ErrorException.java b/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/models/ErrorException.java deleted file mode 100644 index 519c1fb12daf..000000000000 --- a/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/models/ErrorException.java +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.data.appconfiguration.implementation.models; - -import com.azure.core.exception.HttpResponseException; -import com.azure.core.http.HttpResponse; - -/** - * Exception thrown for an invalid response with Error information. - */ -public final class ErrorException extends HttpResponseException { - /** - * Initializes a new instance of the ErrorException class. - * - * @param message the exception message or the response content if a message is not available. - * @param response the HTTP response. - */ - public ErrorException(String message, HttpResponse response) { - super(message, response); - } - - /** - * Initializes a new instance of the ErrorException class. - * - * @param message the exception message or the response content if a message is not available. - * @param response the HTTP response. - * @param value the deserialized response value. - */ - public ErrorException(String message, HttpResponse response, Error value) { - super(message, response, value); - } - - /** - * {@inheritDoc} - */ - @Override - public Error getValue() { - return (Error) super.getValue(); - } -} diff --git a/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/models/GetKeyValueHeaders.java b/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/models/GetKeyValueHeaders.java deleted file mode 100644 index e168bf847945..000000000000 --- a/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/models/GetKeyValueHeaders.java +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.data.appconfiguration.implementation.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.Generated; -import com.azure.core.http.HttpHeaderName; -import com.azure.core.http.HttpHeaders; - -/** - * The GetKeyValueHeaders model. - */ -@Fluent -public final class GetKeyValueHeaders { - /* - * The ETag property. - */ - @Generated - private String eTag; - - /* - * The Sync-Token property. - */ - @Generated - private String syncToken; - - private static final HttpHeaderName SYNC_TOKEN = HttpHeaderName.fromString("Sync-Token"); - - // HttpHeaders containing the raw property values. - /** - * Creates an instance of GetKeyValueHeaders class. - * - * @param rawHeaders The raw HttpHeaders that will be used to create the property values. - */ - public GetKeyValueHeaders(HttpHeaders rawHeaders) { - this.eTag = rawHeaders.getValue(HttpHeaderName.ETAG); - this.syncToken = rawHeaders.getValue(SYNC_TOKEN); - } - - /** - * Get the eTag property: The ETag property. - * - * @return the eTag value. - */ - @Generated - public String getETag() { - return this.eTag; - } - - /** - * Set the eTag property: The ETag property. - * - * @param eTag the eTag value to set. - * @return the GetKeyValueHeaders object itself. - */ - @Generated - public GetKeyValueHeaders setETag(String eTag) { - this.eTag = eTag; - return this; - } - - /** - * Get the syncToken property: The Sync-Token property. - * - * @return the syncToken value. - */ - @Generated - public String getSyncToken() { - return this.syncToken; - } - - /** - * Set the syncToken property: The Sync-Token property. - * - * @param syncToken the syncToken value to set. - * @return the GetKeyValueHeaders object itself. - */ - @Generated - public GetKeyValueHeaders setSyncToken(String syncToken) { - this.syncToken = syncToken; - return this; - } -} diff --git a/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/models/GetKeyValuesHeaders.java b/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/models/GetKeyValuesHeaders.java deleted file mode 100644 index 68ed45c44f34..000000000000 --- a/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/models/GetKeyValuesHeaders.java +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.data.appconfiguration.implementation.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.Generated; -import com.azure.core.http.HttpHeaderName; -import com.azure.core.http.HttpHeaders; - -/** - * The GetKeyValuesHeaders model. - */ -@Fluent -public final class GetKeyValuesHeaders { - /* - * The ETag property. - */ - @Generated - private String eTag; - - /* - * The Sync-Token property. - */ - @Generated - private String syncToken; - - private static final HttpHeaderName SYNC_TOKEN = HttpHeaderName.fromString("Sync-Token"); - - // HttpHeaders containing the raw property values. - /** - * Creates an instance of GetKeyValuesHeaders class. - * - * @param rawHeaders The raw HttpHeaders that will be used to create the property values. - */ - public GetKeyValuesHeaders(HttpHeaders rawHeaders) { - this.eTag = rawHeaders.getValue(HttpHeaderName.ETAG); - this.syncToken = rawHeaders.getValue(SYNC_TOKEN); - } - - /** - * Get the eTag property: The ETag property. - * - * @return the eTag value. - */ - @Generated - public String getETag() { - return this.eTag; - } - - /** - * Set the eTag property: The ETag property. - * - * @param eTag the eTag value to set. - * @return the GetKeyValuesHeaders object itself. - */ - @Generated - public GetKeyValuesHeaders setETag(String eTag) { - this.eTag = eTag; - return this; - } - - /** - * Get the syncToken property: The Sync-Token property. - * - * @return the syncToken value. - */ - @Generated - public String getSyncToken() { - return this.syncToken; - } - - /** - * Set the syncToken property: The Sync-Token property. - * - * @param syncToken the syncToken value to set. - * @return the GetKeyValuesHeaders object itself. - */ - @Generated - public GetKeyValuesHeaders setSyncToken(String syncToken) { - this.syncToken = syncToken; - return this; - } -} diff --git a/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/models/GetKeyValuesNextHeaders.java b/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/models/GetKeyValuesNextHeaders.java deleted file mode 100644 index 35ae3e667901..000000000000 --- a/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/models/GetKeyValuesNextHeaders.java +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.data.appconfiguration.implementation.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.Generated; -import com.azure.core.http.HttpHeaderName; -import com.azure.core.http.HttpHeaders; - -/** - * The GetKeyValuesNextHeaders model. - */ -@Fluent -public final class GetKeyValuesNextHeaders { - /* - * The ETag property. - */ - @Generated - private String eTag; - - /* - * The Sync-Token property. - */ - @Generated - private String syncToken; - - private static final HttpHeaderName SYNC_TOKEN = HttpHeaderName.fromString("Sync-Token"); - - // HttpHeaders containing the raw property values. - /** - * Creates an instance of GetKeyValuesNextHeaders class. - * - * @param rawHeaders The raw HttpHeaders that will be used to create the property values. - */ - public GetKeyValuesNextHeaders(HttpHeaders rawHeaders) { - this.eTag = rawHeaders.getValue(HttpHeaderName.ETAG); - this.syncToken = rawHeaders.getValue(SYNC_TOKEN); - } - - /** - * Get the eTag property: The ETag property. - * - * @return the eTag value. - */ - @Generated - public String getETag() { - return this.eTag; - } - - /** - * Set the eTag property: The ETag property. - * - * @param eTag the eTag value to set. - * @return the GetKeyValuesNextHeaders object itself. - */ - @Generated - public GetKeyValuesNextHeaders setETag(String eTag) { - this.eTag = eTag; - return this; - } - - /** - * Get the syncToken property: The Sync-Token property. - * - * @return the syncToken value. - */ - @Generated - public String getSyncToken() { - return this.syncToken; - } - - /** - * Set the syncToken property: The Sync-Token property. - * - * @param syncToken the syncToken value to set. - * @return the GetKeyValuesNextHeaders object itself. - */ - @Generated - public GetKeyValuesNextHeaders setSyncToken(String syncToken) { - this.syncToken = syncToken; - return this; - } -} diff --git a/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/models/GetKeysHeaders.java b/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/models/GetKeysHeaders.java deleted file mode 100644 index 81671fafbd53..000000000000 --- a/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/models/GetKeysHeaders.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.data.appconfiguration.implementation.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.Generated; -import com.azure.core.http.HttpHeaderName; -import com.azure.core.http.HttpHeaders; - -/** - * The GetKeysHeaders model. - */ -@Fluent -public final class GetKeysHeaders { - /* - * The Sync-Token property. - */ - @Generated - private String syncToken; - - private static final HttpHeaderName SYNC_TOKEN = HttpHeaderName.fromString("Sync-Token"); - - // HttpHeaders containing the raw property values. - /** - * Creates an instance of GetKeysHeaders class. - * - * @param rawHeaders The raw HttpHeaders that will be used to create the property values. - */ - public GetKeysHeaders(HttpHeaders rawHeaders) { - this.syncToken = rawHeaders.getValue(SYNC_TOKEN); - } - - /** - * Get the syncToken property: The Sync-Token property. - * - * @return the syncToken value. - */ - @Generated - public String getSyncToken() { - return this.syncToken; - } - - /** - * Set the syncToken property: The Sync-Token property. - * - * @param syncToken the syncToken value to set. - * @return the GetKeysHeaders object itself. - */ - @Generated - public GetKeysHeaders setSyncToken(String syncToken) { - this.syncToken = syncToken; - return this; - } -} diff --git a/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/models/GetKeysNextHeaders.java b/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/models/GetKeysNextHeaders.java deleted file mode 100644 index d8e612809629..000000000000 --- a/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/models/GetKeysNextHeaders.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.data.appconfiguration.implementation.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.Generated; -import com.azure.core.http.HttpHeaderName; -import com.azure.core.http.HttpHeaders; - -/** - * The GetKeysNextHeaders model. - */ -@Fluent -public final class GetKeysNextHeaders { - /* - * The Sync-Token property. - */ - @Generated - private String syncToken; - - private static final HttpHeaderName SYNC_TOKEN = HttpHeaderName.fromString("Sync-Token"); - - // HttpHeaders containing the raw property values. - /** - * Creates an instance of GetKeysNextHeaders class. - * - * @param rawHeaders The raw HttpHeaders that will be used to create the property values. - */ - public GetKeysNextHeaders(HttpHeaders rawHeaders) { - this.syncToken = rawHeaders.getValue(SYNC_TOKEN); - } - - /** - * Get the syncToken property: The Sync-Token property. - * - * @return the syncToken value. - */ - @Generated - public String getSyncToken() { - return this.syncToken; - } - - /** - * Set the syncToken property: The Sync-Token property. - * - * @param syncToken the syncToken value to set. - * @return the GetKeysNextHeaders object itself. - */ - @Generated - public GetKeysNextHeaders setSyncToken(String syncToken) { - this.syncToken = syncToken; - return this; - } -} diff --git a/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/models/GetLabelsHeaders.java b/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/models/GetLabelsHeaders.java deleted file mode 100644 index cdd7bc67773c..000000000000 --- a/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/models/GetLabelsHeaders.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.data.appconfiguration.implementation.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.Generated; -import com.azure.core.http.HttpHeaderName; -import com.azure.core.http.HttpHeaders; - -/** - * The GetLabelsHeaders model. - */ -@Fluent -public final class GetLabelsHeaders { - /* - * The Sync-Token property. - */ - @Generated - private String syncToken; - - private static final HttpHeaderName SYNC_TOKEN = HttpHeaderName.fromString("Sync-Token"); - - // HttpHeaders containing the raw property values. - /** - * Creates an instance of GetLabelsHeaders class. - * - * @param rawHeaders The raw HttpHeaders that will be used to create the property values. - */ - public GetLabelsHeaders(HttpHeaders rawHeaders) { - this.syncToken = rawHeaders.getValue(SYNC_TOKEN); - } - - /** - * Get the syncToken property: The Sync-Token property. - * - * @return the syncToken value. - */ - @Generated - public String getSyncToken() { - return this.syncToken; - } - - /** - * Set the syncToken property: The Sync-Token property. - * - * @param syncToken the syncToken value to set. - * @return the GetLabelsHeaders object itself. - */ - @Generated - public GetLabelsHeaders setSyncToken(String syncToken) { - this.syncToken = syncToken; - return this; - } -} diff --git a/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/models/GetLabelsNextHeaders.java b/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/models/GetLabelsNextHeaders.java deleted file mode 100644 index d2277a308b59..000000000000 --- a/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/models/GetLabelsNextHeaders.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.data.appconfiguration.implementation.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.Generated; -import com.azure.core.http.HttpHeaderName; -import com.azure.core.http.HttpHeaders; - -/** - * The GetLabelsNextHeaders model. - */ -@Fluent -public final class GetLabelsNextHeaders { - /* - * The Sync-Token property. - */ - @Generated - private String syncToken; - - private static final HttpHeaderName SYNC_TOKEN = HttpHeaderName.fromString("Sync-Token"); - - // HttpHeaders containing the raw property values. - /** - * Creates an instance of GetLabelsNextHeaders class. - * - * @param rawHeaders The raw HttpHeaders that will be used to create the property values. - */ - public GetLabelsNextHeaders(HttpHeaders rawHeaders) { - this.syncToken = rawHeaders.getValue(SYNC_TOKEN); - } - - /** - * Get the syncToken property: The Sync-Token property. - * - * @return the syncToken value. - */ - @Generated - public String getSyncToken() { - return this.syncToken; - } - - /** - * Set the syncToken property: The Sync-Token property. - * - * @param syncToken the syncToken value to set. - * @return the GetLabelsNextHeaders object itself. - */ - @Generated - public GetLabelsNextHeaders setSyncToken(String syncToken) { - this.syncToken = syncToken; - return this; - } -} diff --git a/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/models/GetRevisionsHeaders.java b/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/models/GetRevisionsHeaders.java deleted file mode 100644 index 3db92cabef16..000000000000 --- a/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/models/GetRevisionsHeaders.java +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.data.appconfiguration.implementation.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.Generated; -import com.azure.core.http.HttpHeaderName; -import com.azure.core.http.HttpHeaders; - -/** - * The GetRevisionsHeaders model. - */ -@Fluent -public final class GetRevisionsHeaders { - /* - * The ETag property. - */ - @Generated - private String eTag; - - /* - * The Sync-Token property. - */ - @Generated - private String syncToken; - - private static final HttpHeaderName SYNC_TOKEN = HttpHeaderName.fromString("Sync-Token"); - - // HttpHeaders containing the raw property values. - /** - * Creates an instance of GetRevisionsHeaders class. - * - * @param rawHeaders The raw HttpHeaders that will be used to create the property values. - */ - public GetRevisionsHeaders(HttpHeaders rawHeaders) { - this.eTag = rawHeaders.getValue(HttpHeaderName.ETAG); - this.syncToken = rawHeaders.getValue(SYNC_TOKEN); - } - - /** - * Get the eTag property: The ETag property. - * - * @return the eTag value. - */ - @Generated - public String getETag() { - return this.eTag; - } - - /** - * Set the eTag property: The ETag property. - * - * @param eTag the eTag value to set. - * @return the GetRevisionsHeaders object itself. - */ - @Generated - public GetRevisionsHeaders setETag(String eTag) { - this.eTag = eTag; - return this; - } - - /** - * Get the syncToken property: The Sync-Token property. - * - * @return the syncToken value. - */ - @Generated - public String getSyncToken() { - return this.syncToken; - } - - /** - * Set the syncToken property: The Sync-Token property. - * - * @param syncToken the syncToken value to set. - * @return the GetRevisionsHeaders object itself. - */ - @Generated - public GetRevisionsHeaders setSyncToken(String syncToken) { - this.syncToken = syncToken; - return this; - } -} diff --git a/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/models/GetRevisionsNextHeaders.java b/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/models/GetRevisionsNextHeaders.java deleted file mode 100644 index ce3543922197..000000000000 --- a/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/models/GetRevisionsNextHeaders.java +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.data.appconfiguration.implementation.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.Generated; -import com.azure.core.http.HttpHeaderName; -import com.azure.core.http.HttpHeaders; - -/** - * The GetRevisionsNextHeaders model. - */ -@Fluent -public final class GetRevisionsNextHeaders { - /* - * The ETag property. - */ - @Generated - private String eTag; - - /* - * The Sync-Token property. - */ - @Generated - private String syncToken; - - private static final HttpHeaderName SYNC_TOKEN = HttpHeaderName.fromString("Sync-Token"); - - // HttpHeaders containing the raw property values. - /** - * Creates an instance of GetRevisionsNextHeaders class. - * - * @param rawHeaders The raw HttpHeaders that will be used to create the property values. - */ - public GetRevisionsNextHeaders(HttpHeaders rawHeaders) { - this.eTag = rawHeaders.getValue(HttpHeaderName.ETAG); - this.syncToken = rawHeaders.getValue(SYNC_TOKEN); - } - - /** - * Get the eTag property: The ETag property. - * - * @return the eTag value. - */ - @Generated - public String getETag() { - return this.eTag; - } - - /** - * Set the eTag property: The ETag property. - * - * @param eTag the eTag value to set. - * @return the GetRevisionsNextHeaders object itself. - */ - @Generated - public GetRevisionsNextHeaders setETag(String eTag) { - this.eTag = eTag; - return this; - } - - /** - * Get the syncToken property: The Sync-Token property. - * - * @return the syncToken value. - */ - @Generated - public String getSyncToken() { - return this.syncToken; - } - - /** - * Set the syncToken property: The Sync-Token property. - * - * @param syncToken the syncToken value to set. - * @return the GetRevisionsNextHeaders object itself. - */ - @Generated - public GetRevisionsNextHeaders setSyncToken(String syncToken) { - this.syncToken = syncToken; - return this; - } -} diff --git a/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/models/GetSnapshotHeaders.java b/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/models/GetSnapshotHeaders.java deleted file mode 100644 index b8c42f50c76e..000000000000 --- a/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/models/GetSnapshotHeaders.java +++ /dev/null @@ -1,114 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.data.appconfiguration.implementation.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.Generated; -import com.azure.core.http.HttpHeaderName; -import com.azure.core.http.HttpHeaders; - -/** - * The GetSnapshotHeaders model. - */ -@Fluent -public final class GetSnapshotHeaders { - /* - * The ETag property. - */ - @Generated - private String eTag; - - /* - * The Sync-Token property. - */ - @Generated - private String syncToken; - - /* - * The Link property. - */ - @Generated - private String link; - - private static final HttpHeaderName SYNC_TOKEN = HttpHeaderName.fromString("Sync-Token"); - - // HttpHeaders containing the raw property values. - /** - * Creates an instance of GetSnapshotHeaders class. - * - * @param rawHeaders The raw HttpHeaders that will be used to create the property values. - */ - public GetSnapshotHeaders(HttpHeaders rawHeaders) { - this.eTag = rawHeaders.getValue(HttpHeaderName.ETAG); - this.syncToken = rawHeaders.getValue(SYNC_TOKEN); - this.link = rawHeaders.getValue(HttpHeaderName.LINK); - } - - /** - * Get the eTag property: The ETag property. - * - * @return the eTag value. - */ - @Generated - public String getETag() { - return this.eTag; - } - - /** - * Set the eTag property: The ETag property. - * - * @param eTag the eTag value to set. - * @return the GetSnapshotHeaders object itself. - */ - @Generated - public GetSnapshotHeaders setETag(String eTag) { - this.eTag = eTag; - return this; - } - - /** - * Get the syncToken property: The Sync-Token property. - * - * @return the syncToken value. - */ - @Generated - public String getSyncToken() { - return this.syncToken; - } - - /** - * Set the syncToken property: The Sync-Token property. - * - * @param syncToken the syncToken value to set. - * @return the GetSnapshotHeaders object itself. - */ - @Generated - public GetSnapshotHeaders setSyncToken(String syncToken) { - this.syncToken = syncToken; - return this; - } - - /** - * Get the link property: The Link property. - * - * @return the link value. - */ - @Generated - public String getLink() { - return this.link; - } - - /** - * Set the link property: The Link property. - * - * @param link the link value to set. - * @return the GetSnapshotHeaders object itself. - */ - @Generated - public GetSnapshotHeaders setLink(String link) { - this.link = link; - return this; - } -} diff --git a/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/models/GetSnapshotsHeaders.java b/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/models/GetSnapshotsHeaders.java deleted file mode 100644 index e5f3d50c7f9d..000000000000 --- a/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/models/GetSnapshotsHeaders.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.data.appconfiguration.implementation.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.Generated; -import com.azure.core.http.HttpHeaderName; -import com.azure.core.http.HttpHeaders; - -/** - * The GetSnapshotsHeaders model. - */ -@Fluent -public final class GetSnapshotsHeaders { - /* - * The Sync-Token property. - */ - @Generated - private String syncToken; - - private static final HttpHeaderName SYNC_TOKEN = HttpHeaderName.fromString("Sync-Token"); - - // HttpHeaders containing the raw property values. - /** - * Creates an instance of GetSnapshotsHeaders class. - * - * @param rawHeaders The raw HttpHeaders that will be used to create the property values. - */ - public GetSnapshotsHeaders(HttpHeaders rawHeaders) { - this.syncToken = rawHeaders.getValue(SYNC_TOKEN); - } - - /** - * Get the syncToken property: The Sync-Token property. - * - * @return the syncToken value. - */ - @Generated - public String getSyncToken() { - return this.syncToken; - } - - /** - * Set the syncToken property: The Sync-Token property. - * - * @param syncToken the syncToken value to set. - * @return the GetSnapshotsHeaders object itself. - */ - @Generated - public GetSnapshotsHeaders setSyncToken(String syncToken) { - this.syncToken = syncToken; - return this; - } -} diff --git a/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/models/GetSnapshotsNextHeaders.java b/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/models/GetSnapshotsNextHeaders.java deleted file mode 100644 index 7903b2d8179e..000000000000 --- a/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/models/GetSnapshotsNextHeaders.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.data.appconfiguration.implementation.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.Generated; -import com.azure.core.http.HttpHeaderName; -import com.azure.core.http.HttpHeaders; - -/** - * The GetSnapshotsNextHeaders model. - */ -@Fluent -public final class GetSnapshotsNextHeaders { - /* - * The Sync-Token property. - */ - @Generated - private String syncToken; - - private static final HttpHeaderName SYNC_TOKEN = HttpHeaderName.fromString("Sync-Token"); - - // HttpHeaders containing the raw property values. - /** - * Creates an instance of GetSnapshotsNextHeaders class. - * - * @param rawHeaders The raw HttpHeaders that will be used to create the property values. - */ - public GetSnapshotsNextHeaders(HttpHeaders rawHeaders) { - this.syncToken = rawHeaders.getValue(SYNC_TOKEN); - } - - /** - * Get the syncToken property: The Sync-Token property. - * - * @return the syncToken value. - */ - @Generated - public String getSyncToken() { - return this.syncToken; - } - - /** - * Set the syncToken property: The Sync-Token property. - * - * @param syncToken the syncToken value to set. - * @return the GetSnapshotsNextHeaders object itself. - */ - @Generated - public GetSnapshotsNextHeaders setSyncToken(String syncToken) { - this.syncToken = syncToken; - return this; - } -} diff --git a/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/models/InnerError.java b/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/models/InnerError.java deleted file mode 100644 index 68275f9fd5b2..000000000000 --- a/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/models/InnerError.java +++ /dev/null @@ -1,125 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.data.appconfiguration.implementation.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.Generated; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * An object containing specific information about an error. - */ -@Fluent -public final class InnerError implements JsonSerializable { - /* - * One of a server-defined set of error codes. - */ - @Generated - private String code; - - /* - * An object containing more specific information than the current object about the error. - */ - @Generated - private InnerError innererror; - - /** - * Creates an instance of InnerError class. - */ - @Generated - public InnerError() { - } - - /** - * Get the code property: One of a server-defined set of error codes. - * - * @return the code value. - */ - @Generated - public String getCode() { - return this.code; - } - - /** - * Set the code property: One of a server-defined set of error codes. - * - * @param code the code value to set. - * @return the InnerError object itself. - */ - @Generated - public InnerError setCode(String code) { - this.code = code; - return this; - } - - /** - * Get the innererror property: An object containing more specific information than the current object about the - * error. - * - * @return the innererror value. - */ - @Generated - public InnerError getInnererror() { - return this.innererror; - } - - /** - * Set the innererror property: An object containing more specific information than the current object about the - * error. - * - * @param innererror the innererror value to set. - * @return the InnerError object itself. - */ - @Generated - public InnerError setInnererror(InnerError innererror) { - this.innererror = innererror; - return this; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("code", this.code); - jsonWriter.writeJsonField("innererror", this.innererror); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of InnerError from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of InnerError if the JsonReader was pointing to an instance of it, or null if it was pointing - * to JSON null. - * @throws IOException If an error occurs while reading the InnerError. - */ - @Generated - public static InnerError fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - InnerError deserializedInnerError = new InnerError(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("code".equals(fieldName)) { - deserializedInnerError.code = reader.getString(); - } else if ("innererror".equals(fieldName)) { - deserializedInnerError.innererror = InnerError.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedInnerError; - }); - } -} diff --git a/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/models/Key.java b/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/models/Key.java index 9f993599ef13..06eebfae79bd 100644 --- a/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/models/Key.java +++ b/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/models/Key.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.data.appconfiguration.implementation.models; @@ -13,7 +13,7 @@ import java.io.IOException; /** - * The Key model. + * Keys serve as identifiers for key-values and are used to store and retrieve corresponding values. */ @Immutable public final class Key implements JsonSerializable { @@ -27,7 +27,7 @@ public final class Key implements JsonSerializable { * Creates an instance of Key class. */ @Generated - public Key() { + private Key() { } /** @@ -56,6 +56,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of Key if the JsonReader was pointing to an instance of it, or null if it was pointing to * JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. * @throws IOException If an error occurs while reading the Key. */ @Generated diff --git a/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/models/KeyListResult.java b/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/models/KeyListResult.java deleted file mode 100644 index f5da725dfa41..000000000000 --- a/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/models/KeyListResult.java +++ /dev/null @@ -1,125 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.data.appconfiguration.implementation.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.Generated; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.List; - -/** - * The result of a list request. - */ -@Fluent -public final class KeyListResult implements JsonSerializable { - /* - * The collection value. - */ - @Generated - private List items; - - /* - * The URI that can be used to request the next set of paged results. - */ - @Generated - private String nextLink; - - /** - * Creates an instance of KeyListResult class. - */ - @Generated - public KeyListResult() { - } - - /** - * Get the items property: The collection value. - * - * @return the items value. - */ - @Generated - public List getItems() { - return this.items; - } - - /** - * Set the items property: The collection value. - * - * @param items the items value to set. - * @return the KeyListResult object itself. - */ - @Generated - public KeyListResult setItems(List items) { - this.items = items; - return this; - } - - /** - * Get the nextLink property: The URI that can be used to request the next set of paged results. - * - * @return the nextLink value. - */ - @Generated - public String getNextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: The URI that can be used to request the next set of paged results. - * - * @param nextLink the nextLink value to set. - * @return the KeyListResult object itself. - */ - @Generated - public KeyListResult setNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("items", this.items, (writer, element) -> writer.writeJson(element)); - jsonWriter.writeStringField("@nextLink", this.nextLink); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of KeyListResult from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of KeyListResult if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IOException If an error occurs while reading the KeyListResult. - */ - @Generated - public static KeyListResult fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - KeyListResult deserializedKeyListResult = new KeyListResult(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("items".equals(fieldName)) { - List items = reader.readArray(reader1 -> Key.fromJson(reader1)); - deserializedKeyListResult.items = items; - } else if ("@nextLink".equals(fieldName)) { - deserializedKeyListResult.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedKeyListResult; - }); - } -} diff --git a/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/models/KeyValue.java b/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/models/KeyValue.java index a09316447748..3a8f53dfcea0 100644 --- a/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/models/KeyValue.java +++ b/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/models/KeyValue.java @@ -1,9 +1,14 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.data.appconfiguration.implementation.models; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.Map; + import com.azure.core.annotation.Fluent; import com.azure.core.annotation.Generated; import com.azure.core.util.CoreUtils; @@ -11,13 +16,9 @@ import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; -import java.io.IOException; -import java.time.OffsetDateTime; -import java.time.format.DateTimeFormatter; -import java.util.Map; /** - * The KeyValue model. + * A key-value pair representing application settings. */ @Fluent public final class KeyValue implements JsonSerializable { @@ -76,28 +77,27 @@ public final class KeyValue implements JsonSerializable { public KeyValue() { } - /** - * Get the key property: The key of the key-value. - * - * @return the key value. - */ - @Generated - public String getKey() { - return this.key; - } - /** * Set the key property: The key of the key-value. - * + * * @param key the key value to set. * @return the KeyValue object itself. */ - @Generated public KeyValue setKey(String key) { this.key = key; return this; } + /** + * Get the key property: The key of the key-value. + * + * @return the key value. + */ + @Generated + public String getKey() { + return this.key; + } + /** * Get the label property: The label the key-value belongs to. * @@ -259,7 +259,6 @@ public KeyValue setEtag(String etag) { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("key", this.key); jsonWriter.writeStringField("label", this.label); jsonWriter.writeStringField("content_type", this.contentType); jsonWriter.writeStringField("value", this.value); @@ -277,6 +276,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of KeyValue if the JsonReader was pointing to an instance of it, or null if it was pointing * to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. * @throws IOException If an error occurs while reading the KeyValue. */ @Generated diff --git a/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/models/KeyValueFields.java b/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/models/KeyValueFields.java new file mode 100644 index 000000000000..2d098f761738 --- /dev/null +++ b/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/models/KeyValueFields.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.data.appconfiguration.implementation.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Key-value fields. + */ +public final class KeyValueFields extends ExpandableStringEnum { + /** + * Key field. + */ + @Generated + public static final KeyValueFields KEY = fromString("key"); + + /** + * Label field. + */ + @Generated + public static final KeyValueFields LABEL = fromString("label"); + + /** + * Content type field. + */ + @Generated + public static final KeyValueFields CONTENT_TYPE = fromString("content_type"); + + /** + * Value field. + */ + @Generated + public static final KeyValueFields VALUE = fromString("value"); + + /** + * Last modified field. + */ + @Generated + public static final KeyValueFields LAST_MODIFIED = fromString("last_modified"); + + /** + * Tags field. + */ + @Generated + public static final KeyValueFields TAGS = fromString("tags"); + + /** + * Locked field. + */ + @Generated + public static final KeyValueFields LOCKED = fromString("locked"); + + /** + * Etag field. + */ + @Generated + public static final KeyValueFields ETAG = fromString("etag"); + + /** + * Creates a new instance of KeyValueFields value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public KeyValueFields() { + } + + /** + * Creates or finds a KeyValueFields from its string representation. + * + * @param name a name to look for. + * @return the corresponding KeyValueFields. + */ + @Generated + public static KeyValueFields fromString(String name) { + return fromString(name, KeyValueFields.class); + } + + /** + * Gets known KeyValueFields values. + * + * @return known KeyValueFields values. + */ + @Generated + public static Collection values() { + return values(KeyValueFields.class); + } +} diff --git a/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/models/KeyValueFilter.java b/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/models/KeyValueFilter.java new file mode 100644 index 000000000000..5e5dfd3d0b84 --- /dev/null +++ b/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/models/KeyValueFilter.java @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.data.appconfiguration.implementation.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Enables filtering of key-values. Syntax reference: + * https://aka.ms/azconfig/docs/restapisnapshots. + */ +@Fluent +public final class KeyValueFilter implements JsonSerializable { + /* + * Filters key-values by their key field. + */ + @Generated + private final String key; + + /* + * Filters key-values by their label field. + */ + @Generated + private String label; + + /* + * Filters key-values by their tags field. + */ + @Generated + private List tags; + + /** + * Creates an instance of KeyValueFilter class. + * + * @param key the key value to set. + */ + @Generated + public KeyValueFilter(String key) { + this.key = key; + } + + /** + * Get the key property: Filters key-values by their key field. + * + * @return the key value. + */ + @Generated + public String getKey() { + return this.key; + } + + /** + * Get the label property: Filters key-values by their label field. + * + * @return the label value. + */ + @Generated + public String getLabel() { + return this.label; + } + + /** + * Set the label property: Filters key-values by their label field. + * + * @param label the label value to set. + * @return the KeyValueFilter object itself. + */ + @Generated + public KeyValueFilter setLabel(String label) { + this.label = label; + return this; + } + + /** + * Get the tags property: Filters key-values by their tags field. + * + * @return the tags value. + */ + @Generated + public List getTags() { + return this.tags; + } + + /** + * Set the tags property: Filters key-values by their tags field. + * + * @param tags the tags value to set. + * @return the KeyValueFilter object itself. + */ + @Generated + public KeyValueFilter setTags(List tags) { + this.tags = tags; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("key", this.key); + jsonWriter.writeStringField("label", this.label); + jsonWriter.writeArrayField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of KeyValueFilter from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of KeyValueFilter if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the KeyValueFilter. + */ + @Generated + public static KeyValueFilter fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String key = null; + String label = null; + List tags = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("key".equals(fieldName)) { + key = reader.getString(); + } else if ("label".equals(fieldName)) { + label = reader.getString(); + } else if ("tags".equals(fieldName)) { + tags = reader.readArray(reader1 -> reader1.getString()); + } else { + reader.skipChildren(); + } + } + KeyValueFilter deserializedKeyValueFilter = new KeyValueFilter(key); + deserializedKeyValueFilter.label = label; + deserializedKeyValueFilter.tags = tags; + + return deserializedKeyValueFilter; + }); + } +} diff --git a/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/models/KeyValueListResult.java b/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/models/KeyValueListResult.java deleted file mode 100644 index d20839f9c8e5..000000000000 --- a/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/models/KeyValueListResult.java +++ /dev/null @@ -1,156 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.data.appconfiguration.implementation.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.Generated; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; -import java.util.List; - -/** - * The result of a list request. - */ -@Fluent -public final class KeyValueListResult implements JsonSerializable { - /* - * The collection value. - */ - @Generated - private List items; - - /* - * An identifier representing the returned state of the resource. - */ - @Generated - private String etag; - - /* - * The URI that can be used to request the next set of paged results. - */ - @Generated - private String nextLink; - - /** - * Creates an instance of KeyValueListResult class. - */ - @Generated - public KeyValueListResult() { - } - - /** - * Get the items property: The collection value. - * - * @return the items value. - */ - @Generated - public List getItems() { - return this.items; - } - - /** - * Set the items property: The collection value. - * - * @param items the items value to set. - * @return the KeyValueListResult object itself. - */ - @Generated - public KeyValueListResult setItems(List items) { - this.items = items; - return this; - } - - /** - * Get the etag property: An identifier representing the returned state of the resource. - * - * @return the etag value. - */ - @Generated - public String getEtag() { - return this.etag; - } - - /** - * Set the etag property: An identifier representing the returned state of the resource. - * - * @param etag the etag value to set. - * @return the KeyValueListResult object itself. - */ - @Generated - public KeyValueListResult setEtag(String etag) { - this.etag = etag; - return this; - } - - /** - * Get the nextLink property: The URI that can be used to request the next set of paged results. - * - * @return the nextLink value. - */ - @Generated - public String getNextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: The URI that can be used to request the next set of paged results. - * - * @param nextLink the nextLink value to set. - * @return the KeyValueListResult object itself. - */ - @Generated - public KeyValueListResult setNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * {@inheritDoc} - */ - @Generated - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("items", this.items, (writer, element) -> writer.writeJson(element)); - jsonWriter.writeStringField("etag", this.etag); - jsonWriter.writeStringField("@nextLink", this.nextLink); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of KeyValueListResult from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of KeyValueListResult if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. - * @throws IOException If an error occurs while reading the KeyValueListResult. - */ - @Generated - public static KeyValueListResult fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - KeyValueListResult deserializedKeyValueListResult = new KeyValueListResult(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("items".equals(fieldName)) { - List items = reader.readArray(reader1 -> KeyValue.fromJson(reader1)); - deserializedKeyValueListResult.items = items; - } else if ("etag".equals(fieldName)) { - deserializedKeyValueListResult.etag = reader.getString(); - } else if ("@nextLink".equals(fieldName)) { - deserializedKeyValueListResult.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedKeyValueListResult; - }); - } -} diff --git a/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/models/Label.java b/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/models/Label.java new file mode 100644 index 000000000000..bdd1812f20df --- /dev/null +++ b/sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/models/Label.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.data.appconfiguration.implementation.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Labels are used to group key-values. + */ +@Immutable +public final class Label implements JsonSerializable