Skip to content

Commit

Permalink
feat: Add support for BatchRecognize
Browse files Browse the repository at this point in the history
Deprecate the `update_config_request` field in the `OperationMetadata` message, which was never used and is output only.

PiperOrigin-RevId: 517976288

Source-Link: googleapis/googleapis@7ee7867

Source-Link: googleapis/googleapis-gen@04050e1
Copy-Tag: eyJwIjoiYXBpcy9Hb29nbGUuQ2xvdWQuU3BlZWNoLlYyLy5Pd2xCb3QueWFtbCIsImgiOiIwNDA1MGUxNWU3YTQwOWY5ZDQyMWY2M2RiZmRmMzdlYWM3MmEzYzE0In0=
  • Loading branch information
gcf-owl-bot[bot] authored and jskeet committed Mar 21, 2023
1 parent 7c5742a commit 406087a
Show file tree
Hide file tree
Showing 11 changed files with 1,713 additions and 514 deletions.
Expand Up @@ -46,6 +46,7 @@ public async Task BatchRecognizeRequestObjectAsync()
},
Config = new RecognitionConfig(),
ConfigMask = new FieldMask(),
RecognitionOutputConfig = new RecognitionOutputConfig(),
};
// Make the request
Operation<BatchRecognizeResponse, OperationMetadata> response = await speechClient.BatchRecognizeAsync(request);
Expand Down
Expand Up @@ -45,6 +45,7 @@ public void BatchRecognizeRequestObject()
},
Config = new RecognitionConfig(),
ConfigMask = new FieldMask(),
RecognitionOutputConfig = new RecognitionOutputConfig(),
};
// Make the request
Operation<BatchRecognizeResponse, OperationMetadata> response = speechClient.BatchRecognize(request);
Expand Down
Expand Up @@ -2368,12 +2368,12 @@
"segments": [
{
"start": 20,
"end": 68,
"end": 69,
"type": "FULL"
},
{
"start": 36,
"end": 66,
"end": 67,
"type": "SHORT"
}
]
Expand Down Expand Up @@ -2417,12 +2417,12 @@
"segments": [
{
"start": 20,
"end": 69,
"end": 70,
"type": "FULL"
},
{
"start": 37,
"end": 67,
"end": 68,
"type": "SHORT"
}
]
Expand Down
Expand Up @@ -1333,6 +1333,7 @@ public void BatchRecognizeRequestObject()
},
Config = new RecognitionConfig(),
ConfigMask = new FieldMask(),
RecognitionOutputConfig = new RecognitionOutputConfig(),
};
// Make the request
Operation<BatchRecognizeResponse, OperationMetadata> response = speechClient.BatchRecognize(request);
Expand Down Expand Up @@ -1372,6 +1373,7 @@ public async Task BatchRecognizeRequestObjectAsync()
},
Config = new RecognitionConfig(),
ConfigMask = new FieldMask(),
RecognitionOutputConfig = new RecognitionOutputConfig(),
};
// Make the request
Operation<BatchRecognizeResponse, OperationMetadata> response = await speechClient.BatchRecognizeAsync(request);
Expand Down
2,130 changes: 1,637 additions & 493 deletions apis/Google.Cloud.Speech.V2/Google.Cloud.Speech.V2/CloudSpeech.g.cs

Large diffs are not rendered by default.

Expand Up @@ -3,7 +3,7 @@
// source: google/cloud/speech/v2/cloud_speech.proto
// </auto-generated>
// Original file comments:
// Copyright 2022 Google LLC
// Copyright 2023 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -351,7 +351,7 @@ public abstract partial class SpeechBase
/// <summary>
/// Returns the requested
/// [Recognizer][google.cloud.speech.v2.Recognizer]. Fails with
/// [NOT_FOUND][google.rpc.Code.NOT_FOUND] if the requested recognizer doesn't
/// [NOT_FOUND][google.rpc.Code.NOT_FOUND] if the requested Recognizer doesn't
/// exist.
/// </summary>
/// <param name="request">The request received from the client.</param>
Expand Down Expand Up @@ -738,7 +738,7 @@ protected SpeechClient(ClientBaseConfiguration configuration) : base(configurati
/// <summary>
/// Returns the requested
/// [Recognizer][google.cloud.speech.v2.Recognizer]. Fails with
/// [NOT_FOUND][google.rpc.Code.NOT_FOUND] if the requested recognizer doesn't
/// [NOT_FOUND][google.rpc.Code.NOT_FOUND] if the requested Recognizer doesn't
/// exist.
/// </summary>
/// <param name="request">The request to send to the server.</param>
Expand All @@ -754,7 +754,7 @@ protected SpeechClient(ClientBaseConfiguration configuration) : base(configurati
/// <summary>
/// Returns the requested
/// [Recognizer][google.cloud.speech.v2.Recognizer]. Fails with
/// [NOT_FOUND][google.rpc.Code.NOT_FOUND] if the requested recognizer doesn't
/// [NOT_FOUND][google.rpc.Code.NOT_FOUND] if the requested Recognizer doesn't
/// exist.
/// </summary>
/// <param name="request">The request to send to the server.</param>
Expand All @@ -768,7 +768,7 @@ protected SpeechClient(ClientBaseConfiguration configuration) : base(configurati
/// <summary>
/// Returns the requested
/// [Recognizer][google.cloud.speech.v2.Recognizer]. Fails with
/// [NOT_FOUND][google.rpc.Code.NOT_FOUND] if the requested recognizer doesn't
/// [NOT_FOUND][google.rpc.Code.NOT_FOUND] if the requested Recognizer doesn't
/// exist.
/// </summary>
/// <param name="request">The request to send to the server.</param>
Expand All @@ -784,7 +784,7 @@ protected SpeechClient(ClientBaseConfiguration configuration) : base(configurati
/// <summary>
/// Returns the requested
/// [Recognizer][google.cloud.speech.v2.Recognizer]. Fails with
/// [NOT_FOUND][google.rpc.Code.NOT_FOUND] if the requested recognizer doesn't
/// [NOT_FOUND][google.rpc.Code.NOT_FOUND] if the requested Recognizer doesn't
/// exist.
/// </summary>
/// <param name="request">The request to send to the server.</param>
Expand Down
Expand Up @@ -10,6 +10,7 @@
<ItemGroup>
<PackageReference Include="ConfigureAwaitChecker.Analyzer" Version="5.0.0" PrivateAssets="All" />
<PackageReference Include="Google.Api.Gax.Grpc" Version="[4.3.1, 5.0.0)" />
<PackageReference Include="Google.Cloud.Location" Version="[2.0.0, 3.0.0)" />
<PackageReference Include="Google.LongRunning" Version="[3.0.0, 4.0.0)" />
<PackageReference Include="Grpc.Core" Version="[2.46.5, 3.0.0)" PrivateAssets="None" Condition="'$(TargetFramework)'=='net462'" />
</ItemGroup>
Expand Down
Expand Up @@ -16,6 +16,7 @@

#pragma warning disable CS8981
using gaxgrpc = Google.Api.Gax.Grpc;
using gcl = Google.Cloud.Location;
using lro = Google.LongRunning;
using proto = Google.Protobuf;
using gpr = Google.Protobuf.Reflection;
Expand All @@ -31,6 +32,16 @@ internal static class PackageApiMetadata
.WithRequestNumericEnumJsonEncoding(true)
.WithHttpRuleOverrides(new scg::Dictionary<string, proto::ByteString>
{
{
"google.cloud.location.Locations.GetLocation",
// { "get": "/v2/{name=projects/*/locations/*}" }
proto::ByteString.FromBase64("EiEvdjIve25hbWU9cHJvamVjdHMvKi9sb2NhdGlvbnMvKn0=")
},
{
"google.cloud.location.Locations.ListLocations",
// { "get": "/v2/{name=projects/*}/locations" }
proto::ByteString.FromBase64("Eh8vdjIve25hbWU9cHJvamVjdHMvKn0vbG9jYXRpb25z")
},
{
"google.longrunning.Operations.CancelOperation",
// { "post": "/v2/{name=projects/*/locations/*/operations/*}:cancel", "body": "*" }
Expand All @@ -55,6 +66,7 @@ internal static class PackageApiMetadata

private static scg::IEnumerable<gpr::FileDescriptor> GetFileDescriptors()
{
yield return gcl::LocationsReflection.Descriptor;
yield return CloudSpeechReflection.Descriptor;
yield return lro::OperationsReflection.Descriptor;
}
Expand Down
Expand Up @@ -16,6 +16,7 @@

#pragma warning disable CS8981
using gaxgrpc = Google.Api.Gax.Grpc;
using gcl = Google.Cloud.Location;
using gcsv = Google.Cloud.Speech.V2;
using lro = Google.LongRunning;
using proto = Google.Protobuf;
Expand Down

0 comments on commit 406087a

Please sign in to comment.