Skip to content
Merged
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
7 changes: 7 additions & 0 deletions proto/DateTimeOffsetDto.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package Diadoc.Api.Proto;

message DateTimeOffsetDto
{
required sfixed64 UtcTicks = 1;
required sfixed64 OffsetTicks = 2;
}
3 changes: 3 additions & 0 deletions proto/PowersOfAttorney/PowerOfAttorney.proto
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import "Content_v3.proto";
import "Timestamp.proto";
import "User.proto";
import "DateTimeOffsetDto.proto";

package Diadoc.Api.Proto.PowersOfAttorney;

Expand All @@ -22,6 +23,8 @@ message PowerOfAttorney {
required PowerOfAttorneyPermissionsInfo PermissionsInfo = 9;
optional PowerOfAttorneyDelegationInfo DelegationInfo = 10;
repeated PowerOfAttorneyRepresentative Representatives = 11;
required DateTimeOffsetDto StartAtByMoscow = 12;
required DateTimeOffsetDto ExpireAtByMoscow = 13;
}

message PowerOfAttorneyIssuer {
Expand Down
21 changes: 21 additions & 0 deletions src/Proto/DateTimeOffsetDto.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
using System;

namespace Diadoc.Api.Proto
{
public partial class DateTimeOffsetDto
{
public DateTimeOffset ToDateTimeOffset()
{
return new DateTimeOffset(UtcTicks, TimeSpan.Zero).ToOffset(TimeSpan.FromTicks(OffsetTicks));
}

public static explicit operator DateTimeOffset(DateTimeOffsetDto value) => value.ToDateTimeOffset();

public static explicit operator DateTimeOffsetDto(DateTimeOffset value)
=> new DateTimeOffsetDto
{
UtcTicks = value.UtcTicks,
OffsetTicks = value.Offset.Ticks
};
}
}
37 changes: 37 additions & 0 deletions src/Proto/DateTimeOffsetDto.proto.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
//------------------------------------------------------------------------------
// <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: DateTimeOffsetDto.proto
namespace Diadoc.Api.Proto
{
[global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"DateTimeOffsetDto")]
public partial class DateTimeOffsetDto : global::ProtoBuf.IExtensible
{
public DateTimeOffsetDto() {}

private long _UtcTicks;
[global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"UtcTicks", DataFormat = global::ProtoBuf.DataFormat.FixedSize)]
public long UtcTicks
{
get { return _UtcTicks; }
set { _UtcTicks = value; }
}
private long _OffsetTicks;
[global::ProtoBuf.ProtoMember(2, IsRequired = true, Name=@"OffsetTicks", DataFormat = global::ProtoBuf.DataFormat.FixedSize)]
public long OffsetTicks
{
get { return _OffsetTicks; }
set { _OffsetTicks = value; }
}
private global::ProtoBuf.IExtension extensionObject;
global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
{ return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
}

}
15 changes: 15 additions & 0 deletions src/Proto/PowersOfAttorney/PowerOfAttorney.proto.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
// Note: requires additional types generated from: Content_v3.proto
// Note: requires additional types generated from: Timestamp.proto
// Note: requires additional types generated from: User.proto
// Note: requires additional types generated from: DateTimeOffsetDto.proto
namespace Diadoc.Api.Proto.PowersOfAttorney
{
[global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"PowerOfAttorneyFullId")]
Expand Down Expand Up @@ -134,6 +135,20 @@ public Diadoc.Api.Proto.PowersOfAttorney.PowerOfAttorneyDelegationInfo Delegatio
get { return _Representatives; }
}

private Diadoc.Api.Proto.DateTimeOffsetDto _StartAtByMoscow;
[global::ProtoBuf.ProtoMember(12, IsRequired = true, Name=@"StartAtByMoscow", DataFormat = global::ProtoBuf.DataFormat.Default)]
public Diadoc.Api.Proto.DateTimeOffsetDto StartAtByMoscow
{
get { return _StartAtByMoscow; }
set { _StartAtByMoscow = value; }
}
private Diadoc.Api.Proto.DateTimeOffsetDto _ExpireAtByMoscow;
[global::ProtoBuf.ProtoMember(13, IsRequired = true, Name=@"ExpireAtByMoscow", DataFormat = global::ProtoBuf.DataFormat.Default)]
public Diadoc.Api.Proto.DateTimeOffsetDto ExpireAtByMoscow
{
get { return _ExpireAtByMoscow; }
set { _ExpireAtByMoscow = 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
Loading