Skip to content

Commit

Permalink
Regenerate some libraries using latest Autorest (#42846)
Browse files Browse the repository at this point in the history
Regenerate some libraries using latest Autorest
  • Loading branch information
alzimmermsft authored Nov 11, 2024
1 parent f2e9373 commit 3f5ad69
Show file tree
Hide file tree
Showing 820 changed files with 33,191 additions and 7,230 deletions.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ public final class CreateSnapshotHeaders {

private static final HttpHeaderName SYNC_TOKEN = HttpHeaderName.fromString("Sync-Token");

private static final HttpHeaderName OPERATION_LOCATION = HttpHeaderName.fromString("Operation-Location");

// HttpHeaders containing the raw property values.
/**
* Creates an instance of CreateSnapshotHeaders class.
Expand All @@ -46,7 +44,7 @@ public final class CreateSnapshotHeaders {
public CreateSnapshotHeaders(HttpHeaders rawHeaders) {
this.eTag = rawHeaders.getValue(HttpHeaderName.ETAG);
this.syncToken = rawHeaders.getValue(SYNC_TOKEN);
this.operationLocation = rawHeaders.getValue(OPERATION_LOCATION);
this.operationLocation = rawHeaders.getValue(HttpHeaderName.OPERATION_LOCATION);
this.link = rawHeaders.getValue(HttpHeaderName.LINK);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
package com.azure.data.appconfiguration.implementation.models;

import com.azure.core.annotation.Fluent;
import com.azure.core.util.CoreUtils;
import com.azure.json.JsonReader;
import com.azure.json.JsonSerializable;
import com.azure.json.JsonToken;
Expand Down Expand Up @@ -267,8 +268,8 @@ public static KeyValue fromJson(JsonReader jsonReader) throws IOException {
} else if ("value".equals(fieldName)) {
deserializedKeyValue.value = reader.getString();
} else if ("last_modified".equals(fieldName)) {
deserializedKeyValue.lastModified
= reader.getNullable(nonNullReader -> OffsetDateTime.parse(nonNullReader.getString()));
deserializedKeyValue.lastModified = reader
.getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
} else if ("tags".equals(fieldName)) {
Map<String, String> tags = reader.readMap(reader1 -> reader1.getString());
deserializedKeyValue.tags = tags;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,17 @@

package com.azure.data.appconfiguration.models;

import java.time.Duration;

import java.io.IOException;
import java.time.OffsetDateTime;
import java.util.List;
import java.util.Map;

import com.azure.core.annotation.Fluent;
import com.azure.core.util.CoreUtils;
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.time.Duration;
import java.time.OffsetDateTime;
import java.util.List;
import java.util.Map;

/**
* The ConfigurationSnapshot model.
Expand All @@ -38,7 +37,9 @@ public final class ConfigurationSnapshot implements JsonSerializable<Configurati
private final List<ConfigurationSettingsFilter> filters;

/*
* The composition type describes how the key-values within the snapshot are composed. The 'key' composition type ensures there are no two key-values containing the same key. The 'key_label' composition type ensures there are no two key-values containing the same key and label.
* The composition type describes how the key-values within the snapshot are composed. The 'key' composition type
* ensures there are no two key-values containing the same key. The 'key_label' composition type ensures there are
* no two key-values containing the same key and label.
*/
private SnapshotComposition snapshotComposition;

Expand All @@ -53,7 +54,9 @@ public final class ConfigurationSnapshot implements JsonSerializable<Configurati
private OffsetDateTime expiresAt;

/*
* The amount of time, in seconds, that a snapshot will remain in the archived state before expiring. This property is only writable during the creation of a snapshot. If not specified, the default lifetime of key-value revisions will be used.
* The amount of time, in seconds, that a snapshot will remain in the archived state before expiring. This property
* is only writable during the creation of a snapshot. If not specified, the default lifetime of key-value revisions
* will be used.
*/
private Long retentionPeriod;

Expand Down Expand Up @@ -280,9 +283,11 @@ public static ConfigurationSnapshot fromJson(JsonReader jsonReader) throws IOExc
} else if ("composition_type".equals(fieldName)) {
snapshotComposition = SnapshotComposition.fromString(reader.getString());
} else if ("created".equals(fieldName)) {
createdAt = reader.getNullable(nonNullReader -> OffsetDateTime.parse(nonNullReader.getString()));
createdAt = reader
.getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
} else if ("expires".equals(fieldName)) {
expiresAt = reader.getNullable(nonNullReader -> OffsetDateTime.parse(nonNullReader.getString()));
expiresAt = reader
.getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
} else if ("retention_period".equals(fieldName)) {
retentionPeriod = reader.getNullable(JsonReader::getLong);
} else if ("size".equals(fieldName)) {
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/[email protected].29'
use: '@autorest/[email protected].39'
enable-sync-stack: true
generate-client-interfaces: false
generate-client-as-impl: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,18 +98,7 @@ Mono<Response<TpmAttestationResponse>> attestTpm(@HostParam("instanceUrl") Strin
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<Response<AttestationResponse>> attestOpenEnclaveWithResponseAsync(AttestOpenEnclaveRequest request) {
if (this.client.getInstanceUrl() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getInstanceUrl() is required and cannot be null."));
}
if (request == null) {
return Mono.error(new IllegalArgumentException("Parameter request is required and cannot be null."));
} else {
request.validate();
}
final String accept = "application/json";
return FluxUtil.withContext(context -> service.attestOpenEnclave(this.client.getInstanceUrl(),
this.client.getApiVersion(), request, accept, context));
return FluxUtil.withContext(context -> attestOpenEnclaveWithResponseAsync(request, context));
}

/**
Expand Down Expand Up @@ -193,18 +182,7 @@ public Mono<AttestationResponse> attestOpenEnclaveAsync(AttestOpenEnclaveRequest
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<Response<AttestationResponse>> attestSgxEnclaveWithResponseAsync(AttestSgxEnclaveRequest request) {
if (this.client.getInstanceUrl() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getInstanceUrl() is required and cannot be null."));
}
if (request == null) {
return Mono.error(new IllegalArgumentException("Parameter request is required and cannot be null."));
} else {
request.validate();
}
final String accept = "application/json";
return FluxUtil.withContext(context -> service.attestSgxEnclave(this.client.getInstanceUrl(),
this.client.getApiVersion(), request, accept, context));
return FluxUtil.withContext(context -> attestSgxEnclaveWithResponseAsync(request, context));
}

/**
Expand Down Expand Up @@ -288,18 +266,7 @@ public Mono<AttestationResponse> attestSgxEnclaveAsync(AttestSgxEnclaveRequest r
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<Response<TpmAttestationResponse>> attestTpmWithResponseAsync(TpmAttestationRequest request) {
if (this.client.getInstanceUrl() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getInstanceUrl() is required and cannot be null."));
}
if (request == null) {
return Mono.error(new IllegalArgumentException("Parameter request is required and cannot be null."));
} else {
request.validate();
}
final String accept = "application/json";
return FluxUtil.withContext(context -> service.attestTpm(this.client.getInstanceUrl(),
this.client.getApiVersion(), request, accept, context));
return FluxUtil.withContext(context -> attestTpmWithResponseAsync(request, context));
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,7 @@ Mono<Response<Object>> get(@HostParam("instanceUrl") String instanceUrl, @Header
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<Response<Object>> getWithResponseAsync() {
if (this.client.getInstanceUrl() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getInstanceUrl() is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil.withContext(context -> service.get(this.client.getInstanceUrl(), accept, context));
return FluxUtil.withContext(context -> getWithResponseAsync(context));
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,17 +93,7 @@ Mono<Response<PolicyResponse>> reset(@HostParam("instanceUrl") String instanceUr
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<Response<PolicyResponse>> getWithResponseAsync(AttestationType attestationType) {
if (this.client.getInstanceUrl() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getInstanceUrl() is required and cannot be null."));
}
if (attestationType == null) {
return Mono
.error(new IllegalArgumentException("Parameter attestationType is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil.withContext(context -> service.get(this.client.getInstanceUrl(), this.client.getApiVersion(),
attestationType, accept, context));
return FluxUtil.withContext(context -> getWithResponseAsync(attestationType, context));
}

/**
Expand Down Expand Up @@ -174,21 +164,7 @@ public Mono<PolicyResponse> getAsync(AttestationType attestationType, Context co
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<Response<PolicyResponse>> setWithResponseAsync(AttestationType attestationType,
String newAttestationPolicy) {
if (this.client.getInstanceUrl() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getInstanceUrl() is required and cannot be null."));
}
if (attestationType == null) {
return Mono
.error(new IllegalArgumentException("Parameter attestationType is required and cannot be null."));
}
if (newAttestationPolicy == null) {
return Mono
.error(new IllegalArgumentException("Parameter newAttestationPolicy is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil.withContext(context -> service.set(this.client.getInstanceUrl(), this.client.getApiVersion(),
attestationType, newAttestationPolicy, accept, context));
return FluxUtil.withContext(context -> setWithResponseAsync(attestationType, newAttestationPolicy, context));
}

/**
Expand Down Expand Up @@ -270,20 +246,7 @@ public Mono<PolicyResponse> setAsync(AttestationType attestationType, String new
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<Response<PolicyResponse>> resetWithResponseAsync(AttestationType attestationType, String policyJws) {
if (this.client.getInstanceUrl() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getInstanceUrl() is required and cannot be null."));
}
if (attestationType == null) {
return Mono
.error(new IllegalArgumentException("Parameter attestationType is required and cannot be null."));
}
if (policyJws == null) {
return Mono.error(new IllegalArgumentException("Parameter policyJws is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil.withContext(context -> service.reset(this.client.getInstanceUrl(), this.client.getApiVersion(),
attestationType, policyJws, accept, context));
return FluxUtil.withContext(context -> resetWithResponseAsync(attestationType, policyJws, context));
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,7 @@ Mono<Response<PolicyCertificatesModifyResponse>> remove(@HostParam("instanceUrl"
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<Response<PolicyCertificatesResponse>> getWithResponseAsync() {
if (this.client.getInstanceUrl() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getInstanceUrl() is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil.withContext(
context -> service.get(this.client.getInstanceUrl(), this.client.getApiVersion(), accept, context));
return FluxUtil.withContext(context -> getWithResponseAsync(context));
}

/**
Expand Down Expand Up @@ -157,17 +151,7 @@ public Mono<PolicyCertificatesResponse> getAsync(Context context) {
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<Response<PolicyCertificatesModifyResponse>> addWithResponseAsync(String policyCertificateToAdd) {
if (this.client.getInstanceUrl() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getInstanceUrl() is required and cannot be null."));
}
if (policyCertificateToAdd == null) {
return Mono.error(
new IllegalArgumentException("Parameter policyCertificateToAdd is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil.withContext(context -> service.add(this.client.getInstanceUrl(), this.client.getApiVersion(),
policyCertificateToAdd, accept, context));
return FluxUtil.withContext(context -> addWithResponseAsync(policyCertificateToAdd, context));
}

/**
Expand Down Expand Up @@ -243,17 +227,7 @@ public Mono<PolicyCertificatesModifyResponse> addAsync(String policyCertificateT
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<Response<PolicyCertificatesModifyResponse>> removeWithResponseAsync(String policyCertificateToRemove) {
if (this.client.getInstanceUrl() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getInstanceUrl() is required and cannot be null."));
}
if (policyCertificateToRemove == null) {
return Mono.error(
new IllegalArgumentException("Parameter policyCertificateToRemove is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil.withContext(context -> service.remove(this.client.getInstanceUrl(), this.client.getApiVersion(),
policyCertificateToRemove, accept, context));
return FluxUtil.withContext(context -> removeWithResponseAsync(policyCertificateToRemove, context));
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,7 @@ Mono<Response<JsonWebKeySet>> get(@HostParam("instanceUrl") String instanceUrl,
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<Response<JsonWebKeySet>> getWithResponseAsync() {
if (this.client.getInstanceUrl() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getInstanceUrl() is required and cannot be null."));
}
final String accept = "application/jwk+json, application/json";
return FluxUtil.withContext(context -> service.get(this.client.getInstanceUrl(), accept, context));
return FluxUtil.withContext(context -> getWithResponseAsync(context));
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,9 @@ public AttestOpenEnclaveRequest setReport(byte[] report) {
}

/**
* Get the runtimeData property: Runtime data provided by the enclave at the time of report generation. The MAA
* will verify that the first 32 bytes of the report_data field of the quote contains the SHA256 hash of the
* decoded "data" field of the runtime data.
* Get the runtimeData property: Runtime data provided by the enclave at the time of report generation. The MAA will
* verify that the first 32 bytes of the report_data field of the quote contains the SHA256 hash of the decoded
* "data" field of the runtime data.
*
* @return the runtimeData value.
*/
Expand All @@ -92,9 +92,9 @@ public RuntimeData getRuntimeData() {
}

/**
* Set the runtimeData property: Runtime data provided by the enclave at the time of report generation. The MAA
* will verify that the first 32 bytes of the report_data field of the quote contains the SHA256 hash of the
* decoded "data" field of the runtime data.
* Set the runtimeData property: Runtime data provided by the enclave at the time of report generation. The MAA will
* verify that the first 32 bytes of the report_data field of the quote contains the SHA256 hash of the decoded
* "data" field of the runtime data.
*
* @param runtimeData the runtimeData value to set.
* @return the AttestOpenEnclaveRequest object itself.
Expand Down Expand Up @@ -182,6 +182,9 @@ public void validate() {
}
}

/**
* {@inheritDoc}
*/
@Override
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
jsonWriter.writeStartObject();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,8 @@ public final class AttestSgxEnclaveRequest implements JsonSerializable<AttestSgx
private Base64Url quote;

/*
* Runtime data provided by the enclave at the time of quote generation. The MAA will verify that the first 32
* bytes of the report_data field of the quote contains the SHA256 hash of the decoded "data" field of the runtime
* data.
* Runtime data provided by the enclave at the time of quote generation. The MAA will verify that the first 32 bytes
* of the report_data field of the quote contains the SHA256 hash of the decoded "data" field of the runtime data.
*/
private RuntimeData runtimeData;

Expand Down Expand Up @@ -105,8 +104,8 @@ public AttestSgxEnclaveRequest setRuntimeData(RuntimeData runtimeData) {
}

/**
* Get the initTimeData property: Initialization data provided when the enclave is created. MAA will verify that
* the init data was known to the enclave. Note that InitTimeData is invalid for CoffeeLake processors.
* Get the initTimeData property: Initialization data provided when the enclave is created. MAA will verify that the
* init data was known to the enclave. Note that InitTimeData is invalid for CoffeeLake processors.
*
* @return the initTimeData value.
*/
Expand All @@ -115,8 +114,8 @@ public InitTimeData getInitTimeData() {
}

/**
* Set the initTimeData property: Initialization data provided when the enclave is created. MAA will verify that
* the init data was known to the enclave. Note that InitTimeData is invalid for CoffeeLake processors.
* Set the initTimeData property: Initialization data provided when the enclave is created. MAA will verify that the
* init data was known to the enclave. Note that InitTimeData is invalid for CoffeeLake processors.
*
* @param initTimeData the initTimeData value to set.
* @return the AttestSgxEnclaveRequest object itself.
Expand Down Expand Up @@ -182,6 +181,9 @@ public void validate() {
}
}

/**
* {@inheritDoc}
*/
@Override
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
jsonWriter.writeStartObject();
Expand Down
Loading

0 comments on commit 3f5ad69

Please sign in to comment.