Skip to content
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
6 changes: 6 additions & 0 deletions proto/Employees/Employee.proto
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ message Employee
required string Position = 3;
required bool CanBeInvitedForChat = 4;
optional Timestamp CreationTimestamp = 5;
optional EmployeeExternalIdentity ExternalIdentity = 6;
}

message EmployeePermissions {
Expand All @@ -31,3 +32,8 @@ message EmployeeList {
repeated Employee Employees = 1;
required int32 TotalCount = 2;
}

message EmployeeExternalIdentity {
optional string ExternalId = 1;
optional string Email = 2;
}
8 changes: 8 additions & 0 deletions proto/Employees/EmployeeToCreate.proto
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ message EmployeeToCreateCredentials
{
optional EmployeeToCreateByLogin Login = 1;
optional EmployeeToCreateByCertificate Certificate = 2;
optional EmployeeToCreateBySsoProvider SsoProvider = 3;
}
message EmployeeToCreateByLogin
{
Expand All @@ -27,3 +28,10 @@ message EmployeeToCreateByCertificate
optional string AccessBasis = 2;
optional string Email = 3;
}

message EmployeeToCreateBySsoProvider
{
required string Email = 1;
optional FullName FullName = 2;
required string ProviderId = 3;
}
6 changes: 6 additions & 0 deletions src/ComDiadocApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -762,6 +762,7 @@ FileContent GetContent(
int contentType = 0);

Employee GetEmployee(string authToken, string boxId, string userId);
EmployeeList GetEmployeesByExternalId(string authToken, string boxId, string externalId);
EmployeeList GetEmployees(string authToken, string boxId, int page = 0, int count = 0);
Employee CreateEmployee(string authToken, string boxId, [MarshalAs(UnmanagedType.IDispatch)] object employeeToCreate);
Employee UpdateEmployee(string authToken, string boxId, string userId, [MarshalAs(UnmanagedType.IDispatch)] object employeeToUpdate);
Expand Down Expand Up @@ -1166,6 +1167,11 @@ public Employee GetEmployee(string authToken, string boxId, string userId)
return diadoc.GetEmployee(authToken, boxId, userId);
}

public EmployeeList GetEmployeesByExternalId(string authToken, string boxId, string externalId)
{
return diadoc.GetEmployeesByExternalId(authToken, boxId, externalId);
}

public EmployeeList GetEmployees(string authToken, string boxId, int page = 0, int count = 0)
{
return diadoc.GetEmployees(
Expand Down
10 changes: 9 additions & 1 deletion src/DiadocApi.Async.cs
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@
public Task<OrganizationList> GetOrganizationsByInnKppAsync(string inn, string kpp, bool includeRelations = false)
{
if (inn == null) throw new ArgumentNullException("inn");
return diadocHttpApi.GetOrganizationsByInnKppAsync(inn, kpp, includeRelations);

Check warning on line 128 in src/DiadocApi.Async.cs

View workflow job for this annotation

GitHub Actions / build_and_test

'DiadocHttpApi.GetOrganizationsByInnKppAsync(string, string, bool)' is obsolete: 'Use overload with authToken argument'
}

public Task<OrganizationList> GetOrganizationsByInnKppAsync(string authToken, string inn, string kpp, bool includeRelations = false)
Expand All @@ -138,7 +138,7 @@
public Task<OrganizationList> GetOrganizationsByForeignTaxpayerCodeAsync(string foreignTaxpayerCode, bool includeRelations = false)
{
if (foreignTaxpayerCode == null) throw new ArgumentNullException(nameof(foreignTaxpayerCode));
return diadocHttpApi.GetOrganizationsByForeignTaxpayerCodeAsync(foreignTaxpayerCode, includeRelations);

Check warning on line 141 in src/DiadocApi.Async.cs

View workflow job for this annotation

GitHub Actions / build_and_test

'DiadocHttpApi.GetOrganizationsByForeignTaxpayerCodeAsync(string, bool)' is obsolete: 'Use overload with authToken argument'
}

public Task<OrganizationList> GetOrganizationsByForeignTaxpayerCodeAsync(string authToken, string foreignTaxpayerCode, bool includeRelations = false)
Expand All @@ -151,7 +151,7 @@
public Task<Organization> GetOrganizationByIdAsync(string orgId)
{
if (orgId == null) throw new ArgumentNullException("orgId");
return diadocHttpApi.GetOrganizationByIdAsync(orgId);

Check warning on line 154 in src/DiadocApi.Async.cs

View workflow job for this annotation

GitHub Actions / build_and_test

'DiadocHttpApi.GetOrganizationByIdAsync(string)' is obsolete: 'Use overload with authToken argument'
}

public Task<Organization> GetOrganizationByIdAsync(string authToken, string orgId)
Expand All @@ -164,7 +164,7 @@
public Task<Organization> GetOrganizationByBoxIdAsync(string boxId)
{
if (boxId == null) throw new ArgumentNullException("boxId");
return diadocHttpApi.GetOrganizationByBoxIdAsync(boxId);

Check warning on line 167 in src/DiadocApi.Async.cs

View workflow job for this annotation

GitHub Actions / build_and_test

'DiadocHttpApi.GetOrganizationByBoxIdAsync(string)' is obsolete: 'Use overload with authToken argument'
}

public Task<Organization> GetOrganizationByBoxIdAsync(string authToken, string boxId)
Expand All @@ -177,7 +177,7 @@
public Task<Organization> GetOrganizationByFnsParticipantIdAsync(string fnsParticipantId)
{
if (fnsParticipantId == null) throw new ArgumentException("fnsParticipantId");
return diadocHttpApi.GetOrganizationByFnsParticipantIdAsync(fnsParticipantId);

Check warning on line 180 in src/DiadocApi.Async.cs

View workflow job for this annotation

GitHub Actions / build_and_test

'DiadocHttpApi.GetOrganizationByFnsParticipantIdAsync(string)' is obsolete: 'Use overload with authToken argument'
}

public Task<Organization> GetOrganizationByFnsParticipantIdAsync(string authToken, string fnsParticipantId)
Expand All @@ -190,7 +190,7 @@
public Task<Organization> GetOrganizationByInnKppAsync(string inn, string kpp)
{
if (inn == null) throw new ArgumentException("inn");
return diadocHttpApi.GetOrganizationByInnKppAsync(inn, kpp);

Check warning on line 193 in src/DiadocApi.Async.cs

View workflow job for this annotation

GitHub Actions / build_and_test

'DiadocHttpApi.GetOrganizationByInnKppAsync(string, string)' is obsolete: 'Use overload with authToken argument'
}

public Task<Organization> GetOrganizationByInnKppAsync(string authToken, string inn, string kpp)
Expand All @@ -203,7 +203,7 @@
public Task<Organization> GetOrganizationByForeignTaxpayerCodeAsync(string foreignTaxpayerCode)
{
if (foreignTaxpayerCode == null) throw new ArgumentNullException(nameof(foreignTaxpayerCode));
return diadocHttpApi.GetOrganizationByForeignTaxpayerCodeAsync(foreignTaxpayerCode);

Check warning on line 206 in src/DiadocApi.Async.cs

View workflow job for this annotation

GitHub Actions / build_and_test

'DiadocHttpApi.GetOrganizationByForeignTaxpayerCodeAsync(string)' is obsolete: 'Use overload with authToken argument'
}

public Task<Organization> GetOrganizationByForeignTaxpayerCodeAsync(string authToken, string foreignTaxpayerCode)
Expand All @@ -221,7 +221,7 @@
public Task<Box> GetBoxAsync(string boxId)
{
if (boxId == null) throw new ArgumentNullException("boxId");
return diadocHttpApi.GetBoxAsync(boxId);

Check warning on line 224 in src/DiadocApi.Async.cs

View workflow job for this annotation

GitHub Actions / build_and_test

'DiadocHttpApi.GetBoxAsync(string)' is obsolete: 'Use overload with authToken argument'
}

public Task<Box> GetBoxAsync(string authToken, string boxId)
Expand Down Expand Up @@ -799,7 +799,7 @@
{
return diadocHttpApi.GetDocumentsAsync(authToken, filter);
}

public Task<DocumentList> GetDocumentsV4Async(string authToken, string boxId, GetDocumentsV4Request request)
{
return diadocHttpApi.GetDocumentsV4Async(authToken, boxId, request);
Expand Down Expand Up @@ -1028,7 +1028,7 @@

public Task<RussianAddress> ParseRussianAddressAsync(string address)
{
return diadocHttpApi.ParseRussianAddressAsync(address);

Check warning on line 1031 in src/DiadocApi.Async.cs

View workflow job for this annotation

GitHub Actions / build_and_test

'DiadocHttpApi.ParseRussianAddressAsync(string)' is obsolete: 'Use overload with authToken argument'
}

public Task<RussianAddress> ParseRussianAddressAsync(string authToken, string address)
Expand Down Expand Up @@ -1162,7 +1162,7 @@

public Task<UniversalTransferDocumentSellerTitleInfo> ParseUniversalTransferDocumentSellerTitleXmlAsync(byte[] xmlContent, string documentVersion = DefaultDocumentVersions.Utd)
{
return diadocHttpApi.ParseUniversalTransferDocumentSellerTitleXmlAsync(xmlContent, documentVersion);

Check warning on line 1165 in src/DiadocApi.Async.cs

View workflow job for this annotation

GitHub Actions / build_and_test

'DiadocHttpApi.ParseUniversalTransferDocumentSellerTitleXmlAsync(byte[], string)' is obsolete: 'Use overload with authToken argument'
}

public Task<UniversalTransferDocumentSellerTitleInfo> ParseUniversalTransferDocumentSellerTitleXmlAsync(string authToken, byte[] xmlContent, string documentVersion = DefaultDocumentVersions.Utd)
Expand Down Expand Up @@ -1640,6 +1640,14 @@
return diadocHttpApi.GetEmployeeAsync(authToken, boxId, userId);
}

public Task<EmployeeList> GetEmployeesByExternalIdAsync(string authToken, string boxId, string externalId)
{
if (authToken == null) throw new ArgumentNullException("authToken");
if (boxId == null) throw new ArgumentNullException("boxId");
if (externalId == null) throw new ArgumentNullException("externalId");
return diadocHttpApi.GetEmployeesByExternalIdAsync(authToken, boxId, externalId);
}

public Task<EmployeeList> GetEmployeesAsync(string authToken, string boxId, int? page, int? count)
{
if (authToken == null) throw new ArgumentNullException("authToken");
Expand Down
8 changes: 8 additions & 0 deletions src/DiadocApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1793,6 +1793,14 @@ public Employee GetEmployee(string authToken, string boxId, string userId)
return diadocHttpApi.GetEmployee(authToken, boxId, userId);
}

public EmployeeList GetEmployeesByExternalId(string authToken, string boxId, string externalId)
{
if (authToken == null) throw new ArgumentNullException("authToken");
if (boxId == null) throw new ArgumentNullException("boxId");
if (externalId == null) throw new ArgumentNullException("externalId");
return diadocHttpApi.GetEmployeesByExternalId(authToken, boxId, externalId);
}

public EmployeeList GetEmployees(string authToken, string boxId, int? page, int? count)
{
if (authToken == null) throw new ArgumentNullException("authToken");
Expand Down
10 changes: 9 additions & 1 deletion src/DiadocHttpApi.Employees.Async.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@ public Task<Employee> GetEmployeeAsync(string authToken, string boxId, string us
return PerformHttpRequestAsync<Employee>(authToken, "GET", queryString.BuildPathAndQuery());
}

public Task<EmployeeList> GetEmployeesByExternalIdAsync(string authToken, string boxId, string externalId)
{
var queryString = new PathAndQueryBuilder("/GetEmployeesByExternalId");
queryString.AddParameter("boxId", boxId);
queryString.AddParameter("externalId", externalId);
return PerformHttpRequestAsync<EmployeeList>(authToken, "GET", queryString.BuildPathAndQuery());
}

public Task<EmployeeList> GetEmployeesAsync(string authToken, string boxId, int? page, int? count)
{
var queryString = new PathAndQueryBuilder("/GetEmployees");
Expand Down Expand Up @@ -70,4 +78,4 @@ public Task<Employee> GetMyEmployeeAsync(string authToken, string boxId)
return PerformHttpRequestAsync<Employee>(authToken, "GET", queryString.BuildPathAndQuery());
}
}
}
}
8 changes: 8 additions & 0 deletions src/DiadocHttpApi.Employees.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@ public Employee GetEmployee(string authToken, string boxId, string userId)
return PerformHttpRequest<Employee>(authToken, "GET", queryString.BuildPathAndQuery());
}

public EmployeeList GetEmployeesByExternalId(string authToken, string boxId, string externalId)
{
var queryString = new PathAndQueryBuilder("/GetEmployeesByExternalId");
queryString.AddParameter("boxId", boxId);
queryString.AddParameter("externalId", externalId);
return PerformHttpRequest<EmployeeList>(authToken, "GET", queryString.BuildPathAndQuery());
}

public EmployeeList GetEmployees(string authToken, string boxId, int? page, int? count)
{
var queryString = new PathAndQueryBuilder("/GetEmployees");
Expand Down
2 changes: 2 additions & 0 deletions src/IDiadocApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -471,6 +471,7 @@ byte[] ParseTitleXml(
DetectTitleResponse DetectDocumentTitles(string authToken, string boxId, byte[] content);
FileContent GetContent(string authToken, string typeNamedId, string function, string version, int titleIndex, XsdContentType contentType = default(XsdContentType));
Employee GetEmployee(string authToken, string boxId, string userId);
EmployeeList GetEmployeesByExternalId(string authToken, string boxId, string externalId);
EmployeeList GetEmployees(string authToken, string boxId, int? page, int? count);
Employee CreateEmployee(string authToken, string boxId, EmployeeToCreate employeeToCreate);
Employee UpdateEmployee(string authToken, string boxId, string userId, EmployeeToUpdate employeeToUpdate);
Expand Down Expand Up @@ -1002,6 +1003,7 @@ Task<AcquireCounteragentResultV2> WaitAcquireCounteragentResultV2Async(
[Obsolete("In order to download XSD schema use the link provided in DocumentTitle.XsdUrl")]
Task<FileContent> GetContentAsync(string authToken, string typeNamedId, string function, string version, int titleIndex, XsdContentType contentType = default(XsdContentType));
Task<Employee> GetEmployeeAsync(string authToken, string boxId, string userId);
Task<EmployeeList> GetEmployeesByExternalIdAsync(string authToken, string boxId, string externalId);
Task<EmployeeList> GetEmployeesAsync(string authToken, string boxId, int? page, int? count);
Task<Employee> CreateEmployeeAsync(string authToken, string boxId, EmployeeToCreate employeeToCreate);
Task<Employee> UpdateEmployeeAsync(string authToken, string boxId, string userId, EmployeeToUpdate employeeToUpdate);
Expand Down
37 changes: 37 additions & 0 deletions src/Proto/Employees/Employee.proto.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,15 @@ public Diadoc.Api.Proto.Timestamp CreationTimestamp
get { return _CreationTimestamp; }
set { _CreationTimestamp = value; }
}

private Diadoc.Api.Proto.Employees.EmployeeExternalIdentity _ExternalIdentity = null;
[global::ProtoBuf.ProtoMember(6, IsRequired = false, Name=@"ExternalIdentity", DataFormat = global::ProtoBuf.DataFormat.Default)]
[global::System.ComponentModel.DefaultValue(null)]
public Diadoc.Api.Proto.Employees.EmployeeExternalIdentity ExternalIdentity
{
get { return _ExternalIdentity; }
set { _ExternalIdentity = value; }
}
private global::ProtoBuf.IExtension extensionObject;
global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
{ return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
Expand Down Expand Up @@ -162,4 +171,32 @@ public int TotalCount
{ return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
}

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


private string _ExternalId = "";
[global::ProtoBuf.ProtoMember(1, IsRequired = false, Name=@"ExternalId", DataFormat = global::ProtoBuf.DataFormat.Default)]
[global::System.ComponentModel.DefaultValue("")]
public string ExternalId
{
get { return _ExternalId; }
set { _ExternalId = value; }
}

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

}
42 changes: 42 additions & 0 deletions src/Proto/Employees/EmployeeToCreate.proto.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,15 @@ public Diadoc.Api.Proto.Employees.EmployeeToCreateByCertificate Certificate
get { return _Certificate; }
set { _Certificate = value; }
}

private Diadoc.Api.Proto.Employees.EmployeeToCreateBySsoProvider _SsoProvider = null;
[global::ProtoBuf.ProtoMember(3, IsRequired = false, Name=@"SsoProvider", DataFormat = global::ProtoBuf.DataFormat.Default)]
[global::System.ComponentModel.DefaultValue(null)]
public Diadoc.Api.Proto.Employees.EmployeeToCreateBySsoProvider SsoProvider
{
get { return _SsoProvider; }
set { _SsoProvider = value; }
}
private global::ProtoBuf.IExtension extensionObject;
global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
{ return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
Expand Down Expand Up @@ -141,4 +150,37 @@ public string Email
{ return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
}

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

private string _Email;
[global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"Email", DataFormat = global::ProtoBuf.DataFormat.Default)]
public string Email
{
get { return _Email; }
set { _Email = value; }
}

private Diadoc.Api.Proto.FullName _FullName = null;
[global::ProtoBuf.ProtoMember(2, IsRequired = false, Name=@"FullName", DataFormat = global::ProtoBuf.DataFormat.Default)]
[global::System.ComponentModel.DefaultValue(null)]
public Diadoc.Api.Proto.FullName FullName
{
get { return _FullName; }
set { _FullName = value; }
}
private string _ProviderId;
[global::ProtoBuf.ProtoMember(3, IsRequired = true, Name=@"ProviderId", DataFormat = global::ProtoBuf.DataFormat.Default)]
public string ProviderId
{
get { return _ProviderId; }
set { _ProviderId = value; }
}
private global::ProtoBuf.IExtension extensionObject;
global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
{ return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
}

}
Loading