Skip to content

Commit 06f1d78

Browse files
author
makarov.d
committed
ddcore-10433: add new method GetPartnerEvents
1 parent 6125562 commit 06f1d78

File tree

9 files changed

+188
-0
lines changed

9 files changed

+188
-0
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
//partner events api
2+
3+
import "Timestamp.proto";
4+
import "DocumentId.proto";
5+
import "TotalCountType.proto";
6+
import "Docflow/DocumentWithDocflowV4.proto";
7+
8+
package Diadoc.Api.Proto.PartnerEvents;
9+
10+
message GetPartnerEventsRequest
11+
{
12+
required string Cursor = 1;
13+
repeated string Directions = 2;
14+
repeated string MessageTypes = 3;
15+
optional int32 Limit = 4 [default = 100];
16+
}
17+
18+
message GetPartnerEventsResponse
19+
{
20+
repeated PartnerEvent Events = 1;
21+
required string LastCursor = 2;
22+
}
23+
24+
message PartnerEvent
25+
{
26+
required string EventId = 1;
27+
required Timestamp Timestamp = 2;
28+
required DocumentId DocumentId = 3;
29+
optional Docflow.DocumentWithDocflowV4 Document = 4;
30+
}

src/ComDocflowApi.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System.Runtime.InteropServices;
22
using Diadoc.Api.Proto.Docflow;
3+
using Diadoc.Api.Proto.PartnerEvents;
34

45
namespace Diadoc.Api
56
{
@@ -56,5 +57,10 @@ public GetDocflowsByPacketIdResponseV4 GetDocflowsByPacketIdV4(string authToken,
5657
{
5758
return docflowApi.GetDocflowsByPacketIdV4(authToken, boxId, (GetDocflowsByPacketIdRequest) request);
5859
}
60+
61+
public GetPartnerEventsResponse GetPartnerEvents(string authToken, object request)
62+
{
63+
return docflowApi.GetPartnerEventsV4(authToken, (GetPartnerEventsRequest) request);
64+
}
5965
}
6066
}

src/DiadocHttpApi.Docflow.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using Diadoc.Api.Proto.Docflow;
2+
using Diadoc.Api.Proto.PartnerEvents;
23
using JetBrains.Annotations;
34

45
namespace Diadoc.Api
@@ -97,6 +98,12 @@ public GetDocflowsByPacketIdResponseV4 GetDocflowsByPacketIdV4([NotNull] string
9798
var queryString = BuildQueryStringWithBoxId("/V4/GetDocflowsByPacketId", boxId);
9899
return diadocHttpApi.PerformHttpRequest<GetDocflowsByPacketIdRequest, GetDocflowsByPacketIdResponseV4>(authToken, queryString, request);
99100
}
101+
102+
[NotNull]
103+
public GetPartnerEventsResponse GetPartnerEventsV4([NotNull] string authToken, [NotNull] GetPartnerEventsRequest request)
104+
{
105+
return diadocHttpApi.PerformHttpRequest<GetPartnerEventsRequest, GetPartnerEventsResponse>(authToken, "/GetPartnerEvents", request);
106+
}
100107
}
101108
}
102109
}

src/DiadocHttpApi.DocflowAsync.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System.Threading.Tasks;
22
using Diadoc.Api.Proto.Docflow;
3+
using Diadoc.Api.Proto.PartnerEvents;
34
using JetBrains.Annotations;
45

56
namespace Diadoc.Api
@@ -91,6 +92,12 @@ public Task<GetDocflowsByPacketIdResponseV4> GetDocflowsByPacketIdV4Async([NotNu
9192
var queryString = BuildQueryStringWithBoxId("/V4/GetDocflowsByPacketId", boxId);
9293
return diadocHttpApi.PerformHttpRequestAsync<GetDocflowsByPacketIdRequest, GetDocflowsByPacketIdResponseV4>(authToken, queryString, request);
9394
}
95+
96+
[ItemNotNull]
97+
public Task<GetPartnerEventsResponse> GetPartnerEventsV4Async([NotNull] string authToken, [NotNull]GetPartnerEventsRequest request)
98+
{
99+
return diadocHttpApi.PerformHttpRequestAsync<GetPartnerEventsRequest, GetPartnerEventsResponse>(authToken, "/GetPartnerEvents", request);
100+
}
94101
}
95102
}
96103
}

src/DocflowApi.Async.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using System;
22
using System.Threading.Tasks;
33
using Diadoc.Api.Proto.Docflow;
4+
using Diadoc.Api.Proto.PartnerEvents;
45

56
namespace Diadoc.Api
67
{
@@ -53,5 +54,10 @@ public Task<GetDocflowsByPacketIdResponseV4> GetDocflowsByPacketIdV4Async(string
5354
if (string.IsNullOrEmpty(boxId)) throw new ArgumentNullException("boxId");
5455
return docflowHttpApi.GetDocflowsByPacketIdV4Async(authToken, boxId, request);
5556
}
57+
58+
public Task<GetPartnerEventsResponse> GetPartnerEventsV4Async(string authToken, GetPartnerEventsRequest request)
59+
{
60+
return docflowHttpApi.GetPartnerEventsV4Async(authToken, request);
61+
}
5662
}
5763
}

src/DocflowApi.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System;
22
using Diadoc.Api.Proto.Docflow;
3+
using Diadoc.Api.Proto.PartnerEvents;
34

45
namespace Diadoc.Api
56
{
@@ -60,5 +61,10 @@ public GetDocflowsByPacketIdResponseV4 GetDocflowsByPacketIdV4(string authToken,
6061
if (string.IsNullOrEmpty(boxId)) throw new ArgumentNullException("boxId");
6162
return docflowHttpApi.GetDocflowsByPacketIdV4(authToken, boxId, request);
6263
}
64+
65+
public GetPartnerEventsResponse GetPartnerEventsV4(string authToken, GetPartnerEventsRequest request)
66+
{
67+
return docflowHttpApi.GetPartnerEventsV4(authToken, request);
68+
}
6369
}
6470
}

src/IComDocflowApi.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System.Runtime.InteropServices;
22
using Diadoc.Api.Proto.Docflow;
3+
using Diadoc.Api.Proto.PartnerEvents;
34

45
namespace Diadoc.Api
56
{
@@ -15,5 +16,6 @@ public interface IComDocflowApi
1516
GetDocflowEventsResponseV4 GetDocflowEventsV4(string authToken, string boxId, [MarshalAs(UnmanagedType.IDispatch)] object request);
1617
SearchDocflowsResponseV4 SearchDocflowsV4(string authToken, string boxId, [MarshalAs(UnmanagedType.IDispatch)] object request);
1718
GetDocflowsByPacketIdResponseV4 GetDocflowsByPacketIdV4(string authToken, string boxId, [MarshalAs(UnmanagedType.IDispatch)] object request);
19+
GetPartnerEventsResponse GetPartnerEvents(string authToken, [MarshalAs(UnmanagedType.IDispatch)] object request);
1820
}
1921
}

src/IDocflowApi.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System;
22
using Diadoc.Api.Proto.Docflow;
3+
using Diadoc.Api.Proto.PartnerEvents;
34

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

2527
#if !NET35
2628
[Obsolete("Use GetDocflowsV4Async()")]
@@ -35,6 +37,7 @@ public interface IDocflowApi
3537
Task<GetDocflowEventsResponseV4> GetDocflowEventsV4Async(string authToken, string boxId, GetDocflowEventsRequest request);
3638
Task<SearchDocflowsResponseV4> SearchDocflowsV4Async(string authToken, string boxId, SearchDocflowsRequest request);
3739
Task<GetDocflowsByPacketIdResponseV4> GetDocflowsByPacketIdV4Async(string authToken, string boxId, GetDocflowsByPacketIdRequest request);
40+
Task<GetPartnerEventsResponse> GetPartnerEventsV4Async(string authToken, GetPartnerEventsRequest request);
3841
#endif
3942
}
4043
}
Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
//------------------------------------------------------------------------------
2+
// <auto-generated>
3+
// This code was generated by a tool.
4+
//
5+
// Changes to this file may cause incorrect behavior and will be lost if
6+
// the code is regenerated.
7+
// </auto-generated>
8+
//------------------------------------------------------------------------------
9+
10+
// Generated from: PartnerEvents/PartnerEventsApi.proto
11+
// Note: requires additional types generated from: Timestamp.proto
12+
// Note: requires additional types generated from: DocumentId.proto
13+
// Note: requires additional types generated from: TotalCountType.proto
14+
// Note: requires additional types generated from: Docflow/DocumentWithDocflowV4.proto
15+
namespace Diadoc.Api.Proto.PartnerEvents
16+
{
17+
[global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"GetPartnerEventsRequest")]
18+
public partial class GetPartnerEventsRequest : global::ProtoBuf.IExtensible
19+
{
20+
public GetPartnerEventsRequest() {}
21+
22+
private string _Cursor;
23+
[global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"Cursor", DataFormat = global::ProtoBuf.DataFormat.Default)]
24+
public string Cursor
25+
{
26+
get { return _Cursor; }
27+
set { _Cursor = value; }
28+
}
29+
private readonly global::System.Collections.Generic.List<string> _Directions = new global::System.Collections.Generic.List<string>();
30+
[global::ProtoBuf.ProtoMember(2, Name=@"Directions", DataFormat = global::ProtoBuf.DataFormat.Default)]
31+
public global::System.Collections.Generic.List<string> Directions
32+
{
33+
get { return _Directions; }
34+
}
35+
36+
private readonly global::System.Collections.Generic.List<string> _MessageTypes = new global::System.Collections.Generic.List<string>();
37+
[global::ProtoBuf.ProtoMember(3, Name=@"MessageTypes", DataFormat = global::ProtoBuf.DataFormat.Default)]
38+
public global::System.Collections.Generic.List<string> MessageTypes
39+
{
40+
get { return _MessageTypes; }
41+
}
42+
43+
44+
private int _Limit = (int)100;
45+
[global::ProtoBuf.ProtoMember(4, IsRequired = false, Name=@"Limit", DataFormat = global::ProtoBuf.DataFormat.TwosComplement)]
46+
[global::System.ComponentModel.DefaultValue((int)100)]
47+
public int Limit
48+
{
49+
get { return _Limit; }
50+
set { _Limit = value; }
51+
}
52+
private global::ProtoBuf.IExtension extensionObject;
53+
global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
54+
{ return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
55+
}
56+
57+
[global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"GetPartnerEventsResponse")]
58+
public partial class GetPartnerEventsResponse : global::ProtoBuf.IExtensible
59+
{
60+
public GetPartnerEventsResponse() {}
61+
62+
private readonly global::System.Collections.Generic.List<Diadoc.Api.Proto.PartnerEvents.PartnerEvent> _Events = new global::System.Collections.Generic.List<Diadoc.Api.Proto.PartnerEvents.PartnerEvent>();
63+
[global::ProtoBuf.ProtoMember(1, Name=@"Events", DataFormat = global::ProtoBuf.DataFormat.Default)]
64+
public global::System.Collections.Generic.List<Diadoc.Api.Proto.PartnerEvents.PartnerEvent> Events
65+
{
66+
get { return _Events; }
67+
}
68+
69+
private string _LastCursor;
70+
[global::ProtoBuf.ProtoMember(2, IsRequired = true, Name=@"LastCursor", DataFormat = global::ProtoBuf.DataFormat.Default)]
71+
public string LastCursor
72+
{
73+
get { return _LastCursor; }
74+
set { _LastCursor = value; }
75+
}
76+
private global::ProtoBuf.IExtension extensionObject;
77+
global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
78+
{ return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
79+
}
80+
81+
[global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"PartnerEvent")]
82+
public partial class PartnerEvent : global::ProtoBuf.IExtensible
83+
{
84+
public PartnerEvent() {}
85+
86+
private string _EventId;
87+
[global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"EventId", DataFormat = global::ProtoBuf.DataFormat.Default)]
88+
public string EventId
89+
{
90+
get { return _EventId; }
91+
set { _EventId = value; }
92+
}
93+
private Diadoc.Api.Proto.Timestamp _Timestamp;
94+
[global::ProtoBuf.ProtoMember(2, IsRequired = true, Name=@"Timestamp", DataFormat = global::ProtoBuf.DataFormat.Default)]
95+
public Diadoc.Api.Proto.Timestamp Timestamp
96+
{
97+
get { return _Timestamp; }
98+
set { _Timestamp = value; }
99+
}
100+
private Diadoc.Api.Proto.DocumentId _DocumentId;
101+
[global::ProtoBuf.ProtoMember(3, IsRequired = true, Name=@"DocumentId", DataFormat = global::ProtoBuf.DataFormat.Default)]
102+
public Diadoc.Api.Proto.DocumentId DocumentId
103+
{
104+
get { return _DocumentId; }
105+
set { _DocumentId = value; }
106+
}
107+
108+
private Diadoc.Api.Proto.Docflow.DocumentWithDocflowV4 _Document = null;
109+
[global::ProtoBuf.ProtoMember(4, IsRequired = false, Name=@"Document", DataFormat = global::ProtoBuf.DataFormat.Default)]
110+
[global::System.ComponentModel.DefaultValue(null)]
111+
public Diadoc.Api.Proto.Docflow.DocumentWithDocflowV4 Document
112+
{
113+
get { return _Document; }
114+
set { _Document = value; }
115+
}
116+
private global::ProtoBuf.IExtension extensionObject;
117+
global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
118+
{ return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
119+
}
120+
121+
}

0 commit comments

Comments
 (0)