| 1077 | |
| 1078 | template <typename TResource, typename TLabels> |
| 1079 | inline typename TResource::ReservationInfo createDynamicReservationInfo( |
| 1080 | const std::string& role, |
| 1081 | const Option<std::string>& principal = None(), |
| 1082 | const Option<TLabels>& labels = None()) |
| 1083 | { |
| 1084 | typename TResource::ReservationInfo info; |
| 1085 | |
| 1086 | info.set_type(TResource::ReservationInfo::DYNAMIC); |
| 1087 | info.set_role(role); |
| 1088 | |
| 1089 | if (principal.isSome()) { |
| 1090 | info.set_principal(principal.get()); |
| 1091 | } |
| 1092 | |
| 1093 | if (labels.isSome()) { |
| 1094 | info.mutable_labels()->CopyFrom(labels.get()); |
| 1095 | } |
| 1096 | |
| 1097 | return info; |
| 1098 | } |
| 1099 | |
| 1100 | |
| 1101 | template < |
no test coverage detected