Skip to content

Commit

Permalink
[Automation] Generate SDK based on TypeSpec 0.13.2 (#38597)
Browse files Browse the repository at this point in the history
  • Loading branch information
azure-sdk authored Feb 2, 2024
1 parent 922d0bb commit c9d92bd
Show file tree
Hide file tree
Showing 23 changed files with 51 additions and 76 deletions.
2 changes: 1 addition & 1 deletion eng/emitter-package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"main": "dist/src/index.js",
"dependencies": {
"@azure-tools/typespec-java": "0.13.1"
"@azure-tools/typespec-java": "0.13.2"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -314,9 +314,9 @@ public Mono<BinaryData> updateDistributionPolicy(String distributionPolicyId, Bi
= DistributionPolicyAdapter.convertCreateOptionsToDistributionPolicy(createDistributionPolicyOptions);
return upsertDistributionPolicyWithResponse(createDistributionPolicyOptions.getDistributionPolicyId(),
BinaryData.fromObject(distributionPolicy), requestOptions)
.map(response -> new SimpleResponse<DistributionPolicy>(response.getRequest(), response.getStatusCode(),
response.getHeaders(), DistributionPolicyConstructorProxy
.create(response.getValue().toObject(DistributionPolicyInternal.class))));
.map(response -> new SimpleResponse<DistributionPolicy>(response.getRequest(), response.getStatusCode(),
response.getHeaders(), DistributionPolicyConstructorProxy
.create(response.getValue().toObject(DistributionPolicyInternal.class))));
}

/**
Expand Down Expand Up @@ -717,9 +717,9 @@ public Mono<BinaryData> updateClassificationPolicy(String classificationPolicyId
.convertCreateOptionsToClassificationPolicyInternal(createClassificationPolicyOptions);
return upsertClassificationPolicyWithResponse(createClassificationPolicyOptions.getClassificationPolicyId(),
BinaryData.fromObject(classificationPolicy), requestOptions)
.map(response -> new SimpleResponse<ClassificationPolicy>(response.getRequest(),
response.getStatusCode(), response.getHeaders(), ClassificationPolicyConstructorProxy
.create(response.getValue().toObject(ClassificationPolicyInternal.class))));
.map(response -> new SimpleResponse<ClassificationPolicy>(response.getRequest(), response.getStatusCode(),
response.getHeaders(), ClassificationPolicyConstructorProxy
.create(response.getValue().toObject(ClassificationPolicyInternal.class))));
}

/**
Expand Down Expand Up @@ -1129,9 +1129,9 @@ public Mono<BinaryData> updateExceptionPolicy(String exceptionPolicyId, BinaryDa
= ExceptionPolicyAdapter.convertCreateOptionsToExceptionPolicy(createExceptionPolicyOptions);
return upsertExceptionPolicyWithResponse(createExceptionPolicyOptions.getExceptionPolicyId(),
BinaryData.fromObject(exceptionPolicy), requestOptions)
.map(response -> new SimpleResponse<ExceptionPolicy>(response.getRequest(), response.getStatusCode(),
response.getHeaders(), ExceptionPolicyConstructorProxy
.create(response.getValue().toObject(ExceptionPolicyInternal.class))));
.map(response -> new SimpleResponse<ExceptionPolicy>(response.getRequest(), response.getStatusCode(),
response.getHeaders(),
ExceptionPolicyConstructorProxy.create(response.getValue().toObject(ExceptionPolicyInternal.class))));
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1502,9 +1502,9 @@ public Mono<Response<RouterWorker>> createWorkerWithResponse(CreateWorkerOptions
RouterWorkerInternal routerWorker = WorkerAdapter.convertCreateWorkerOptionsToRouterWorker(createWorkerOptions);
return upsertWorkerWithResponse(createWorkerOptions.getWorkerId(), BinaryData.fromObject(routerWorker),
requestOptions)
.map(response -> new SimpleResponse<RouterWorker>(response.getRequest(), response.getStatusCode(),
response.getHeaders(),
RouterWorkerConstructorProxy.create(response.getValue().toObject(RouterWorkerInternal.class))));
.map(response -> new SimpleResponse<RouterWorker>(response.getRequest(), response.getStatusCode(),
response.getHeaders(),
RouterWorkerConstructorProxy.create(response.getValue().toObject(RouterWorkerInternal.class))));
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,10 @@

package com.azure.communication.jobrouter;

import com.azure.core.util.ServiceVersion;

/**
* Service version of JobRouterClient.
*/
public enum JobRouterServiceVersion implements ServiceVersion {
public enum JobRouterServiceVersion implements com.azure.core.util.ServiceVersion {
/**
* Enum value 2023-11-01.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@
module com.azure.communication.jobrouter {
requires transitive com.azure.core;
requires com.azure.communication.common;

exports com.azure.communication.jobrouter;
exports com.azure.communication.jobrouter.models;

opens com.azure.communication.jobrouter.implementation.models to com.azure.core, com.fasterxml.jackson.databind;
opens com.azure.communication.jobrouter.models to com.azure.core, com.fasterxml.jackson.databind;
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,10 @@

package com.azure.ai.contentsafety;

import com.azure.core.util.ServiceVersion;

/**
* Service version of ContentSafetyClient.
*/
public enum ContentSafetyServiceVersion implements ServiceVersion {
public enum ContentSafetyServiceVersion implements com.azure.core.util.ServiceVersion {
/**
* Enum value 2023-10-01.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@

module com.azure.ai.contentsafety {
requires transitive com.azure.core;

exports com.azure.ai.contentsafety;
exports com.azure.ai.contentsafety.models;

opens com.azure.ai.contentsafety.models to com.azure.core, com.fasterxml.jackson.databind;
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,10 @@

package com.azure.developer.devcenter;

import com.azure.core.util.ServiceVersion;

/**
* Service version of DevCenterServiceClient.
*/
public enum DevCenterServiceVersion implements ServiceVersion {
public enum DevCenterServiceVersion implements com.azure.core.util.ServiceVersion {
/**
* Enum value 2023-04-01.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,5 @@

module com.azure.developer.devcenter {
requires transitive com.azure.core;

exports com.azure.developer.devcenter;
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,10 @@

package com.azure.ai.documentintelligence;

import com.azure.core.util.ServiceVersion;

/**
* Service version of DocumentIntelligenceClient.
*/
public enum DocumentIntelligenceServiceVersion implements ServiceVersion {
public enum DocumentIntelligenceServiceVersion implements com.azure.core.util.ServiceVersion {
/**
* Enum value 2023-10-31-preview.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@

module com.azure.ai.documentintelligence {
requires transitive com.azure.core;

exports com.azure.ai.documentintelligence;
exports com.azure.ai.documentintelligence.models;

opens com.azure.ai.documentintelligence.models to com.azure.core, com.fasterxml.jackson.databind;
}
Original file line number Diff line number Diff line change
Expand Up @@ -1637,7 +1637,7 @@ public Mono<DataConnection> createOrReplaceDataConnection(String dataConnectionN
RequestOptions requestOptions = new RequestOptions();
return createOrReplaceDataConnectionWithResponse(dataConnectionName, BinaryData.fromObject(dataConnectionData),
requestOptions).flatMap(FluxUtil::toMono)
.map(protocolMethodData -> cleanUp(protocolMethodData).toObject(DataConnection.class));
.map(protocolMethodData -> cleanUp(protocolMethodData).toObject(DataConnection.class));
}

/**
Expand Down Expand Up @@ -2086,7 +2086,7 @@ public Mono<SavedFilter> createOrReplaceSavedFilter(String filterName, SavedFilt
RequestOptions requestOptions = new RequestOptions();
return createOrReplaceSavedFilterWithResponse(filterName, BinaryData.fromObject(savedFilterData),
requestOptions).flatMap(FluxUtil::toMono)
.map(protocolMethodData -> cleanUp(protocolMethodData).toObject(SavedFilter.class));
.map(protocolMethodData -> cleanUp(protocolMethodData).toObject(SavedFilter.class));
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1360,7 +1360,7 @@ public Task updateAssets(String filter, AssetUpdateData assetUpdateData) {
RequestOptions requestOptions = new RequestOptions();
return cleanUp(
updateAssetsWithResponse(filter, BinaryData.fromObject(assetUpdateData), requestOptions).getValue())
.toObject(Task.class);
.toObject(Task.class);
}

/**
Expand Down Expand Up @@ -1418,7 +1418,7 @@ public ValidateResult validateDataConnection(DataConnectionData dataConnectionDa
RequestOptions requestOptions = new RequestOptions();
return cleanUp(
validateDataConnectionWithResponse(BinaryData.fromObject(dataConnectionData), requestOptions).getValue())
.toObject(ValidateResult.class);
.toObject(ValidateResult.class);
}

/**
Expand Down Expand Up @@ -1558,7 +1558,8 @@ public DiscoGroup createOrReplaceDiscoGroup(String groupName, DiscoGroupData dis
RequestOptions requestOptions = new RequestOptions();
return cleanUp(
createOrReplaceDiscoGroupWithResponse(groupName, BinaryData.fromObject(discoGroupData), requestOptions)
.getValue()).toObject(DiscoGroup.class);
.getValue())
.toObject(DiscoGroup.class);
}

private BinaryData cleanUp(BinaryData input) {
Expand Down Expand Up @@ -1678,7 +1679,7 @@ public ReportAssetSnapshotResult getSnapshot(ReportAssetSnapshotRequest reportAs
RequestOptions requestOptions = new RequestOptions();
return cleanUp(
getSnapshotWithResponse(BinaryData.fromObject(reportAssetSnapshotRequest), requestOptions).getValue())
.toObject(ReportAssetSnapshotResult.class);
.toObject(ReportAssetSnapshotResult.class);
}

/**
Expand All @@ -1700,7 +1701,7 @@ public ReportAssetSummaryResult getSummary(ReportAssetSummaryRequest reportAsset
RequestOptions requestOptions = new RequestOptions();
return cleanUp(
getSummaryWithResponse(BinaryData.fromObject(reportAssetSummaryRequest), requestOptions).getValue())
.toObject(ReportAssetSummaryResult.class);
.toObject(ReportAssetSummaryResult.class);
}

/**
Expand Down Expand Up @@ -1759,7 +1760,8 @@ public SavedFilter createOrReplaceSavedFilter(String filterName, SavedFilterData
RequestOptions requestOptions = new RequestOptions();
return cleanUp(
createOrReplaceSavedFilterWithResponse(filterName, BinaryData.fromObject(savedFilterData), requestOptions)
.getValue()).toObject(SavedFilter.class);
.getValue())
.toObject(SavedFilter.class);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,10 @@

package com.azure.analytics.defender.easm;

import com.azure.core.util.ServiceVersion;

/**
* Service version of EasmClient.
*/
public enum EasmServiceVersion implements ServiceVersion {
public enum EasmServiceVersion implements com.azure.core.util.ServiceVersion {
/**
* Enum value 2023-03-01-preview.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@

module com.azure.analytics.defender.easm {
requires transitive com.azure.core;

exports com.azure.analytics.defender.easm;
exports com.azure.analytics.defender.easm.models;

opens com.azure.analytics.defender.easm.models to com.azure.core, com.fasterxml.jackson.databind;
}
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ public Mono<Response<Embeddings>> getEmbeddingsWithResponse(String deploymentOrM
EmbeddingsOptions embeddingsOptions, RequestOptions requestOptions) {
return getEmbeddingsWithResponse(deploymentOrModelName, BinaryData.fromObject(embeddingsOptions),
requestOptions)
.map(response -> new SimpleResponse<>(response, response.getValue().toObject(Embeddings.class)));
.map(response -> new SimpleResponse<>(response, response.getValue().toObject(Embeddings.class)));
}

/**
Expand Down Expand Up @@ -467,7 +467,7 @@ public Mono<Response<Completions>> getCompletionsWithResponse(String deploymentO
CompletionsOptions completionsOptions, RequestOptions requestOptions) {
return getCompletionsWithResponse(deploymentOrModelName, BinaryData.fromObject(completionsOptions),
requestOptions)
.map(response -> new SimpleResponse<>(response, response.getValue().toObject(Completions.class)));
.map(response -> new SimpleResponse<>(response, response.getValue().toObject(Completions.class)));
}

/**
Expand Down Expand Up @@ -550,7 +550,7 @@ public Mono<Response<ChatCompletions>> getChatCompletionsWithResponse(String dep
ChatCompletionsOptions chatCompletionsOptions, RequestOptions requestOptions) {
return getChatCompletionsWithResponse(deploymentOrModelName, BinaryData.fromObject(chatCompletionsOptions),
requestOptions)
.map(response -> new SimpleResponse<>(response, response.getValue().toObject(ChatCompletions.class)));
.map(response -> new SimpleResponse<>(response, response.getValue().toObject(ChatCompletions.class)));
}

/**
Expand Down Expand Up @@ -578,7 +578,7 @@ public Mono<Embeddings> getEmbeddings(String deploymentOrModelName, EmbeddingsOp
RequestOptions requestOptions = new RequestOptions();
return getEmbeddingsWithResponse(deploymentOrModelName, BinaryData.fromObject(embeddingsOptions),
requestOptions).flatMap(FluxUtil::toMono)
.map(protocolMethodData -> protocolMethodData.toObject(Embeddings.class));
.map(protocolMethodData -> protocolMethodData.toObject(Embeddings.class));
}

/**
Expand Down Expand Up @@ -608,7 +608,7 @@ public Mono<Completions> getCompletions(String deploymentOrModelName, Completion
RequestOptions requestOptions = new RequestOptions();
return getCompletionsWithResponse(deploymentOrModelName, BinaryData.fromObject(completionsOptions),
requestOptions).flatMap(FluxUtil::toMono)
.map(protocolMethodData -> protocolMethodData.toObject(Completions.class));
.map(protocolMethodData -> protocolMethodData.toObject(Completions.class));
}

/**
Expand Down Expand Up @@ -688,7 +688,7 @@ public Mono<ChatCompletions> getChatCompletions(String deploymentOrModelName,
} else {
return getChatCompletionsWithAzureExtensionsWithResponse(deploymentOrModelName,
BinaryData.fromObject(chatCompletionsOptions), requestOptions).flatMap(FluxUtil::toMono)
.map(protocolMethodData -> protocolMethodData.toObject(ChatCompletions.class));
.map(protocolMethodData -> protocolMethodData.toObject(ChatCompletions.class));
}
}

Expand Down Expand Up @@ -722,7 +722,7 @@ public Flux<ChatCompletions> getChatCompletionsStream(String deploymentOrModelNa
} else {
responseStream = getChatCompletionsWithAzureExtensionsWithResponse(deploymentOrModelName,
BinaryData.fromObject(chatCompletionsOptions), requestOptions)
.flatMapMany(response -> response.getValue().toFluxByteBuffer());
.flatMapMany(response -> response.getValue().toFluxByteBuffer());
}
OpenAIServerSentEvents<ChatCompletions> chatCompletionsStream
= new OpenAIServerSentEvents<>(responseStream, ChatCompletions.class);
Expand Down Expand Up @@ -1395,7 +1395,7 @@ public Mono<String> getAudioTranscriptionAsPlainText(String deploymentOrModelNam
RequestOptions requestOptions = new RequestOptions();
return getAudioTranscriptionAsPlainTextWithResponse(deploymentOrModelName,
BinaryData.fromObject(audioTranscriptionOptions), requestOptions).flatMap(FluxUtil::toMono)
.map(protocolMethodData -> protocolMethodData.toObject(String.class));
.map(protocolMethodData -> protocolMethodData.toObject(String.class));
}

/**
Expand All @@ -1419,7 +1419,7 @@ public Mono<String> getAudioTranslationAsPlainText(String deploymentOrModelName,
RequestOptions requestOptions = new RequestOptions();
return getAudioTranslationAsPlainTextWithResponse(deploymentOrModelName,
BinaryData.fromObject(audioTranslationOptions), requestOptions).flatMap(FluxUtil::toMono)
.map(protocolMethodData -> protocolMethodData.toObject(String.class));
.map(protocolMethodData -> protocolMethodData.toObject(String.class));
}

/**
Expand Down Expand Up @@ -1450,7 +1450,7 @@ Mono<ChatCompletions> getChatCompletionsWithAzureExtensions(String deploymentOrM
RequestOptions requestOptions = new RequestOptions();
return getChatCompletionsWithAzureExtensionsWithResponse(deploymentOrModelName,
BinaryData.fromObject(chatCompletionsOptions), requestOptions).flatMap(FluxUtil::toMono)
.map(protocolMethodData -> protocolMethodData.toObject(ChatCompletions.class));
.map(protocolMethodData -> protocolMethodData.toObject(ChatCompletions.class));
}

/**
Expand Down Expand Up @@ -1526,7 +1526,7 @@ Mono<Response<ImageGenerations>> getImageGenerationsWithResponse(String deployme
ImageGenerationOptions imageGenerationOptions, RequestOptions requestOptions) {
return getImageGenerationsWithResponse(deploymentOrModelName, BinaryData.fromObject(imageGenerationOptions),
requestOptions)
.map(response -> new SimpleResponse<>(response, response.getValue().toObject(ImageGenerations.class)));
.map(response -> new SimpleResponse<>(response, response.getValue().toObject(ImageGenerations.class)));
}

/**
Expand All @@ -1551,7 +1551,7 @@ public Mono<ImageGenerations> getImageGenerations(String deploymentOrModelName,
RequestOptions requestOptions = new RequestOptions();
return getImageGenerationsWithResponse(deploymentOrModelName, BinaryData.fromObject(imageGenerationOptions),
requestOptions).flatMap(FluxUtil::toMono)
.map(protocolMethodData -> protocolMethodData.toObject(ImageGenerations.class));
.map(protocolMethodData -> protocolMethodData.toObject(ImageGenerations.class));
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -674,7 +674,7 @@ public ChatCompletions getChatCompletions(String deploymentOrModelName,
} else {
return getChatCompletionsWithAzureExtensionsWithResponse(deploymentOrModelName,
BinaryData.fromObject(chatCompletionsOptions), requestOptions).getValue()
.toObject(ChatCompletions.class);
.toObject(ChatCompletions.class);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,10 @@

package com.azure.ai.openai;

import com.azure.core.util.ServiceVersion;

/**
* Service version of OpenAIClient.
*/
public enum OpenAIServiceVersion implements ServiceVersion {
public enum OpenAIServiceVersion implements com.azure.core.util.ServiceVersion {
/**
* Enum value 2022-12-01.
*/
Expand Down
2 changes: 0 additions & 2 deletions sdk/openai/azure-ai-openai/src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@

module com.azure.ai.openai {
requires transitive com.azure.core;

exports com.azure.ai.openai;
exports com.azure.ai.openai.models;

opens com.azure.ai.openai.models to com.azure.core, com.fasterxml.jackson.databind;
opens com.azure.ai.openai.implementation.models to com.azure.core, com.fasterxml.jackson.databind;
opens com.azure.ai.openai.implementation to com.azure.core, com.fasterxml.jackson.databind;
Expand Down
Loading

0 comments on commit c9d92bd

Please sign in to comment.