Skip to content

Commit

Permalink
New endpoint in OCR service (#182)
Browse files Browse the repository at this point in the history
* added new endpoint to OCR service

* addressed change requests

* generated files

* cleanup and added first five to pdf service

* generated files

---------

Co-authored-by: “anton-cornak” <“anton.cornak@visma.com”>
  • Loading branch information
anton-cornak and “anton-cornak” committed Dec 18, 2023
1 parent 826b816 commit c1f6c46
Show file tree
Hide file tree
Showing 12 changed files with 589 additions and 40 deletions.
28 changes: 27 additions & 1 deletion gen/csharp/OcrserviceGrpc.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,14 @@ static T __Helper_DeserializeMessage<T>(grpc::DeserializationContext context, gl
__Marshaller_ssn_ocrservice_v1_GetTextAnnotationRequest,
__Marshaller_ssn_ocrservice_v1_GetTextAnnotationResponse);

[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
static readonly grpc::Method<global::Ssn.Ocrservice.V1.GetTextAnnotationRequest, global::Ssn.Ocrservice.V1.GetTextAnnotationResponse> __Method_GetTextAnnotations = new grpc::Method<global::Ssn.Ocrservice.V1.GetTextAnnotationRequest, global::Ssn.Ocrservice.V1.GetTextAnnotationResponse>(
grpc::MethodType.ServerStreaming,
__ServiceName,
"GetTextAnnotations",
__Marshaller_ssn_ocrservice_v1_GetTextAnnotationRequest,
__Marshaller_ssn_ocrservice_v1_GetTextAnnotationResponse);

/// <summary>Service descriptor</summary>
public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor
{
Expand All @@ -95,6 +103,12 @@ public abstract partial class OcrServiceBase
throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, ""));
}

[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
public virtual global::System.Threading.Tasks.Task GetTextAnnotations(global::Ssn.Ocrservice.V1.GetTextAnnotationRequest request, grpc::IServerStreamWriter<global::Ssn.Ocrservice.V1.GetTextAnnotationResponse> responseStream, grpc::ServerCallContext context)
{
throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, ""));
}

}

/// <summary>Client for OcrService</summary>
Expand Down Expand Up @@ -164,6 +178,16 @@ protected OcrServiceClient(ClientBaseConfiguration configuration) : base(configu
{
return CallInvoker.AsyncUnaryCall(__Method_GetTextAnnotation, null, options, request);
}
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
public virtual grpc::AsyncServerStreamingCall<global::Ssn.Ocrservice.V1.GetTextAnnotationResponse> GetTextAnnotations(global::Ssn.Ocrservice.V1.GetTextAnnotationRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
{
return GetTextAnnotations(request, new grpc::CallOptions(headers, deadline, cancellationToken));
}
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
public virtual grpc::AsyncServerStreamingCall<global::Ssn.Ocrservice.V1.GetTextAnnotationResponse> GetTextAnnotations(global::Ssn.Ocrservice.V1.GetTextAnnotationRequest request, grpc::CallOptions options)
{
return CallInvoker.AsyncServerStreamingCall(__Method_GetTextAnnotations, null, options, request);
}
/// <summary>Creates a new instance of client from given <c>ClientBaseConfiguration</c>.</summary>
[global::System.CodeDom.Compiler.GeneratedCode("grpc_csharp_plugin", null)]
protected override OcrServiceClient NewInstance(ClientBaseConfiguration configuration)
Expand All @@ -179,7 +203,8 @@ protected override OcrServiceClient NewInstance(ClientBaseConfiguration configur
{
return grpc::ServerServiceDefinition.CreateBuilder()
.AddMethod(__Method_OcrScanImage, serviceImpl.OcrScanImage)
.AddMethod(__Method_GetTextAnnotation, serviceImpl.GetTextAnnotation).Build();
.AddMethod(__Method_GetTextAnnotation, serviceImpl.GetTextAnnotation)
.AddMethod(__Method_GetTextAnnotations, serviceImpl.GetTextAnnotations).Build();
}

/// <summary>Register service method with a service binder with or without implementation. Useful when customizing the service binding logic.
Expand All @@ -191,6 +216,7 @@ public static void BindService(grpc::ServiceBinderBase serviceBinder, OcrService
{
serviceBinder.AddMethod(__Method_OcrScanImage, serviceImpl == null ? null : new grpc::UnaryServerMethod<global::Ssn.Ocrservice.V1.OcrScanImageRequest, global::Ssn.Ocrservice.V1.OcrScanImageResponse>(serviceImpl.OcrScanImage));
serviceBinder.AddMethod(__Method_GetTextAnnotation, serviceImpl == null ? null : new grpc::UnaryServerMethod<global::Ssn.Ocrservice.V1.GetTextAnnotationRequest, global::Ssn.Ocrservice.V1.GetTextAnnotationResponse>(serviceImpl.GetTextAnnotation));
serviceBinder.AddMethod(__Method_GetTextAnnotations, serviceImpl == null ? null : new grpc::ServerStreamingServerMethod<global::Ssn.Ocrservice.V1.GetTextAnnotationRequest, global::Ssn.Ocrservice.V1.GetTextAnnotationResponse>(serviceImpl.GetTextAnnotations));
}

}
Expand Down
16 changes: 9 additions & 7 deletions gen/csharp/Ssn/Ocrservice/V1/Ocrservice.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,19 @@ static OcrserviceReflection() {
"EjEKBWltYWdlGAMgASgLMhsuZ29vZ2xlLnByb3RvYnVmLkJ5dGVzVmFsdWVS",
"BWltYWdlIikKE09jclNjYW5JbWFnZVJlcXVlc3QSEgoEZGF0YRgBIAEoDFIE",
"ZGF0YSIzChRPY3JTY2FuSW1hZ2VSZXNwb25zZRIbCgl0ZXNzX2hvY3IYASAB",
"KAlSCHRlc3NIb2NyMt0BCgpPY3JTZXJ2aWNlEl8KDE9jclNjYW5JbWFnZRIm",
"KAlSCHRlc3NIb2NyMtACCgpPY3JTZXJ2aWNlEl8KDE9jclNjYW5JbWFnZRIm",
"LnNzbi5vY3JzZXJ2aWNlLnYxLk9jclNjYW5JbWFnZVJlcXVlc3QaJy5zc24u",
"b2Nyc2VydmljZS52MS5PY3JTY2FuSW1hZ2VSZXNwb25zZRJuChFHZXRUZXh0",
"QW5ub3RhdGlvbhIrLnNzbi5vY3JzZXJ2aWNlLnYxLkdldFRleHRBbm5vdGF0",
"aW9uUmVxdWVzdBosLnNzbi5vY3JzZXJ2aWNlLnYxLkdldFRleHRBbm5vdGF0",
"aW9uUmVzcG9uc2VC1QEKGmFpLnZpc21hLnNzbi5vY3JzZXJ2aWNlLnYxQg9P",
"Y3JzZXJ2aWNlUHJvdG9QAVpAZ2l0aHViLmNvbS9lLWNvbm9taWMvdm1sYXBp",
"cy9nZW4vZ28vc3NuL29jcnNlcnZpY2UvdjE7b2Nyc2VydmljZaICA1NPWKoC",
"EVNzbi5PY3JzZXJ2aWNlLlYxygIRU3NuXE9jcnNlcnZpY2VcVjHiAh1Tc25c",
"T2Nyc2VydmljZVxWMVxHUEJNZXRhZGF0YeoCE1Nzbjo6T2Nyc2VydmljZTo6",
"VjFiBnByb3RvMw=="));
"aW9uUmVzcG9uc2UScQoSR2V0VGV4dEFubm90YXRpb25zEisuc3NuLm9jcnNl",
"cnZpY2UudjEuR2V0VGV4dEFubm90YXRpb25SZXF1ZXN0Giwuc3NuLm9jcnNl",
"cnZpY2UudjEuR2V0VGV4dEFubm90YXRpb25SZXNwb25zZTABQtUBChphaS52",
"aXNtYS5zc24ub2Nyc2VydmljZS52MUIPT2Nyc2VydmljZVByb3RvUAFaQGdp",
"dGh1Yi5jb20vZS1jb25vbWljL3ZtbGFwaXMvZ2VuL2dvL3Nzbi9vY3JzZXJ2",
"aWNlL3YxO29jcnNlcnZpY2WiAgNTT1iqAhFTc24uT2Nyc2VydmljZS5WMcoC",
"EVNzblxPY3JzZXJ2aWNlXFYx4gIdU3NuXE9jcnNlcnZpY2VcVjFcR1BCTWV0",
"YWRhdGHqAhNTc246Ok9jcnNlcnZpY2U6OlYxYgZwcm90bzM="));
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
new pbr::FileDescriptor[] { global::Google.Protobuf.WellKnownTypes.WrappersReflection.Descriptor, global::Ssn.Annotator.V1.AnnotatorReflection.Descriptor, global::Ssn.Type.TextAnnotationReflection.Descriptor, },
new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] {
Expand Down
277 changes: 277 additions & 0 deletions gen/go/ssn/ocrservice/v1/mock/mock_ocrservice_grpc.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit c1f6c46

Please sign in to comment.