Skip to content

Commit 0a27948

Browse files
committed
Moved commit "Add created_by to Operations API" from ydb repo
1 parent 2fe54ce commit 0a27948

File tree

2 files changed

+17
-7
lines changed

2 files changed

+17
-7
lines changed

include/ydb-cpp-sdk/client/types/operation/operation.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,9 @@ class TOperation {
3232
const TOperationId& Id() const;
3333
bool Ready() const;
3434
const TStatus& Status() const;
35-
TInstant StartTime() const;
35+
TInstant CreateTime() const;
3636
TInstant EndTime() const;
37+
const std::string& CreatedBy() const;
3738

3839
std::string ToString() const;
3940
std::string ToJsonString() const;

src/client/types/operation/operation.cpp

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class TOperation::TImpl {
2121
: Id_(operation.id(), true /* allowEmpty */)
2222
, Status_(std::move(status))
2323
, Ready_(operation.ready())
24-
, StartTime_(ProtoTimestampToInstant(operation.start_time()))
24+
, CreateTime_(ProtoTimestampToInstant(operation.create_time()))
2525
, EndTime_(ProtoTimestampToInstant(operation.end_time()))
2626
, Operation_(std::move(operation))
2727
{
@@ -39,14 +39,18 @@ class TOperation::TImpl {
3939
return Status_;
4040
}
4141

42-
TInstant StartTime() const {
43-
return StartTime_;
42+
TInstant CreateTime() const {
43+
return CreateTime_;
4444
}
4545

4646
TInstant EndTime() const {
4747
return EndTime_;
4848
}
4949

50+
const std::string& CreatedBy() const {
51+
return CreatedBy_;
52+
}
53+
5054
const Ydb::Operations::Operation& GetProto() const {
5155
return Operation_;
5256
}
@@ -55,8 +59,9 @@ class TOperation::TImpl {
5559
const TOperationId Id_;
5660
const TStatus Status_;
5761
const bool Ready_;
58-
const TInstant StartTime_;
62+
const TInstant CreateTime_;
5963
const TInstant EndTime_;
64+
const std::string CreatedBy_;
6065
const Ydb::Operations::Operation Operation_;
6166
};
6267

@@ -80,14 +85,18 @@ const TStatus& TOperation::Status() const {
8085
return Impl_->Status();
8186
}
8287

83-
TInstant TOperation::StartTime() const {
84-
return Impl_->StartTime();
88+
TInstant TOperation::CreateTime() const {
89+
return Impl_->CreateTime();
8590
}
8691

8792
TInstant TOperation::EndTime() const {
8893
return Impl_->EndTime();
8994
}
9095

96+
const std::string& TOperation::CreatedBy() const {
97+
return Impl_->CreatedBy();
98+
}
99+
91100
std::string TOperation::ToString() const {
92101
TString result;
93102
TStringOutput out(result);

0 commit comments

Comments
 (0)