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 @@ -44,7 +44,7 @@
import static com.azure.data.appconfiguration.implementation.ConfigurationSettingDeserializationHelper.toConfigurationSettingWithResponse;
import static com.azure.data.appconfiguration.implementation.Utility.ETAG_ANY;
import static com.azure.data.appconfiguration.implementation.Utility.addTracingNamespace;
import static com.azure.data.appconfiguration.implementation.Utility.getEtag;
import static com.azure.data.appconfiguration.implementation.Utility.getETag;
import static com.azure.data.appconfiguration.implementation.Utility.iterableToList;
import static com.azure.data.appconfiguration.implementation.Utility.toKeyValue;
import static com.azure.data.appconfiguration.implementation.Utility.toSettingFieldsList;
Expand Down Expand Up @@ -568,7 +568,7 @@ public Mono<Response<ConfigurationSetting>> setConfigurationSettingWithResponse(
return withContext(
context -> validateSettingAsync(setting).flatMap(
settingInternal -> serviceClient.putKeyValueWithResponseAsync(settingInternal.getKey(),
settingInternal.getLabel(), getEtag(ifUnchanged, settingInternal), null,
settingInternal.getLabel(), getETag(ifUnchanged, settingInternal), null,
toKeyValue(settingInternal), addTracingNamespace(context))
.map(response -> toConfigurationSettingWithResponse(response))));
}
Expand Down Expand Up @@ -716,7 +716,7 @@ public Mono<Response<ConfigurationSetting>> getConfigurationSettingWithResponse(
settingInternal ->
serviceClient.getKeyValueWithResponseAsync(settingInternal.getKey(), settingInternal.getLabel(),
acceptDateTime == null ? null : acceptDateTime.toString(), null,
getEtag(ifChanged, settingInternal), null, addTracingNamespace(context))
getETag(ifChanged, settingInternal), null, addTracingNamespace(context))
.onErrorResume(
HttpResponseException.class,
(Function<Throwable, Mono<ResponseBase<GetKeyValueHeaders, KeyValue>>>) throwable -> {
Expand Down Expand Up @@ -850,7 +850,7 @@ public Mono<Response<ConfigurationSetting>> deleteConfigurationSettingWithRespon
boolean ifUnchanged) {
return withContext(context -> validateSettingAsync(setting).flatMap(
settingInternal -> serviceClient.deleteKeyValueWithResponseAsync(settingInternal.getKey(),
settingInternal.getLabel(), getEtag(ifUnchanged, settingInternal), addTracingNamespace(context))
settingInternal.getLabel(), getETag(ifUnchanged, settingInternal), addTracingNamespace(context))
.map(response -> toConfigurationSettingWithResponse(response))));
}

Expand Down Expand Up @@ -1311,7 +1311,7 @@ public Mono<ConfigurationSettingSnapshot> archiveSnapshot(String name) {
* <!-- end com.azure.data.appconfiguration.configurationasyncclient.archiveSnapshotMaxOverload -->
*
* @param snapshot The snapshot to be archived.
* @param ifUnchanged Flag indicating if the {@code snapshot} {@link ConfigurationSettingSnapshot#getEtag ETag} is
* @param ifUnchanged Flag indicating if the {@code snapshot} {@link ConfigurationSettingSnapshot#getETag ETag} is
* used as a IF-MATCH header.
* @return A {@link Mono} of {@link ConfigurationSettingSnapshot}.
*/
Expand Down Expand Up @@ -1365,7 +1365,7 @@ public Mono<ConfigurationSettingSnapshot> recoverSnapshot(String name) {
* <!-- end com.azure.data.appconfiguration.configurationasyncclient.recoverSnapshotMaxOverload -->
*
* @param snapshot The snapshot to be archived.
* @param ifUnchanged Flag indicating if the {@code snapshot} {@link ConfigurationSettingSnapshot#getEtag()} ETag}
* @param ifUnchanged Flag indicating if the {@code snapshot} {@link ConfigurationSettingSnapshot#getETag()} ETag}
* is used as an IF-MATCH header.
* @return A {@link Mono} of {@link ConfigurationSettingSnapshot}.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
import static com.azure.data.appconfiguration.implementation.Utility.ETAG_ANY;
import static com.azure.data.appconfiguration.implementation.Utility.addTracingNamespace;
import static com.azure.data.appconfiguration.implementation.Utility.enableSyncRestProxy;
import static com.azure.data.appconfiguration.implementation.Utility.getEtag;
import static com.azure.data.appconfiguration.implementation.Utility.getETag;
import static com.azure.data.appconfiguration.implementation.Utility.iterableToList;
import static com.azure.data.appconfiguration.implementation.Utility.toKeyValue;
import static com.azure.data.appconfiguration.implementation.Utility.toSettingFieldsList;
Expand Down Expand Up @@ -573,7 +573,7 @@ public Response<ConfigurationSetting> setConfigurationSettingWithResponse(Config
validateSetting(setting);
final ResponseBase<PutKeyValueHeaders, KeyValue> response =
serviceClient.putKeyValueWithResponse(setting.getKey(), setting.getLabel(),
getEtag(ifUnchanged, setting), null, toKeyValue(setting),
getETag(ifUnchanged, setting), null, toKeyValue(setting),
enableSyncRestProxy(addTracingNamespace(context)));
return toConfigurationSettingWithResponse(response);
}
Expand Down Expand Up @@ -720,7 +720,7 @@ public Response<ConfigurationSetting> getConfigurationSettingWithResponse(Config
final ResponseBase<GetKeyValueHeaders, KeyValue> response =
serviceClient.getKeyValueWithResponse(setting.getKey(), setting.getLabel(),
acceptDateTime == null ? null : acceptDateTime.toString(), null,
getEtag(ifChanged, setting), null, enableSyncRestProxy(addTracingNamespace(context)));
getETag(ifChanged, setting), null, enableSyncRestProxy(addTracingNamespace(context)));
return toConfigurationSettingWithResponse(response);
} catch (HttpResponseException ex) {
final HttpResponse httpResponse = ex.getResponse();
Expand Down Expand Up @@ -846,7 +846,7 @@ public Response<ConfigurationSetting> deleteConfigurationSettingWithResponse(Con
validateSetting(setting);
final ResponseBase<DeleteKeyValueHeaders, KeyValue> response =
serviceClient.deleteKeyValueWithResponse(setting.getKey(), setting.getLabel(),
getEtag(ifUnchanged, setting), enableSyncRestProxy(addTracingNamespace(context)));
getETag(ifUnchanged, setting), enableSyncRestProxy(addTracingNamespace(context)));
return toConfigurationSettingWithResponse(response);
}

Expand Down Expand Up @@ -1358,7 +1358,7 @@ public ConfigurationSettingSnapshot archiveSnapshot(String name) {
* <!-- end com.azure.data.appconfiguration.configurationclient.archiveSnapshotByNameMaxOverload -->
*
* @param snapshot The snapshot to be archived.
* @param ifUnchanged Flag indicating if the {@code snapshot} {@link ConfigurationSettingSnapshot#getEtag ETag} is
* @param ifUnchanged Flag indicating if the {@code snapshot} {@link ConfigurationSettingSnapshot#getETag ETag} is
* used as a IF-MATCH header.
* @param context Additional context that is passed through the Http pipeline during the service call.
* @return A {@link Response} of {@link ConfigurationSettingSnapshot}.
Expand Down Expand Up @@ -1408,7 +1408,7 @@ public ConfigurationSettingSnapshot recoverSnapshot(String name) {
* <!-- end com.azure.data.appconfiguration.configurationclient.recoverSnapshotMaxOverload -->
*
* @param snapshot The snapshot to be archived.
* @param ifUnchanged Flag indicating if the {@code snapshot} {@link ConfigurationSettingSnapshot#getEtag()} ETag}
* @param ifUnchanged Flag indicating if the {@code snapshot} {@link ConfigurationSettingSnapshot#getETag()} ETag}
* is used as an IF-MATCH header.
* @param context Additional context that is passed through the Http pipeline during the service call.
* @return A {@link Response} of {@link ConfigurationSettingSnapshot}.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,16 +105,16 @@ private static String getETagValue(String etag) {
* Get HTTP header value, if-match or if-none-match.. Used to perform an operation only if the targeted resource's
* etag matches the value provided.
*/
public static String getEtag(boolean isEtagRequired, ConfigurationSetting setting) {
return isEtagRequired ? getETagValue(setting.getETag()) : null;
public static String getETag(boolean isETagRequired, ConfigurationSetting setting) {
return isETagRequired ? getETagValue(setting.getETag()) : null;
}

public static String getEtagSnapshot(boolean isEtagRequired, ConfigurationSettingSnapshot snapshot) {
if (!isEtagRequired) {
public static String getETagSnapshot(boolean isETagRequired, ConfigurationSettingSnapshot snapshot) {
if (!isETagRequired) {
return null;
}
Objects.requireNonNull(snapshot);
return getETagValue(snapshot.getEtag());
return getETagValue(snapshot.getETag());
}

/*
Expand Down Expand Up @@ -166,7 +166,7 @@ public static Response<ConfigurationSettingSnapshot> updateSnapshotSync(String s
final ResponseBase<UpdateSnapshotHeaders, ConfigurationSettingSnapshot> response =
serviceClient.updateSnapshotWithResponse(snapshotName,
new SnapshotUpdateParameters().setStatus(status),
getEtagSnapshot(ifUnchanged, snapshot), null, context);
getETagSnapshot(ifUnchanged, snapshot), null, context);
return new SimpleResponse<>(response, response.getValue());
}

Expand All @@ -175,7 +175,7 @@ public static Mono<Response<ConfigurationSettingSnapshot>> updateSnapshotAsync(S
AzureAppConfigurationImpl serviceClient) {
return serviceClient.updateSnapshotWithResponseAsync(snapshotName,
new SnapshotUpdateParameters().setStatus(status),
getEtagSnapshot(ifUnchanged, snapshot),
getETagSnapshot(ifUnchanged, snapshot),
null)
.map(response -> new SimpleResponse<>(response, response.getValue()));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public final class ConfigurationSettingSnapshot implements JsonSerializable<Conf
/*
* A value representing the current state of the snapshot.
*/
private String etag;
private String eTag;

/**
* Creates an instance of ConfigurationSettingSnapshot class.
Expand Down Expand Up @@ -223,12 +223,12 @@ public ConfigurationSettingSnapshot setTags(Map<String, String> tags) {
}

/**
* Get the etag property: A value representing the current state of the snapshot.
* Get the eTag property: A value representing the current state of the snapshot.
*
* @return the etag value.
* @return the eTag value.
*/
public String getEtag() {
return this.etag;
public String getETag() {
return this.eTag;
}

@Override
Expand All @@ -244,7 +244,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
jsonWriter.writeNumberField("size", this.size);
jsonWriter.writeNumberField("items_count", this.itemCount);
jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element));
jsonWriter.writeStringField("etag", this.etag);
jsonWriter.writeStringField("etag", this.eTag);
return jsonWriter.writeEndObject();
}

Expand All @@ -271,7 +271,7 @@ public static ConfigurationSettingSnapshot fromJson(JsonReader jsonReader) throw
Long size = null;
Long itemCount = null;
Map<String, String> tags = null;
String etag = null;
String eTag = null;
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
Expand Down Expand Up @@ -302,7 +302,7 @@ public static ConfigurationSettingSnapshot fromJson(JsonReader jsonReader) throw
} else if ("tags".equals(fieldName)) {
tags = reader.readMap(reader1 -> reader1.getString());
} else if ("etag".equals(fieldName)) {
etag = reader.getString();
eTag = reader.getString();
} else {
reader.skipChildren();
}
Expand All @@ -319,7 +319,7 @@ public static ConfigurationSettingSnapshot fromJson(JsonReader jsonReader) throw
deserializedConfigurationSettingSnapshot.size = size;
deserializedConfigurationSettingSnapshot.itemCount = itemCount;
deserializedConfigurationSettingSnapshot.tags = tags;
deserializedConfigurationSettingSnapshot.etag = etag;
deserializedConfigurationSettingSnapshot.eTag = eTag;

return deserializedConfigurationSettingSnapshot;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -819,7 +819,7 @@ void assertEqualsConfigurationSettingSnapshot(String name, SnapshotStatus snapsh
assertNotNull(actualSnapshot.getCreatedAt());
assertEquals(itemCount, actualSnapshot.getItemCount());
assertNotNull(actualSnapshot.getSize());
assertNotNull(actualSnapshot.getEtag());
assertNotNull(actualSnapshot.getETag());

if (!CoreUtils.isNullOrEmpty(tags)) {
assertEquals(tags, actualSnapshot.getTags());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ customization-class: src/main/java/AppConfigCustomization.java
```yaml
output-folder: ..\
java: true
use: '@autorest/java@4.1.16'
use: '@autorest/java@4.1.17'
enable-sync-stack: true
generate-client-interfaces: false
generate-client-as-impl: true
Expand All @@ -65,6 +65,7 @@ directive:
$["items_count"]["x-ms-client-name"] = "item_count";
$["created"]["x-ms-client-name"] = "createdAt";
$["expires"]["x-ms-client-name"] = "expiresAt";
$["etag"]["x-ms-client-name"] = "eTag";
```

### Renames
Expand Down