Converts an project object to its protobuf representation. Returns: An ProjectProto protobuf.
(self)
| 153 | return project |
| 154 | |
| 155 | def to_proto(self) -> ProjectProto: |
| 156 | """ |
| 157 | Converts an project object to its protobuf representation. |
| 158 | |
| 159 | Returns: |
| 160 | An ProjectProto protobuf. |
| 161 | """ |
| 162 | meta = ProjectMetaProto() |
| 163 | if self.created_timestamp: |
| 164 | meta.created_timestamp.FromDatetime(self.created_timestamp) |
| 165 | if self.last_updated_timestamp: |
| 166 | meta.last_updated_timestamp.FromDatetime(self.last_updated_timestamp) |
| 167 | |
| 168 | spec = ProjectSpecProto( |
| 169 | name=self.name, |
| 170 | description=self.description, |
| 171 | tags=self.tags, |
| 172 | owner=self.owner, |
| 173 | ) |
| 174 | |
| 175 | return ProjectProto(spec=spec, meta=meta) |
no outgoing calls