| 542 | |
| 543 | |
| 544 | Operation createOperation( |
| 545 | const Offer::Operation& info, |
| 546 | const OperationStatus& latestStatus, |
| 547 | const Option<FrameworkID>& frameworkId, |
| 548 | const Option<SlaveID>& slaveId, |
| 549 | const Option<UUID>& operationUUID) |
| 550 | { |
| 551 | Operation operation; |
| 552 | if (frameworkId.isSome()) { |
| 553 | operation.mutable_framework_id()->CopyFrom(frameworkId.get()); |
| 554 | } |
| 555 | if (slaveId.isSome()) { |
| 556 | operation.mutable_slave_id()->CopyFrom(slaveId.get()); |
| 557 | } |
| 558 | operation.mutable_info()->CopyFrom(info); |
| 559 | operation.mutable_latest_status()->CopyFrom(latestStatus); |
| 560 | if (operationUUID.isSome()) { |
| 561 | operation.mutable_uuid()->CopyFrom(operationUUID.get()); |
| 562 | } else { |
| 563 | operation.mutable_uuid()->CopyFrom(protobuf::createUUID()); |
| 564 | } |
| 565 | |
| 566 | return operation; |
| 567 | } |
| 568 | |
| 569 | |
| 570 | UpdateOperationStatusMessage createUpdateOperationStatusMessage( |
no test coverage detected