Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import com.azure.applicationconfig.models.SettingFields;
import com.azure.applicationconfig.models.SettingSelector;
import com.azure.core.ServiceClient;
import com.azure.core.exception.HttpRequestException;
import com.azure.core.exception.HttpResponseException;
import com.azure.core.exception.ResourceModifiedException;
import com.azure.core.exception.ResourceNotFoundException;
import com.azure.core.http.HttpPipeline;
Expand Down Expand Up @@ -91,10 +91,10 @@ public static ConfigurationAsyncClientBuilder builder() {
* @param key The key of the configuration setting to add.
* @param value The value associated with this configuration setting key.
* @return The {@link ConfigurationSetting} that was created, or {@code null}, if a key collision occurs or the key
* is an invalid value (which will also throw HttpRequestException described below).
* is an invalid value (which will also throw HttpResponseException described below).
* @throws IllegalArgumentException If {@code key} is {@code null}.
* @throws ResourceModifiedException If a ConfigurationSetting with the same key exists.
* @throws HttpRequestException If {@code key} is an empty string.
* @throws HttpResponseException If {@code key} is an empty string.
*/
public Mono<Response<ConfigurationSetting>> addSetting(String key, String value) {
return addSetting(new ConfigurationSetting().key(key).value(value));
Expand All @@ -117,11 +117,11 @@ public Mono<Response<ConfigurationSetting>> addSetting(String key, String value)
*
* @param setting The setting to add to the configuration service.
* @return The {@link ConfigurationSetting} that was created, or {@code null}, if a key collision occurs or the key
* is an invalid value (which will also throw HttpRequestException described below).
* is an invalid value (which will also throw HttpResponseException described below).
* @throws NullPointerException If {@code setting} is {@code null}.
* @throws IllegalArgumentException If {@link ConfigurationSetting#key() key} is {@code null}.
* @throws ResourceModifiedException If a ConfigurationSetting with the same key and label exists.
* @throws HttpRequestException If {@code key} is an empty string.
* @throws HttpResponseException If {@code key} is an empty string.
*/
public Mono<Response<ConfigurationSetting>> addSetting(ConfigurationSetting setting) {
// Validate that setting and key is not null. The key is used in the service URL so it cannot be null.
Expand Down Expand Up @@ -162,10 +162,10 @@ public Mono<Response<ConfigurationSetting>> addSetting(ConfigurationSetting sett
* @param key The key of the configuration setting to create or update.
* @param value The value of this configuration setting.
* @return The {@link ConfigurationSetting} that was created or updated, or {@code null}, if the key is an invalid
* value (which will also throw HttpRequestException described below).
* value (which will also throw HttpResponseException described below).
* @throws IllegalArgumentException If {@code key} is {@code null}.
* @throws ResourceModifiedException If the setting exists and is locked.
* @throws HttpRequestException If {@code key} is an empty string.
* @throws HttpResponseException If {@code key} is an empty string.
*/
public Mono<Response<ConfigurationSetting>> setSetting(String key, String value) {
return setSetting(new ConfigurationSetting().key(key).value(value));
Expand Down Expand Up @@ -202,13 +202,13 @@ public Mono<Response<ConfigurationSetting>> setSetting(String key, String value)
* @param setting The configuration setting to create or update.
* @return The {@link ConfigurationSetting} that was created or updated, or {@code null}, if the key is an invalid
* value, the setting is locked, or an etag was provided but does not match the service's current etag value (which
* will also throw HttpRequestException described below).
* will also throw HttpResponseException described below).
* @throws NullPointerException If {@code setting} is {@code null}.
* @throws IllegalArgumentException If {@link ConfigurationSetting#key() key} is {@code null}.
* @throws ResourceModifiedException If the {@link ConfigurationSetting#etag() etag} was specified, is not the
* wildcard character, and the current configuration value's etag does not match, or the
* setting exists and is locked.
* @throws HttpRequestException If {@code key} is an empty string.
* @throws HttpResponseException If {@code key} is an empty string.
*/
public Mono<Response<ConfigurationSetting>> setSetting(ConfigurationSetting setting) {
// Validate that setting and key is not null. The key is used in the service URL so it cannot be null.
Expand Down Expand Up @@ -243,11 +243,11 @@ public Mono<Response<ConfigurationSetting>> setSetting(ConfigurationSetting sett
* @param key The key of the configuration setting to update.
* @param value The updated value of this configuration setting.
* @return The {@link ConfigurationSetting} that was updated, or {@code null}, if the configuration value does not
* exist, is locked, or the key is an invalid value (which will also throw HttpRequestException described below).
* exist, is locked, or the key is an invalid value (which will also throw HttpResponseException described below).
* @throws IllegalArgumentException If {@code key} is {@code null}.
* @throws HttpRequestException If a ConfigurationSetting with the key does not exist or the configuration value
* @throws HttpResponseException If a ConfigurationSetting with the key does not exist or the configuration value
* is locked.
* @throws HttpRequestException If {@code key} is an empty string.
* @throws HttpResponseException If {@code key} is an empty string.
*/
public Mono<Response<ConfigurationSetting>> updateSetting(String key, String value) {
return updateSetting(new ConfigurationSetting().key(key).value(value));
Expand All @@ -272,13 +272,13 @@ public Mono<Response<ConfigurationSetting>> updateSetting(String key, String val
*
* @param setting The setting to add or update in the service.
* @return The {@link ConfigurationSetting} that was updated, or {@code null}, if the configuration value does not
* exist, is locked, or the key is an invalid value (which will also throw HttpRequestException described below).
* exist, is locked, or the key is an invalid value (which will also throw HttpResponseException described below).
* @throws NullPointerException If {@code setting} is {@code null}.
* @throws IllegalArgumentException If {@link ConfigurationSetting#key() key} is {@code null}.
* @throws ResourceModifiedException If a ConfigurationSetting with the same key and label does not
* exist, the setting is locked, or {@link ConfigurationSetting#etag() etag} is specified but does not match
* the current value.
* @throws HttpRequestException If {@code key} is an empty string.
* @throws HttpResponseException If {@code key} is an empty string.
*/
public Mono<Response<ConfigurationSetting>> updateSetting(ConfigurationSetting setting) {
// Validate that setting and key is not null. The key is used in the service URL so it cannot be null.
Expand Down Expand Up @@ -308,10 +308,10 @@ public Mono<Response<ConfigurationSetting>> updateSetting(ConfigurationSetting s
*
* @param key The key of the setting to retrieve.
* @return The {@link ConfigurationSetting} stored in the service, or {@code null}, if the configuration value does
* not exist or the key is an invalid value (which will also throw HttpRequestException described below).
* not exist or the key is an invalid value (which will also throw HttpResponseException described below).
* @throws IllegalArgumentException If {@code key} is {@code null}.
* @throws ResourceNotFoundException If a ConfigurationSetting with {@code key} does not exist.
* @throws HttpRequestException If {@code key} is an empty string.
* @throws HttpResponseException If {@code key} is an empty string.
*/
public Mono<Response<ConfigurationSetting>> getSetting(String key) {
return getSetting(new ConfigurationSetting().key(key));
Expand All @@ -333,11 +333,11 @@ public Mono<Response<ConfigurationSetting>> getSetting(String key) {
*
* @param setting The setting to retrieve based on its key and optional label combination.
* @return The {@link ConfigurationSetting} stored in the service, or {@code null}, if the configuration value does
* not exist or the key is an invalid value (which will also throw HttpRequestException described below).
* not exist or the key is an invalid value (which will also throw HttpResponseException described below).
* @throws NullPointerException If {@code setting} is {@code null}.
* @throws IllegalArgumentException If {@link ConfigurationSetting#key() key} is {@code null}.
* @throws ResourceNotFoundException If a ConfigurationSetting with the same key and label does not exist.
* @throws HttpRequestException If the {@code} key is an empty string.
* @throws HttpResponseException If the {@code} key is an empty string.
*/
public Mono<Response<ConfigurationSetting>> getSetting(ConfigurationSetting setting) {
// Validate that setting and key is not null. The key is used in the service URL so it cannot be null.
Expand Down Expand Up @@ -365,10 +365,10 @@ public Mono<Response<ConfigurationSetting>> getSetting(ConfigurationSetting sett
*
* @param key The key of the setting to delete.
* @return The deleted ConfigurationSetting or {@code null} if it didn't exist. {@code null} is also returned if
* the {@code key} is an invalid value (which will also throw HttpRequestException described below).
* the {@code key} is an invalid value (which will also throw HttpResponseException described below).
* @throws IllegalArgumentException If {@code key} is {@code null}.
* @throws ResourceModifiedException If the ConfigurationSetting is locked.
* @throws HttpRequestException If {@code key} is an empty string.
* @throws HttpResponseException If {@code key} is an empty string.
*/
public Mono<Response<ConfigurationSetting>> deleteSetting(String key) {
return deleteSetting(new ConfigurationSetting().key(key));
Expand All @@ -395,13 +395,13 @@ public Mono<Response<ConfigurationSetting>> deleteSetting(String key) {
* @param setting The ConfigurationSetting to delete.
* @return The deleted ConfigurationSetting or {@code null} if didn't exist. {@code null} is also returned if
* the {@code key} is an invalid value or {@link ConfigurationSetting#etag() etag} is set but does not match the
* current etag (which will also throw HttpRequestException described below).
* current etag (which will also throw HttpResponseException described below).
* @throws IllegalArgumentException If {@link ConfigurationSetting#key() key} is {@code null}.
* @throws NullPointerException When {@code setting} is {@code null}.
* @throws ResourceModifiedException If the ConfigurationSetting is locked.
* @throws ResourceNotFoundException If {@link ConfigurationSetting#etag() etag} is specified, not the wildcard
* character, and does not match the current etag value.
* @throws HttpRequestException If {@code key} is an empty string.
* @throws HttpResponseException If {@code key} is an empty string.
*/
public Mono<Response<ConfigurationSetting>> deleteSetting(ConfigurationSetting setting) {
// Validate that setting and key is not null. The key is used in the service URL so it cannot be null.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import com.azure.applicationconfig.credentials.ConfigurationClientCredentials;
import com.azure.applicationconfig.models.ConfigurationSetting;
import com.azure.applicationconfig.models.SettingSelector;
import com.azure.core.exception.HttpRequestException;
import com.azure.core.exception.HttpResponseException;
import com.azure.core.exception.ResourceModifiedException;
import com.azure.core.exception.ResourceNotFoundException;
import com.azure.core.http.rest.Response;
Expand Down Expand Up @@ -71,7 +71,7 @@ public static ConfigurationClientBuilder builder() {
* is an invalid value (which will also throw ServiceRequestException described below).
* @throws IllegalArgumentException If {@code key} is {@code null}.
* @throws ResourceModifiedException If a ConfigurationSetting with the same key exists.
* @throws HttpRequestException If {@code key} is an empty string.
* @throws HttpResponseException If {@code key} is an empty string.
*/
public Response<ConfigurationSetting> addSetting(String key, String value) {
return addSetting(new ConfigurationSetting().key(key).value(value));
Expand All @@ -95,7 +95,7 @@ public Response<ConfigurationSetting> addSetting(String key, String value) {
* @throws NullPointerException If {@code setting} is {@code null}.
* @throws IllegalArgumentException If {@link ConfigurationSetting#key() key} is {@code null}.
* @throws ResourceModifiedException If a ConfigurationSetting with the same key and label exists.
* @throws HttpRequestException If {@code key} is an empty string.
* @throws HttpResponseException If {@code key} is an empty string.
*/
public Response<ConfigurationSetting> addSetting(ConfigurationSetting setting) {
return client.addSetting(setting).block();
Expand Down Expand Up @@ -124,7 +124,7 @@ public Response<ConfigurationSetting> addSetting(ConfigurationSetting setting) {
* value (which will also throw ServiceRequestException described below).
* @throws IllegalArgumentException If {@code key} is {@code null}.
* @throws ResourceModifiedException If the setting exists and is locked.
* @throws HttpRequestException If {@code key} is an empty string.
* @throws HttpResponseException If {@code key} is an empty string.
*/
public Response<ConfigurationSetting> setSetting(String key, String value) {
return setSetting(new ConfigurationSetting().key(key).value(value));
Expand Down Expand Up @@ -162,7 +162,7 @@ public Response<ConfigurationSetting> setSetting(String key, String value) {
* @throws ResourceModifiedException If the {@link ConfigurationSetting#etag() etag} was specified, is not the
* wildcard character, and the current configuration value's etag does not match, or the
* setting exists and is locked.
* @throws HttpRequestException If {@code key} is an empty string.
* @throws HttpResponseException If {@code key} is an empty string.
*/
public Response<ConfigurationSetting> setSetting(ConfigurationSetting setting) {
return client.setSetting(setting).block();
Expand All @@ -184,9 +184,9 @@ public Response<ConfigurationSetting> setSetting(ConfigurationSetting setting) {
* @return The {@link ConfigurationSetting} that was updated, or {@code null}, if the configuration value does not
* exist, is locked, or the key is an invalid value (which will also throw ServiceRequestException described below).
* @throws IllegalArgumentException If {@code key} is {@code null}.
* @throws HttpRequestException If a ConfigurationSetting with the key does not exist or the configuration value
* @throws HttpResponseException If a ConfigurationSetting with the key does not exist or the configuration value
* is locked.
* @throws HttpRequestException If {@code key} is an empty string.
* @throws HttpResponseException If {@code key} is an empty string.
*/
public Response<ConfigurationSetting> updateSetting(String key, String value) {
return updateSetting(new ConfigurationSetting().key(key).value(value));
Expand Down Expand Up @@ -214,7 +214,7 @@ public Response<ConfigurationSetting> updateSetting(String key, String value) {
* @throws ResourceModifiedException If a ConfigurationSetting with the same key and label does not
* exist, the setting is locked, or {@link ConfigurationSetting#etag() etag} is specified but does not match
* the current value.
* @throws HttpRequestException If {@code key} is an empty string.
* @throws HttpResponseException If {@code key} is an empty string.
*/
public Response<ConfigurationSetting> updateSetting(ConfigurationSetting setting) {
return client.updateSetting(setting).block();
Expand All @@ -236,7 +236,7 @@ public Response<ConfigurationSetting> updateSetting(ConfigurationSetting setting
* not exist or the key is an invalid value (which will also throw ServiceRequestException described below).
* @throws IllegalArgumentException If {@code key} is {@code null}.
* @throws ResourceNotFoundException If a ConfigurationSetting with {@code key} does not exist.
* @throws HttpRequestException If {@code key} is an empty string.
* @throws HttpResponseException If {@code key} is an empty string.
*/
public Response<ConfigurationSetting> getSetting(String key) {
return getSetting(new ConfigurationSetting().key(key));
Expand All @@ -259,7 +259,7 @@ public Response<ConfigurationSetting> getSetting(String key) {
* @throws NullPointerException If {@code setting} is {@code null}.
* @throws IllegalArgumentException If {@link ConfigurationSetting#key() key} is {@code null}.
* @throws ResourceNotFoundException If a ConfigurationSetting with the same key and label does not exist.
* @throws HttpRequestException If the {@code} key is an empty string.
* @throws HttpResponseException If the {@code} key is an empty string.
*/
public Response<ConfigurationSetting> getSetting(ConfigurationSetting setting) {
return client.getSetting(setting).block();
Expand All @@ -281,7 +281,7 @@ public Response<ConfigurationSetting> getSetting(ConfigurationSetting setting) {
* the {@code key} is an invalid value (which will also throw ServiceRequestException described below).
* @throws IllegalArgumentException If {@code key} is {@code null}.
* @throws ResourceModifiedException If the ConfigurationSetting is locked.
* @throws HttpRequestException If {@code key} is an empty string.
* @throws HttpResponseException If {@code key} is an empty string.
*/
public Response<ConfigurationSetting> deleteSetting(String key) {
return deleteSetting(new ConfigurationSetting().key(key));
Expand Down Expand Up @@ -311,7 +311,7 @@ public Response<ConfigurationSetting> deleteSetting(String key) {
* @throws ResourceModifiedException If the ConfigurationSetting is locked.
* @throws ResourceNotFoundException If {@link ConfigurationSetting#etag() etag} is specified, not the wildcard
* character, and does not match the current etag value.
* @throws HttpRequestException If {@code key} is an empty string.
* @throws HttpResponseException If {@code key} is an empty string.
*/
public Response<ConfigurationSetting> deleteSetting(ConfigurationSetting setting) {
return client.deleteSetting(setting).block();
Expand Down
Loading