code: func (op *Operation) ToProto(wrappedID string) *api.UploadOperation {
  	var ref *api.ObjectRef
  	if op.Status == api.UploadStatus_PUBLISHED {
  		ref = &api.ObjectRef{
  			HashAlgo:  op.HashAlgo,
  			HexDigest: op.HexDigest,
  		}
  	}
  	return &api.UploadOperation{
  		OperationId:  wrappedID,
  		UploadUrl:    op.UploadURL,
  		Status:       op.Status,
  		Object:       ref,
  		ErrorMessage: op.Error,
  	}
  }
docs: // ToProto constructs UploadOperation proto message.
  //
  // The caller must prepare the ID in advance using WrapOpID.