Skip to content

Commit 724c20c

Browse files
author
SDKAuto
committed
CodeGen from PR 31097 in Azure/azure-rest-api-specs
Merge b4c304f51509a832a13c0cd940a994bc8764cb8a into c56bcb994cdb222ae05e428096f0804d3c68f78c
1 parent fc54dec commit 724c20c

31 files changed

+2601
-10
lines changed

eng/versioning/version_client.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,7 @@ com.azure.spring:spring-cloud-azure-stream-binder-servicebus-core;5.21.0;5.22.0-
257257
com.azure.spring:spring-cloud-azure-stream-binder-servicebus;5.21.0;5.22.0-beta.1
258258
com.azure.spring:spring-cloud-azure-testcontainers;5.21.0;5.22.0-beta.1
259259
com.azure:azure-spring-data-cosmos;5.21.0;5.22.0-beta.1
260+
com.azure:azure-ai-speech-transcription;1.0.0-beta.1;1.0.0-beta.1
260261
com.azure.resourcemanager:azure-resourcemanager;2.48.0;2.49.0-beta.1
261262
com.azure.resourcemanager:azure-resourcemanager-appplatform;2.48.0;2.49.0-beta.1
262263
com.azure.resourcemanager:azure-resourcemanager-appservice;2.48.0;2.49.0-beta.1
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Release History
2+
3+
## 1.0.0-beta.1 (Unreleased)
4+
5+
- Azure Transcription client library for Java. This package contains Microsoft Azure Transcription client library.
6+
7+
### Features Added
8+
9+
### Breaking Changes
10+
11+
### Bugs Fixed
12+
13+
### Other Changes
14+
### Features Added
15+
16+
- Initial release for the azure-ai-speech-transcription Java SDK.
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
# Azure Transcription client library for Java
2+
3+
Azure Transcription client library for Java.
4+
5+
This package contains Microsoft Azure Transcription client library.
6+
7+
## Documentation
8+
9+
Various documentation is available to help you get started
10+
11+
- [API reference documentation][docs]
12+
- [Product documentation][product_documentation]
13+
14+
## Getting started
15+
16+
### Prerequisites
17+
18+
- [Java Development Kit (JDK)][jdk] with version 8 or above
19+
- [Azure Subscription][azure_subscription]
20+
21+
### Adding the package to your product
22+
23+
[//]: # ({x-version-update-start;com.azure:azure-ai-speech-transcription;current})
24+
```xml
25+
<dependency>
26+
<groupId>com.azure</groupId>
27+
<artifactId>azure-ai-speech-transcription</artifactId>
28+
<version>1.0.0-beta.1</version>
29+
</dependency>
30+
```
31+
[//]: # ({x-version-update-end})
32+
33+
### Authentication
34+
35+
[Azure Identity][azure_identity] package provides the default implementation for authenticating the client.
36+
37+
## Key concepts
38+
39+
## Examples
40+
41+
```java com.azure.ai.speech.transcription.readme
42+
```
43+
44+
### Service API versions
45+
46+
The client library targets the latest service API version by default.
47+
The service client builder accepts an optional service API version parameter to specify which API version to communicate.
48+
49+
#### Select a service API version
50+
51+
You have the flexibility to explicitly select a supported service API version when initializing a service client via the service client builder.
52+
This ensures that the client can communicate with services using the specified API version.
53+
54+
When selecting an API version, it is important to verify that there are no breaking changes compared to the latest API version.
55+
If there are significant differences, API calls may fail due to incompatibility.
56+
57+
Always ensure that the chosen API version is fully supported and operational for your specific use case and that it aligns with the service's versioning policy.
58+
59+
## Troubleshooting
60+
61+
## Next steps
62+
63+
## Contributing
64+
65+
For details on contributing to this repository, see the [contributing guide](https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md).
66+
67+
1. Fork it
68+
1. Create your feature branch (`git checkout -b my-new-feature`)
69+
1. Commit your changes (`git commit -am 'Add some feature'`)
70+
1. Push to the branch (`git push origin my-new-feature`)
71+
1. Create new Pull Request
72+
73+
<!-- LINKS -->
74+
[product_documentation]: https://azure.microsoft.com/services/
75+
[docs]: https://azure.github.io/azure-sdk-for-java/
76+
[jdk]: https://learn.microsoft.com/azure/developer/java/fundamentals/
77+
[azure_subscription]: https://azure.microsoft.com/free/
78+
[azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"AssetsRepo":"Azure/azure-sdk-assets","AssetsRepoPrefixPath":"java","TagPrefix":"java/cognitiveservices/azure-ai-speech-transcription","Tag":""}
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
<!--
2+
~ Copyright (c) Microsoft Corporation. All rights reserved.
3+
~ Licensed under the MIT License.
4+
~ Code generated by Microsoft (R) TypeSpec Code Generator.
5+
-->
6+
<project xmlns="http://maven.apache.org/POM/4.0.0" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
7+
<modelVersion>4.0.0</modelVersion>
8+
<parent>
9+
<groupId>com.azure</groupId>
10+
<artifactId>azure-client-sdk-parent</artifactId>
11+
<version>1.7.0</version> <!-- {x-version-update;com.azure:azure-client-sdk-parent;current} -->
12+
<relativePath>../../parents/azure-client-sdk-parent</relativePath>
13+
</parent>
14+
15+
<groupId>com.azure</groupId>
16+
<artifactId>azure-ai-speech-transcription</artifactId>
17+
<version>1.0.0-beta.1</version> <!-- {x-version-update;com.azure:azure-ai-speech-transcription;current} -->
18+
<packaging>jar</packaging>
19+
20+
<name>Microsoft Azure SDK for Transcription</name>
21+
<description>This package contains Microsoft Azure Transcription client library.</description>
22+
<url>https://github.com/Azure/azure-sdk-for-java</url>
23+
24+
<licenses>
25+
<license>
26+
<name>The MIT License (MIT)</name>
27+
<url>http://opensource.org/licenses/MIT</url>
28+
<distribution>repo</distribution>
29+
</license>
30+
</licenses>
31+
32+
<scm>
33+
<url>https://github.com/Azure/azure-sdk-for-java</url>
34+
<connection>scm:git:[email protected]:Azure/azure-sdk-for-java.git</connection>
35+
<developerConnection>scm:git:[email protected]:Azure/azure-sdk-for-java.git</developerConnection>
36+
<tag>HEAD</tag>
37+
</scm>
38+
<developers>
39+
<developer>
40+
<id>microsoft</id>
41+
<name>Microsoft</name>
42+
</developer>
43+
</developers>
44+
<properties>
45+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
46+
</properties>
47+
<dependencies>
48+
<dependency>
49+
<groupId>com.azure</groupId>
50+
<artifactId>azure-core</artifactId>
51+
<version>1.55.3</version> <!-- {x-version-update;com.azure:azure-core;dependency} -->
52+
</dependency>
53+
<dependency>
54+
<groupId>com.azure</groupId>
55+
<artifactId>azure-core-http-netty</artifactId>
56+
<version>1.15.11</version> <!-- {x-version-update;com.azure:azure-core-http-netty;dependency} -->
57+
</dependency>
58+
<dependency>
59+
<groupId>com.azure</groupId>
60+
<artifactId>azure-core-test</artifactId>
61+
<version>1.27.0-beta.8</version> <!-- {x-version-update;com.azure:azure-core-test;dependency} -->
62+
<scope>test</scope>
63+
</dependency>
64+
<dependency>
65+
<groupId>com.azure</groupId>
66+
<artifactId>azure-identity</artifactId>
67+
<version>1.15.4</version> <!-- {x-version-update;com.azure:azure-identity;dependency} -->
68+
<scope>test</scope>
69+
</dependency>
70+
</dependencies>
71+
</project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License.
3+
// Code generated by Microsoft (R) TypeSpec Code Generator.
4+
5+
package com.azure.ai.speech.transcription;
6+
7+
import com.azure.ai.speech.transcription.implementation.MultipartFormDataHelper;
8+
import com.azure.ai.speech.transcription.implementation.TranscriptionClientImpl;
9+
import com.azure.ai.speech.transcription.models.TranscribeRequest;
10+
import com.azure.ai.speech.transcription.models.TranscriptionResult;
11+
import com.azure.core.annotation.Generated;
12+
import com.azure.core.annotation.ReturnType;
13+
import com.azure.core.annotation.ServiceClient;
14+
import com.azure.core.annotation.ServiceMethod;
15+
import com.azure.core.exception.ClientAuthenticationException;
16+
import com.azure.core.exception.HttpResponseException;
17+
import com.azure.core.exception.ResourceModifiedException;
18+
import com.azure.core.exception.ResourceNotFoundException;
19+
import com.azure.core.http.rest.RequestOptions;
20+
import com.azure.core.http.rest.Response;
21+
import com.azure.core.util.BinaryData;
22+
import com.azure.core.util.FluxUtil;
23+
import reactor.core.publisher.Mono;
24+
25+
/**
26+
* Initializes a new instance of the asynchronous TranscriptionClient type.
27+
*/
28+
@ServiceClient(builder = TranscriptionClientBuilder.class, isAsync = true)
29+
public final class TranscriptionAsyncClient {
30+
@Generated
31+
private final TranscriptionClientImpl serviceClient;
32+
33+
/**
34+
* Initializes an instance of TranscriptionAsyncClient class.
35+
*
36+
* @param serviceClient the service client implementation.
37+
*/
38+
@Generated
39+
TranscriptionAsyncClient(TranscriptionClientImpl serviceClient) {
40+
this.serviceClient = serviceClient;
41+
}
42+
43+
/**
44+
* Transcribes the provided audio stream.
45+
* <p><strong>Response Body Schema</strong></p>
46+
*
47+
* <pre>
48+
* {@code
49+
* {
50+
* durationMilliseconds: int (Required)
51+
* combinedPhrases (Required): [
52+
* (Required){
53+
* channel: Integer (Optional)
54+
* text: String (Required)
55+
* }
56+
* ]
57+
* phrases (Required): [
58+
* (Required){
59+
* channel: Integer (Optional)
60+
* speaker: Integer (Optional)
61+
* offsetMilliseconds: int (Required)
62+
* durationMilliseconds: int (Required)
63+
* text: String (Required)
64+
* words (Optional): [
65+
* (Optional){
66+
* text: String (Required)
67+
* offsetMilliseconds: int (Required)
68+
* durationMilliseconds: int (Required)
69+
* }
70+
* ]
71+
* locale: String (Optional)
72+
* confidence: double (Required)
73+
* }
74+
* ]
75+
* }
76+
* }
77+
* </pre>
78+
*
79+
* @param body The body of the multipart request.
80+
* @param requestOptions The options to configure the HTTP request before HTTP client sends it.
81+
* @throws HttpResponseException thrown if the request is rejected by server.
82+
* @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
83+
* @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
84+
* @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
85+
* @return the result of the transcribe operation along with {@link Response} on successful completion of
86+
* {@link Mono}.
87+
*/
88+
@Generated
89+
@ServiceMethod(returns = ReturnType.SINGLE)
90+
Mono<Response<BinaryData>> transcribeWithResponse(BinaryData body, RequestOptions requestOptions) {
91+
// Operation 'transcribe' is of content-type 'multipart/form-data'. Protocol API is not usable and hence not
92+
// generated.
93+
return this.serviceClient.transcribeWithResponseAsync(body, requestOptions);
94+
}
95+
96+
/**
97+
* Transcribes the provided audio stream.
98+
*
99+
* @param body The body of the multipart request.
100+
* @throws IllegalArgumentException thrown if parameters fail the validation.
101+
* @throws HttpResponseException thrown if the request is rejected by server.
102+
* @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
103+
* @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
104+
* @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
105+
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
106+
* @return the result of the transcribe operation on successful completion of {@link Mono}.
107+
*/
108+
@Generated
109+
@ServiceMethod(returns = ReturnType.SINGLE)
110+
public Mono<TranscriptionResult> transcribe(TranscribeRequest body) {
111+
// Generated convenience method for transcribeWithResponse
112+
RequestOptions requestOptions = new RequestOptions();
113+
return transcribeWithResponse(
114+
new MultipartFormDataHelper(requestOptions).serializeJsonField("options", body.getOptions())
115+
.serializeFileField("audio", body.getAudio().getContent(), body.getAudio().getContentType(),
116+
body.getAudio().getFilename())
117+
.end()
118+
.getRequestBody(),
119+
requestOptions).flatMap(FluxUtil::toMono)
120+
.map(protocolMethodData -> protocolMethodData.toObject(TranscriptionResult.class));
121+
}
122+
}

0 commit comments

Comments
 (0)