Skip to content

ddcore-10433: add new method GetPartnerEvents #1262

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions proto/PartnerEvents/PartnerEventsApi.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
//partner events api

import "Timestamp.proto";
import "DocumentId.proto";
import "TotalCountType.proto";
import "Docflow/DocumentWithDocflowV4.proto";

package Diadoc.Api.Proto.PartnerEvents;

message GetPartnerEventsRequest
{
required string Cursor = 1;
repeated string DocumentDirections = 2;
repeated string MessageTypes = 3;
optional int32 Limit = 4 [default = 100];
}

message GetPartnerEventsResponse
{
repeated PartnerEvent Events = 1;
required string LastCursor = 2;
}

message PartnerEvent
{
required string EventId = 1;
required Timestamp Timestamp = 2;
required DocumentId DocumentId = 3;
optional Docflow.DocumentWithDocflowV4 Document = 4;
}
6 changes: 6 additions & 0 deletions src/ComDocflowApi.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System.Runtime.InteropServices;
using Diadoc.Api.Proto.Docflow;
using Diadoc.Api.Proto.PartnerEvents;

namespace Diadoc.Api
{
Expand All @@ -19,7 +20,7 @@

public GetDocflowBatchResponseV3 GetDocflows(string authToken, string boxId, object request)
{
return docflowApi.GetDocflows(authToken, boxId, (GetDocflowBatchRequest) request);

Check warning on line 23 in src/ComDocflowApi.cs

View workflow job for this annotation

GitHub Actions / build_and_test

'IDocflowApi.GetDocflows(string, string, GetDocflowBatchRequest)' is obsolete: 'Use GetDocflowsV4()'
}

public GetDocflowBatchResponseV4 GetDocflowsV4(string authToken, string boxId, object request)
Expand All @@ -29,7 +30,7 @@

public GetDocflowEventsResponseV3 GetDocflowEvents(string authToken, string boxId, object request)
{
return docflowApi.GetDocflowEvents(authToken, boxId, (GetDocflowEventsRequest) request);

Check warning on line 33 in src/ComDocflowApi.cs

View workflow job for this annotation

GitHub Actions / build_and_test

'IDocflowApi.GetDocflowEvents(string, string, GetDocflowEventsRequest)' is obsolete: 'Use GetDocflowEventsV4()'
}

public GetDocflowEventsResponseV4 GetDocflowEventsV4(string authToken, string boxId, object request)
Expand All @@ -39,7 +40,7 @@

public SearchDocflowsResponseV3 SearchDocflows(string authToken, string boxId, object request)
{
return docflowApi.SearchDocflows(authToken, boxId, (SearchDocflowsRequest) request);

Check warning on line 43 in src/ComDocflowApi.cs

View workflow job for this annotation

GitHub Actions / build_and_test

'IDocflowApi.SearchDocflows(string, string, SearchDocflowsRequest)' is obsolete: 'Use SearchDocflowsV4()'
}

public SearchDocflowsResponseV4 SearchDocflowsV4(string authToken, string boxId, object request)
Expand All @@ -49,12 +50,17 @@

public GetDocflowsByPacketIdResponseV3 GetDocflowsByPacketId(string authToken, string boxId, object request)
{
return docflowApi.GetDocflowsByPacketId(authToken, boxId, (GetDocflowsByPacketIdRequest) request);

Check warning on line 53 in src/ComDocflowApi.cs

View workflow job for this annotation

GitHub Actions / build_and_test

'IDocflowApi.GetDocflowsByPacketId(string, string, GetDocflowsByPacketIdRequest)' is obsolete: 'Use GetDocflowsByPacketIdV4()'
}

public GetDocflowsByPacketIdResponseV4 GetDocflowsByPacketIdV4(string authToken, string boxId, object request)
{
return docflowApi.GetDocflowsByPacketIdV4(authToken, boxId, (GetDocflowsByPacketIdRequest) request);
}

public GetPartnerEventsResponse GetPartnerEvents(string authToken, object request)
{
return docflowApi.GetPartnerEventsV4(authToken, (GetPartnerEventsRequest) request);
}
}
}
7 changes: 7 additions & 0 deletions src/DiadocHttpApi.Docflow.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Diadoc.Api.Proto.Docflow;
using Diadoc.Api.Proto.PartnerEvents;
using JetBrains.Annotations;

namespace Diadoc.Api
Expand Down Expand Up @@ -97,6 +98,12 @@ public GetDocflowsByPacketIdResponseV4 GetDocflowsByPacketIdV4([NotNull] string
var queryString = BuildQueryStringWithBoxId("/V4/GetDocflowsByPacketId", boxId);
return diadocHttpApi.PerformHttpRequest<GetDocflowsByPacketIdRequest, GetDocflowsByPacketIdResponseV4>(authToken, queryString, request);
}

[NotNull]
public GetPartnerEventsResponse GetPartnerEventsV4([NotNull] string authToken, [NotNull] GetPartnerEventsRequest request)
{
return diadocHttpApi.PerformHttpRequest<GetPartnerEventsRequest, GetPartnerEventsResponse>(authToken, "/GetPartnerEvents", request);
}
}
}
}
7 changes: 7 additions & 0 deletions src/DiadocHttpApi.DocflowAsync.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System.Threading.Tasks;
using Diadoc.Api.Proto.Docflow;
using Diadoc.Api.Proto.PartnerEvents;
using JetBrains.Annotations;

namespace Diadoc.Api
Expand Down Expand Up @@ -91,6 +92,12 @@ public Task<GetDocflowsByPacketIdResponseV4> GetDocflowsByPacketIdV4Async([NotNu
var queryString = BuildQueryStringWithBoxId("/V4/GetDocflowsByPacketId", boxId);
return diadocHttpApi.PerformHttpRequestAsync<GetDocflowsByPacketIdRequest, GetDocflowsByPacketIdResponseV4>(authToken, queryString, request);
}

[ItemNotNull]
public Task<GetPartnerEventsResponse> GetPartnerEventsV4Async([NotNull] string authToken, [NotNull]GetPartnerEventsRequest request)
{
return diadocHttpApi.PerformHttpRequestAsync<GetPartnerEventsRequest, GetPartnerEventsResponse>(authToken, "/GetPartnerEvents", request);
}
}
}
}
6 changes: 6 additions & 0 deletions src/DocflowApi.Async.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System;
using System.Threading.Tasks;
using Diadoc.Api.Proto.Docflow;
using Diadoc.Api.Proto.PartnerEvents;

namespace Diadoc.Api
{
Expand Down Expand Up @@ -53,5 +54,10 @@ public Task<GetDocflowsByPacketIdResponseV4> GetDocflowsByPacketIdV4Async(string
if (string.IsNullOrEmpty(boxId)) throw new ArgumentNullException("boxId");
return docflowHttpApi.GetDocflowsByPacketIdV4Async(authToken, boxId, request);
}

public Task<GetPartnerEventsResponse> GetPartnerEventsV4Async(string authToken, GetPartnerEventsRequest request)
{
return docflowHttpApi.GetPartnerEventsV4Async(authToken, request);
}
}
}
6 changes: 6 additions & 0 deletions src/DocflowApi.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using Diadoc.Api.Proto.Docflow;
using Diadoc.Api.Proto.PartnerEvents;

namespace Diadoc.Api
{
Expand Down Expand Up @@ -60,5 +61,10 @@ public GetDocflowsByPacketIdResponseV4 GetDocflowsByPacketIdV4(string authToken,
if (string.IsNullOrEmpty(boxId)) throw new ArgumentNullException("boxId");
return docflowHttpApi.GetDocflowsByPacketIdV4(authToken, boxId, request);
}

public GetPartnerEventsResponse GetPartnerEventsV4(string authToken, GetPartnerEventsRequest request)
{
return docflowHttpApi.GetPartnerEventsV4(authToken, request);
}
}
}
2 changes: 2 additions & 0 deletions src/IComDocflowApi.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System.Runtime.InteropServices;
using Diadoc.Api.Proto.Docflow;
using Diadoc.Api.Proto.PartnerEvents;

namespace Diadoc.Api
{
Expand All @@ -15,5 +16,6 @@ public interface IComDocflowApi
GetDocflowEventsResponseV4 GetDocflowEventsV4(string authToken, string boxId, [MarshalAs(UnmanagedType.IDispatch)] object request);
SearchDocflowsResponseV4 SearchDocflowsV4(string authToken, string boxId, [MarshalAs(UnmanagedType.IDispatch)] object request);
GetDocflowsByPacketIdResponseV4 GetDocflowsByPacketIdV4(string authToken, string boxId, [MarshalAs(UnmanagedType.IDispatch)] object request);
GetPartnerEventsResponse GetPartnerEvents(string authToken, [MarshalAs(UnmanagedType.IDispatch)] object request);
}
}
3 changes: 3 additions & 0 deletions src/IDocflowApi.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using Diadoc.Api.Proto.Docflow;
using Diadoc.Api.Proto.PartnerEvents;

#if !NET35
using System.Threading.Tasks;
Expand All @@ -21,6 +22,7 @@ public interface IDocflowApi
GetDocflowEventsResponseV4 GetDocflowEventsV4(string authToken, string boxId, GetDocflowEventsRequest request);
SearchDocflowsResponseV4 SearchDocflowsV4(string authToken, string boxId, SearchDocflowsRequest request);
GetDocflowsByPacketIdResponseV4 GetDocflowsByPacketIdV4(string authToken, string boxId, GetDocflowsByPacketIdRequest request);
GetPartnerEventsResponse GetPartnerEventsV4(string authToken, GetPartnerEventsRequest request);

#if !NET35
[Obsolete("Use GetDocflowsV4Async()")]
Expand All @@ -35,6 +37,7 @@ public interface IDocflowApi
Task<GetDocflowEventsResponseV4> GetDocflowEventsV4Async(string authToken, string boxId, GetDocflowEventsRequest request);
Task<SearchDocflowsResponseV4> SearchDocflowsV4Async(string authToken, string boxId, SearchDocflowsRequest request);
Task<GetDocflowsByPacketIdResponseV4> GetDocflowsByPacketIdV4Async(string authToken, string boxId, GetDocflowsByPacketIdRequest request);
Task<GetPartnerEventsResponse> GetPartnerEventsV4Async(string authToken, GetPartnerEventsRequest request);
#endif
}
}
121 changes: 121 additions & 0 deletions src/Proto/PartnerEvents/PartnerEventsApi.proto.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

// Generated from: PartnerEvents/PartnerEventsApi.proto
// Note: requires additional types generated from: Timestamp.proto
// Note: requires additional types generated from: DocumentId.proto
// Note: requires additional types generated from: TotalCountType.proto
// Note: requires additional types generated from: Docflow/DocumentWithDocflowV4.proto
namespace Diadoc.Api.Proto.PartnerEvents
{
[global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"GetPartnerEventsRequest")]
public partial class GetPartnerEventsRequest : global::ProtoBuf.IExtensible
{
public GetPartnerEventsRequest() {}

private string _Cursor;
[global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"Cursor", DataFormat = global::ProtoBuf.DataFormat.Default)]
public string Cursor
{
get { return _Cursor; }
set { _Cursor = value; }
}
private readonly global::System.Collections.Generic.List<string> _DocumentDirections = new global::System.Collections.Generic.List<string>();
[global::ProtoBuf.ProtoMember(2, Name=@"DocumentDirections", DataFormat = global::ProtoBuf.DataFormat.Default)]
public global::System.Collections.Generic.List<string> DocumentDirections
{
get { return _DocumentDirections; }
}

private readonly global::System.Collections.Generic.List<string> _MessageTypes = new global::System.Collections.Generic.List<string>();
[global::ProtoBuf.ProtoMember(3, Name=@"MessageTypes", DataFormat = global::ProtoBuf.DataFormat.Default)]
public global::System.Collections.Generic.List<string> MessageTypes
{
get { return _MessageTypes; }
}


private int _Limit = (int)100;
[global::ProtoBuf.ProtoMember(4, IsRequired = false, Name=@"Limit", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
[global::System.ComponentModel.DefaultValue((int)100)]
public int Limit
{
get { return _Limit; }
set { _Limit = value; }
}
private global::ProtoBuf.IExtension extensionObject;
global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
{ return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
}

[global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"GetPartnerEventsResponse")]
public partial class GetPartnerEventsResponse : global::ProtoBuf.IExtensible
{
public GetPartnerEventsResponse() {}

private readonly global::System.Collections.Generic.List<Diadoc.Api.Proto.PartnerEvents.PartnerEvent> _Events = new global::System.Collections.Generic.List<Diadoc.Api.Proto.PartnerEvents.PartnerEvent>();
[global::ProtoBuf.ProtoMember(1, Name=@"Events", DataFormat = global::ProtoBuf.DataFormat.Default)]
public global::System.Collections.Generic.List<Diadoc.Api.Proto.PartnerEvents.PartnerEvent> Events
{
get { return _Events; }
}

private string _LastCursor;
[global::ProtoBuf.ProtoMember(2, IsRequired = true, Name=@"LastCursor", DataFormat = global::ProtoBuf.DataFormat.Default)]
public string LastCursor
{
get { return _LastCursor; }
set { _LastCursor = value; }
}
private global::ProtoBuf.IExtension extensionObject;
global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
{ return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
}

[global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"PartnerEvent")]
public partial class PartnerEvent : global::ProtoBuf.IExtensible
{
public PartnerEvent() {}

private string _EventId;
[global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"EventId", DataFormat = global::ProtoBuf.DataFormat.Default)]
public string EventId
{
get { return _EventId; }
set { _EventId = value; }
}
private Diadoc.Api.Proto.Timestamp _Timestamp;
[global::ProtoBuf.ProtoMember(2, IsRequired = true, Name=@"Timestamp", DataFormat = global::ProtoBuf.DataFormat.Default)]
public Diadoc.Api.Proto.Timestamp Timestamp
{
get { return _Timestamp; }
set { _Timestamp = value; }
}
private Diadoc.Api.Proto.DocumentId _DocumentId;
[global::ProtoBuf.ProtoMember(3, IsRequired = true, Name=@"DocumentId", DataFormat = global::ProtoBuf.DataFormat.Default)]
public Diadoc.Api.Proto.DocumentId DocumentId
{
get { return _DocumentId; }
set { _DocumentId = value; }
}

private Diadoc.Api.Proto.Docflow.DocumentWithDocflowV4 _Document = null;
[global::ProtoBuf.ProtoMember(4, IsRequired = false, Name=@"Document", DataFormat = global::ProtoBuf.DataFormat.Default)]
[global::System.ComponentModel.DefaultValue(null)]
public Diadoc.Api.Proto.Docflow.DocumentWithDocflowV4 Document
{
get { return _Document; }
set { _Document = value; }
}
private global::ProtoBuf.IExtension extensionObject;
global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
{ return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
}

}
Loading